Visual compass navigation node from the spherical or cylindrical panorama images. More...
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <cv_bridge/cv_bridge.h>
#include <ros/ros.h>
#include <nav_msgs/Odometry.h>
#include <tf/transform_broadcaster.h>
#include <sensor_msgs/image_encodings.h>
#include <image_transport/image_transport.h>
#include <vector>
#include <cmath>
Go to the source code of this file.
Classes | |
class | VisualCompass |
Defines | |
#define | _USE_MATH_DEFINES |
Functions | |
int | main (int argc, char **argv) |
Visual compass navigation node from the spherical or cylindrical panorama images.
This visual compass serves as a computationally undemanding alternative for the visual odometry and provides information about the robot rotation in the horizontal plane (z-axis). The algorithm works as follows: Because almost half of the camera image is occupied by the robot body which is statical and does not change when the robot turns, only a region of interest (ROI) is selected for the computing. The ROI is then separated to individual horizontal lines which are correlated with the corresponding lines from the previous image. The shift with a maximum correlation coefficient is then selected as the rotation shift and the resulting rotation angle is then calculated as a weighted average of all horizontal lines shifts where the correlation coefficients are used as the weights. To speed-up the algorithm, the correlation is calculated using DFT approach.
Definition in file compass.cpp.
#define _USE_MATH_DEFINES |
Definition at line 21 of file compass.cpp.
int main | ( | int | argc, |
char ** | argv | ||
) |
The main function that initializes the ROS node and calls the VisualCompass class constructor
Definition at line 211 of file compass.cpp.