Subscribes to incoming RGBD images and outputs the position of the moving (base) frame wrt some fixed frame. More...
#include <visual_odometry.h>
Public Member Functions | |
VisualOdometry (const ros::NodeHandle &nh, const ros::NodeHandle &nh_private) | |
Constructor from ROS nodehandles. | |
virtual | ~VisualOdometry () |
Default destructor. | |
Private Member Functions | |
bool | getBaseToCameraTf (const std_msgs::Header &header) |
Caches the transform from the base frame to the camera frame. | |
void | gftReconfigCallback (GftDetectorConfig &config, uint32_t level) |
ROS dynamic reconfigure callback function for GFT. | |
void | initParams () |
Initializes all the parameters from the ROS param server. | |
void | orbReconfigCallback (OrbDetectorConfig &config, uint32_t level) |
ROS dynamic reconfigure callback function for ORB. | |
void | publishFeatureCloud (RGBDFrame &frame) |
Publish the feature point cloud. | |
void | publishOdom (const std_msgs::Header &header) |
publishes the f2b_ (fixed-to-base) transform as an Odom message | |
void | publishPath (const std_msgs::Header &header) |
publishes the path of f2b_ (fixed-to-base) transform as an Path message | |
void | publishTf (const std_msgs::Header &header) |
publishes the f2b_ (fixed-to-base) transform as a tf | |
void | resetDetector () |
Re-instantiates the feature detector based on the detector type parameter. | |
void | RGBDCallback (const ImageMsg::ConstPtr &rgb_msg, const ImageMsg::ConstPtr &depth_msg, const CameraInfoMsg::ConstPtr &info_msg) |
Main callback for RGB, Depth, and CameraInfo messages. | |
void | starReconfigCallback (StarDetectorConfig &config, uint32_t level) |
ROS dynamic reconfigure callback function for STAR. | |
void | surfReconfigCallback (SurfDetectorConfig &config, uint32_t level) |
ROS dynamic reconfigure callback function for SURF. | |
Private Attributes | |
tf::Transform | b2c_ |
Transform from the base to the camera frame, wrt base frame. | |
std::string | base_frame_ |
Moving frame parameter. | |
ros::Publisher | cloud_publisher_ |
ROS feature cloud publisher. | |
boost::shared_ptr< ImageTransport > | depth_it_ |
Image transport for depth message subscription. | |
std::string | detector_type_ |
Feature detector type parameter. | |
tf::Transform | f2b_ |
Transform from the fixed to the base frame, wrt fixed frame. | |
boost::shared_ptr < FeatureDetector > | feature_detector_ |
The feature detector object. | |
std::string | fixed_frame_ |
Fixed frame parameter. | |
int | frame_count_ |
RGBD frame counter. | |
GftDetectorConfigServerPtr | gft_config_server_ |
ROS dynamic reconfigure server for GFT params. | |
ros::Time | init_time_ |
Time of first RGBD message. | |
bool | initialized_ |
Whether the init_time and b2c_ variables have been set. | |
MotionEstimation * | motion_estimation_ |
The motion estimation object. | |
ros::NodeHandle | nh_ |
the public nodehandle | |
ros::NodeHandle | nh_private_ |
the private nodehandle | |
ros::Publisher | odom_publisher_ |
ROS Odometry publisher. | |
OrbDetectorConfigServerPtr | orb_config_server_ |
ROS dynamic reconfigure server for ORB params. | |
PathMsg | path_msg_ |
contains a vector of positions of the Base frame. | |
ros::Publisher | path_pub_ |
ROS publisher for the VO path. | |
bool | publish_cloud_ |
If true, publish the pcl feature cloud. | |
bool | publish_odom_ |
Parameter whether to publish an odom message. | |
bool | publish_path_ |
Parameter whether to publish a path message. | |
bool | publish_tf_ |
Parameter whether to publish a ros tf. | |
int | queue_size_ |
Subscription queue size. | |
std::string | reg_type_ |
Motion estimation (registration) type parameter. | |
boost::shared_ptr< ImageTransport > | rgb_it_ |
Image transport for RGB message subscription. | |
StarDetectorConfigServerPtr | star_config_server_ |
ROS dynamic reconfigure server for STAR params. | |
ImageSubFilter | sub_depth_ |
Depth message subscriber. | |
CameraInfoSubFilter | sub_info_ |
Camera info message subscriber. | |
ImageSubFilter | sub_rgb_ |
RGB message subscriber. | |
SurfDetectorConfigServerPtr | surf_config_server_ |
ROS dynamic reconfigure server for SURF params. | |
boost::shared_ptr < RGBDSynchronizer3 > | sync_ |
Callback syncronizer. | |
tf::TransformBroadcaster | tf_broadcaster_ |
ROS transform broadcaster. | |
tf::TransformListener | tf_listener_ |
ROS transform listener. |
Subscribes to incoming RGBD images and outputs the position of the moving (base) frame wrt some fixed frame.
The class offers a selection of sparse feature detectors (GFT, ORB, SURF, STAR), as well as a selection of registration algorithms. The default registration method (ICPProbModel) aligns the incoming 3D sparse features against a persistent 3D feature model, which is continuously updated using a Kalman Filer.
Definition at line 61 of file visual_odometry.h.
ccny_rgbd::VisualOdometry::VisualOdometry | ( | const ros::NodeHandle & | nh, |
const ros::NodeHandle & | nh_private | ||
) |
Constructor from ROS nodehandles.
nh | the public nodehandle |
nh_private | the private nodehandle |
Definition at line 28 of file visual_odometry.cpp.
ccny_rgbd::VisualOdometry::~VisualOdometry | ( | ) | [virtual] |
Default destructor.
Definition at line 71 of file visual_odometry.cpp.
bool ccny_rgbd::VisualOdometry::getBaseToCameraTf | ( | const std_msgs::Header & | header | ) | [private] |
Caches the transform from the base frame to the camera frame.
header | header of the incoming message, used to stamp things correctly |
Definition at line 302 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::gftReconfigCallback | ( | GftDetectorConfig & | config, |
uint32_t | level | ||
) | [private] |
ROS dynamic reconfigure callback function for GFT.
Definition at line 324 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::initParams | ( | ) | [private] |
Initializes all the parameters from the ROS param server.
Definition at line 76 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::orbReconfigCallback | ( | OrbDetectorConfig & | config, |
uint32_t | level | ||
) | [private] |
ROS dynamic reconfigure callback function for ORB.
Definition at line 350 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::publishFeatureCloud | ( | RGBDFrame & | frame | ) | [private] |
Publish the feature point cloud.
Note: this might decrease performance
Definition at line 294 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::publishOdom | ( | const std_msgs::Header & | header | ) | [private] |
publishes the f2b_ (fixed-to-base) transform as an Odom message
header | header of the incoming message, used to stamp things correctly |
Definition at line 271 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::publishPath | ( | const std_msgs::Header & | header | ) | [private] |
publishes the path of f2b_ (fixed-to-base) transform as an Path message
header | header of the incoming message, used to stamp things correctly |
Definition at line 280 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::publishTf | ( | const std_msgs::Header & | header | ) | [private] |
publishes the f2b_ (fixed-to-base) transform as a tf
header | header of the incoming message, used to stamp things correctly |
Definition at line 264 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::resetDetector | ( | ) | [private] |
Re-instantiates the feature detector based on the detector type parameter.
Definition at line 127 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::RGBDCallback | ( | const ImageMsg::ConstPtr & | rgb_msg, |
const ImageMsg::ConstPtr & | depth_msg, | ||
const CameraInfoMsg::ConstPtr & | info_msg | ||
) | [private] |
Main callback for RGB, Depth, and CameraInfo messages.
rgb_msg | RGB message (8UC3) |
depth_msg | Depth message (16UC1, in mm) |
info_msg | CameraInfo message, applies to both RGB and depth images |
Definition at line 196 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::starReconfigCallback | ( | StarDetectorConfig & | config, |
uint32_t | level | ||
) | [private] |
ROS dynamic reconfigure callback function for STAR.
Definition at line 333 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::surfReconfigCallback | ( | SurfDetectorConfig & | config, |
uint32_t | level | ||
) | [private] |
ROS dynamic reconfigure callback function for SURF.
Definition at line 342 of file visual_odometry.cpp.
tf::Transform ccny_rgbd::VisualOdometry::b2c_ [private] |
Transform from the base to the camera frame, wrt base frame.
Definition at line 151 of file visual_odometry.h.
std::string ccny_rgbd::VisualOdometry::base_frame_ [private] |
Moving frame parameter.
Definition at line 114 of file visual_odometry.h.
ROS feature cloud publisher.
Definition at line 85 of file visual_odometry.h.
boost::shared_ptr<ImageTransport> ccny_rgbd::VisualOdometry::depth_it_ [private] |
Image transport for depth message subscription.
Definition at line 97 of file visual_odometry.h.
std::string ccny_rgbd::VisualOdometry::detector_type_ [private] |
Feature detector type parameter.
Possible values:
Definition at line 127 of file visual_odometry.h.
tf::Transform ccny_rgbd::VisualOdometry::f2b_ [private] |
Transform from the fixed to the base frame, wrt fixed frame.
Definition at line 152 of file visual_odometry.h.
boost::shared_ptr<FeatureDetector> ccny_rgbd::VisualOdometry::feature_detector_ [private] |
The feature detector object.
Definition at line 154 of file visual_odometry.h.
std::string ccny_rgbd::VisualOdometry::fixed_frame_ [private] |
Fixed frame parameter.
Definition at line 113 of file visual_odometry.h.
int ccny_rgbd::VisualOdometry::frame_count_ [private] |
RGBD frame counter.
Definition at line 148 of file visual_odometry.h.
ROS dynamic reconfigure server for GFT params.
Definition at line 88 of file visual_odometry.h.
Time of first RGBD message.
Definition at line 149 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::initialized_ [private] |
Whether the init_time and b2c_ variables have been set.
Definition at line 147 of file visual_odometry.h.
The motion estimation object.
Definition at line 156 of file visual_odometry.h.
the public nodehandle
Definition at line 80 of file visual_odometry.h.
the private nodehandle
Definition at line 81 of file visual_odometry.h.
ROS Odometry publisher.
Definition at line 84 of file visual_odometry.h.
ROS dynamic reconfigure server for ORB params.
Definition at line 91 of file visual_odometry.h.
PathMsg ccny_rgbd::VisualOdometry::path_msg_ [private] |
contains a vector of positions of the Base frame.
Definition at line 158 of file visual_odometry.h.
ROS publisher for the VO path.
Definition at line 86 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::publish_cloud_ [private] |
If true, publish the pcl feature cloud.
Note: this might slightly decrease performance
Definition at line 141 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::publish_odom_ [private] |
Parameter whether to publish an odom message.
Definition at line 117 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::publish_path_ [private] |
Parameter whether to publish a path message.
Definition at line 116 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::publish_tf_ [private] |
Parameter whether to publish a ros tf.
Definition at line 115 of file visual_odometry.h.
int ccny_rgbd::VisualOdometry::queue_size_ [private] |
Subscription queue size.
Definition at line 143 of file visual_odometry.h.
std::string ccny_rgbd::VisualOdometry::reg_type_ [private] |
Motion estimation (registration) type parameter.
Possible values:
Definition at line 135 of file visual_odometry.h.
boost::shared_ptr<ImageTransport> ccny_rgbd::VisualOdometry::rgb_it_ [private] |
Image transport for RGB message subscription.
Definition at line 94 of file visual_odometry.h.
ROS dynamic reconfigure server for STAR params.
Definition at line 89 of file visual_odometry.h.
Depth message subscriber.
Definition at line 106 of file visual_odometry.h.
Camera info message subscriber.
Definition at line 109 of file visual_odometry.h.
RGB message subscriber.
Definition at line 103 of file visual_odometry.h.
ROS dynamic reconfigure server for SURF params.
Definition at line 90 of file visual_odometry.h.
boost::shared_ptr<RGBDSynchronizer3> ccny_rgbd::VisualOdometry::sync_ [private] |
Callback syncronizer.
Definition at line 100 of file visual_odometry.h.
ROS transform broadcaster.
Definition at line 83 of file visual_odometry.h.
ROS transform listener.
Definition at line 82 of file visual_odometry.h.