How to analyse the source code?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How to analyse the source code?

sheenGeng
Sir , i'm greenhand with rtabmap(and rtabmap_ros).

i want to test rtabmap with rgbd datasets from TUM. i want to know where the pose estimation was computed, but i can't find the calling code of Feature detection, Matching and so on . i wonder if  the pose information is offered by the rosbag (topic tf or odom?)?

the instructions i use are:

rosbag play --clock rgbd_dataset_freiburg1_floor.orig.bag
roslaunch rtabmap_ros rgbdslam_datasets.launch

thkU.
Reply | Threaded
Open this post in threaded view
|

Re: How to analyse the source code?

sheenGeng
now i have found "Orb.cpp and solvepnp.cpp" in rtabmap project . but i still wonder if the tf information was obtained from dataset , not computed real-time.
Reply | Threaded
Open this post in threaded view
|

Re: How to analyse the source code?

matlabbe
Administrator
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
Reply | Threaded
Open this post in threaded view
|

Re: How to analyse the source code?

sheenGeng
grateful to you ,

i noticed that when i execute the instruction roslaunch , there are 2 lines


/rtabmap/odom_msg_to_tf/frame_id: kinect_est
/rtabmap/rgbd_odometry/frame_id: kinect



it may correspond to what you said

one more Q: where could i get a summary or outline of rtabmap , especially the each part of RGBD , Paper or other ways ? these two projects is a little large to me (compared with rgbdslamv2 or others) , before you replied me, i had to insert output code in different source code file to confirm which function was called, which took me a lot of time to compile again an again.

Reply | Threaded
Open this post in threaded view
|

Re: How to analyse the source code?

matlabbe
Administrator
This post was updated on .
Hi,

For the SLAM back-end: see Online Global Loop Closure Detection for Large-Scale Multi-Session Graph-Based SLAM and Appearance-Based Loop Closure Detection for Online Large-Scale and Long-Term Operation. For the SLAM front-end (visual odometry), there is no paper yet (general info here).

If you want to see which part of the code is called, launch in debug mode, you will have a lot of debug messages on terminal. To do so, add "--udebug" or "--uinfo" argument when launching rtabmap or rgbd_odometry nodes.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: How to analyse the source code?

sheenGeng
i followed your suggestion and obained [DEBUG] information, but process odometry always crash after
transformFromXYZCorrespondences , is it common ?

PS: my version is pulled from git yesterday

[DEBUG] (2017-05-25 07:47:44.638) VWDictionary.cpp:751::addNewWords() Time to find nn = 0.018890 s
[DEBUG] (2017-05-25 07:47:44.640) VWDictionary.cpp:872::addNewWords() naive search and add ref/words time = 0.001608 s
[DEBUG] (2017-05-25 07:47:44.640) VWDictionary.cpp:874::addNewWords() 489 new words added...
[DEBUG] (2017-05-25 07:47:44.640) VWDictionary.cpp:876::addNewWords() 366 duplicated words added (from current image = 0)...
[DEBUG] (2017-05-25 07:47:44.640) VWDictionary.cpp:877::addNewWords() total time 0.020614s
[DEBUG] (2017-05-25 07:47:44.640) VWDictionary.cpp:520::clear()
[DEBUG] (2017-05-25 07:47:44.644) VWDictionary.cpp:520::clear()
[DEBUG] (2017-05-25 07:47:44.648) RegistrationVis.cpp:1201::computeTransformationImpl()
[DEBUG] (2017-05-25 07:47:44.649) util3d_motion_estimation.cpp:223::estimateMotion3DTo3D() Unique correspondences = 349
[DEBUG] (2017-05-25 07:47:44.649) util3d_registration.cpp:83::transformFromXYZCorrespondences() iterations=100 inlierThreshold=0.100000
[rtabmap/rgbd_odometry-2] process has died [pid 21978, exit code -11, cmd /home/sheen/catkin_ws/devel/lib/rtabmap_ros/rgbd_odometry --udebug rgb/image:=/camera/rgb/image_color depth/image:=/camera/depth/image rgb/camera_info:=/camera/rgb/camera_info odom:=vis_odom __name:=rgbd_odometry __log:=/home/sheen/.ros/log/36e18f56-40d8-11e7-a3c1-a088698161c2/rtabmap-rgbd_odometry-2.log].
log file: /home/sheen/.ros/log/36e18f56-40d8-11e7-a3c1-a088698161c2/rtabmap-rgbd_odometry-2*.log
Reply | Threaded
Open this post in threaded view
|

Re: How to analyse the source code?

sheenGeng
In reply to this post by matlabbe
i found this page in github->issue
Segmentation fault in transformFromXYZCorrespondences() when building with ZED SDK support #130

and i will compile again without ZED