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 | |
void | configureMotionEstimation () |
void | diagnostics (int n_features, int n_valid_features, int n_model_pts, double d_frame, double d_features, double d_reg, double d_total) |
Saves computed running times to file (or print on screen) | |
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 (rgbdtools::RGBDFrame &frame) |
Publish the feature point cloud. | |
void | publishFeatureCovariances (rgbdtools::RGBDFrame &frame) |
void | publishModelCloud () |
void | publishModelCovariances () |
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 | publishPoseStamped (const std_msgs::Header &header) |
publishes the f2b_ (fixed-to-base) transform as an pose stamped 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. | |
bool | resetposSrvCallback (Save::Request &request, Save::Response &response) |
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. | |
boost::shared_ptr< ImageTransport > | depth_it_ |
Image transport for depth message subscription. | |
std::string | detector_type_ |
Feature detector type parameter. | |
FILE * | diagnostics_file_ |
File for time recording statistics. | |
std::string | diagnostics_file_name_ |
File name for time recording statistics. | |
tf::Transform | f2b_ |
Transform from the fixed to the base frame, wrt fixed frame. | |
ros::Publisher | feature_cloud_publisher_ |
ros::Publisher | feature_cov_publisher_ |
boost::shared_ptr < rgbdtools::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. | |
ros::Publisher | model_cloud_publisher_ |
ros::Publisher | model_cov_publisher_ |
rgbdtools::MotionEstimationICPProbModel | 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. | |
ros::Publisher | pose_stamped_publisher_ |
ROS pose stamped publisher. | |
bool | publish_cloud_ |
If true, publish the pcl feature cloud. | |
bool | publish_feature_cloud_ |
bool | publish_feature_cov_ |
bool | publish_model_cloud_ |
bool | publish_model_cov_ |
bool | publish_odom_ |
Parameter whether to publish an odom message. | |
bool | publish_path_ |
Parameter whether to publish a path message. | |
bool | publish_pose_ |
Parameter whether to publish a pose 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. | |
ros::ServiceServer | reset_pos_ |
boost::shared_ptr< ImageTransport > | rgb_it_ |
Image transport for RGB message subscription. | |
bool | save_diagnostics_ |
indicates whether to save results to file or print to screen | |
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. | |
bool | verbose_ |
indicates whether to print diagnostics to screen |
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 57 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 29 of file visual_odometry.cpp.
ccny_rgbd::VisualOdometry::~VisualOdometry | ( | ) | [virtual] |
Default destructor.
Definition at line 83 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::configureMotionEstimation | ( | ) | [private] |
Definition at line 225 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::diagnostics | ( | int | n_features, |
int | n_valid_features, | ||
int | n_model_pts, | ||
double | d_frame, | ||
double | d_features, | ||
double | d_reg, | ||
double | d_total | ||
) | [private] |
Saves computed running times to file (or print on screen)
Definition at line 513 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 456 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 478 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::initParams | ( | ) | [private] |
Initializes all the parameters from the ROS param server.
Definition at line 149 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 504 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::publishFeatureCloud | ( | rgbdtools::RGBDFrame & | frame | ) | [private] |
Publish the feature point cloud.
Note: this might decrease performance
Definition at line 540 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::publishFeatureCovariances | ( | rgbdtools::RGBDFrame & | frame | ) | [private] |
< publish feature covariances
Definition at line 547 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::publishModelCloud | ( | ) | [private] |
Definition at line 552 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::publishModelCovariances | ( | ) | [private] |
< ppublish model covariances
Definition at line 559 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 422 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 442 of file visual_odometry.cpp.
void ccny_rgbd::VisualOdometry::publishPoseStamped | ( | const std_msgs::Header & | header | ) | [private] |
publishes the f2b_ (fixed-to-base) transform as an pose stamped message
header | header of the incoming message, used to stamp things correctly |
Definition at line 431 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 415 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 275 of file visual_odometry.cpp.
bool ccny_rgbd::VisualOdometry::resetposSrvCallback | ( | Save::Request & | request, |
Save::Response & | response | ||
) | [private] |
Definition at line 89 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 344 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 487 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 496 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 164 of file visual_odometry.h.
std::string ccny_rgbd::VisualOdometry::base_frame_ [private] |
Moving frame parameter.
Definition at line 120 of file visual_odometry.h.
boost::shared_ptr<ImageTransport> ccny_rgbd::VisualOdometry::depth_it_ [private] |
Image transport for depth message subscription.
Definition at line 103 of file visual_odometry.h.
std::string ccny_rgbd::VisualOdometry::detector_type_ [private] |
Feature detector type parameter.
Possible values:
Definition at line 140 of file visual_odometry.h.
FILE* ccny_rgbd::VisualOdometry::diagnostics_file_ [private] |
File for time recording statistics.
Definition at line 89 of file visual_odometry.h.
std::string ccny_rgbd::VisualOdometry::diagnostics_file_name_ [private] |
File name for time recording statistics.
Definition at line 90 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 165 of file visual_odometry.h.
Definition at line 84 of file visual_odometry.h.
Definition at line 85 of file visual_odometry.h.
boost::shared_ptr<rgbdtools::FeatureDetector> ccny_rgbd::VisualOdometry::feature_detector_ [private] |
The feature detector object.
Definition at line 167 of file visual_odometry.h.
std::string ccny_rgbd::VisualOdometry::fixed_frame_ [private] |
Fixed frame parameter.
Definition at line 119 of file visual_odometry.h.
int ccny_rgbd::VisualOdometry::frame_count_ [private] |
RGBD frame counter.
Definition at line 161 of file visual_odometry.h.
ROS dynamic reconfigure server for GFT params.
Definition at line 94 of file visual_odometry.h.
Time of first RGBD message.
Definition at line 162 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::initialized_ [private] |
Whether the init_time and b2c_ variables have been set.
Definition at line 160 of file visual_odometry.h.
Definition at line 86 of file visual_odometry.h.
Definition at line 87 of file visual_odometry.h.
The motion estimation object.
Definition at line 169 of file visual_odometry.h.
the public nodehandle
Definition at line 76 of file visual_odometry.h.
the private nodehandle
Definition at line 77 of file visual_odometry.h.
ROS Odometry publisher.
Definition at line 80 of file visual_odometry.h.
ROS dynamic reconfigure server for ORB params.
Definition at line 97 of file visual_odometry.h.
PathMsg ccny_rgbd::VisualOdometry::path_msg_ [private] |
contains a vector of positions of the Base frame.
Definition at line 171 of file visual_odometry.h.
ROS publisher for the VO path.
Definition at line 82 of file visual_odometry.h.
ROS pose stamped publisher.
Definition at line 81 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 154 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::publish_feature_cloud_ [private] |
Definition at line 126 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::publish_feature_cov_ [private] |
Definition at line 127 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::publish_model_cloud_ [private] |
Definition at line 129 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::publish_model_cov_ [private] |
Definition at line 130 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::publish_odom_ [private] |
Parameter whether to publish an odom message.
Definition at line 123 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::publish_path_ [private] |
Parameter whether to publish a path message.
Definition at line 122 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::publish_pose_ [private] |
Parameter whether to publish a pose message.
Definition at line 124 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::publish_tf_ [private] |
Parameter whether to publish a ros tf.
Definition at line 121 of file visual_odometry.h.
int ccny_rgbd::VisualOdometry::queue_size_ [private] |
Subscription queue size.
Definition at line 156 of file visual_odometry.h.
std::string ccny_rgbd::VisualOdometry::reg_type_ [private] |
Motion estimation (registration) type parameter.
Possible values:
Definition at line 148 of file visual_odometry.h.
Definition at line 88 of file visual_odometry.h.
boost::shared_ptr<ImageTransport> ccny_rgbd::VisualOdometry::rgb_it_ [private] |
Image transport for RGB message subscription.
Definition at line 100 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::save_diagnostics_ [private] |
indicates whether to save results to file or print to screen
Definition at line 91 of file visual_odometry.h.
ROS dynamic reconfigure server for STAR params.
Definition at line 95 of file visual_odometry.h.
Depth message subscriber.
Definition at line 112 of file visual_odometry.h.
Camera info message subscriber.
Definition at line 115 of file visual_odometry.h.
RGB message subscriber.
Definition at line 109 of file visual_odometry.h.
ROS dynamic reconfigure server for SURF params.
Definition at line 96 of file visual_odometry.h.
boost::shared_ptr<RGBDSynchronizer3> ccny_rgbd::VisualOdometry::sync_ [private] |
Callback syncronizer.
Definition at line 106 of file visual_odometry.h.
tf::TransformBroadcaster ccny_rgbd::VisualOdometry::tf_broadcaster_ [private] |
ROS transform broadcaster.
Definition at line 79 of file visual_odometry.h.
tf::TransformListener ccny_rgbd::VisualOdometry::tf_listener_ [private] |
ROS transform listener.
Definition at line 78 of file visual_odometry.h.
bool ccny_rgbd::VisualOdometry::verbose_ [private] |
indicates whether to print diagnostics to screen
Definition at line 92 of file visual_odometry.h.