Re: How to analyse the source code?

Posted by matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/How-to-analyse-the-source-code-tp3193p3198.html

Hi,

If you are using rgbdslam_datasets.launch, then pose estimation is indeed done in real-time. Note that in RVIZ, there are two frames representing the camera: /kinect and /kinect_est. /kinect is the one published by the bag, it is the ground truth. /kinect_est is the one estimated by rgbd_odometry and rtabmap. rgbd_odometry subscribes to ground truth only to align the first pose estimated for convenience. rtabmap subscribes to ground truth to save ground truth poses in the nodes for comparison afterward, it is not used to find or reject loop closures.

The setup looks a little hacky in this case (two parents publishing transform of same child), it is why we have to create a second /kinect_est frame to avoid any TF errors.

If you want to follow where pose estimation is done, follow rgbd_odometry code. rtabmap_ros/RGBDOdometryNode.cpp -> rtabmap_ros/OdometryROS.cpp -> rtabmap/Odometry.cpp -> rtabmap/OdometryF2M.cpp -> rtabmap/Registration.cpp -> rtabmap/RegistrationVis.cpp -> rtabmap/util3d_motion_estimation.cpp.

cheers,
Mathieu