This post was updated on .
Hi everyone,
I’m encountering an issue with RTAB-Map and ROS2 Bag files, and I hope someone can help me: Live Camera SetupWhen I use RTAB-Map with a live camera, all TF transformations work perfectly. NAV2 also functions without any problems, and everything is running smoothly.Problem with ROS2 Bag FilesHowever, when I record a ROS2 Bag file (ros2 bag record) and later use it for RTAB-Map (ros2 bag play), I encounter TF issues. For example, the TF tree in RViz shows errors. Strangely, RTAB-Map still runs normally, generates the map, and appears to work, but NAV2 refuses to function due to these TF issues.SLAM Toolbox Works FineUsing the same ROS2 Bag file and the same odometry algorithm with SLAM Toolbox works perfectly, which adds to my confusion.TF Tree Seems CorrectWhen I check the TF tree using tools like tf2_tools or tf_monitor, it appears to be correctly structured. Still, the errors persist. I've attached an image for reference (see attachment).My QuestionsHow can I properly record a ROS2 Bag file so that it works without TF issues in RTAB-Map?Are there any specific parameters or best practices I should follow when recording or playing back ROS2 Bags, especially for RTAB-Map? Why might SLAM Toolbox work fine with the same Bag file, but RTAB-Map struggles? If possible, could someone test the provided ROS Bag and check if they observe any TF-related error messages in the TF section of RViz? Additionally, if anyone could attempt to debug the issue or identify a potential fix, it would be incredibly helpful. ROS-BAG: https://drive.google.com/file/d/1BQAxkD3iKE98WSCGJPNZdq4SXUEqOLcN/view?usp=sharing Thanks in advance for your help! Best regards ![]() ![]() |
Administrator
|
It depends if slam_toolbox relies on /tf, if not it may indeed just work. With rtabmap, we use /tf as input, so if you are replaying a bag, make sure to play with `--clock` option and launch all rtabmap nodes with `use_sim_time:=true` parameter.
Example using your bag: ros2 launch rtabmap_launch rtabmap.launch.py rgb_topic:=/right/image_rect camera_info_topic:=/right/camera_info depth_topic:=/stereo/depth approx_sync:=false frame_id:=oak-d-base-frame use_sim_time:=true args:="-d" ros2 bag play THU_W_01_0.db3 --clock Note also when you record TF tree, use use_sim_time so that the "Recorded at time" matches to time inside the bag: $ ros2 run tf2_tools view_frames --ros-args -p use_sim_time:=true $ ros2 bag info THU_W_01_0.db3 Files: THU_W_01_0.db3 Bag size: 8.3 GiB Storage id: sqlite3 Duration: 291.330804871s Start: Nov 25 2024 07:54:40.283935768 (1732550080.283935768) End: Nov 25 2024 07:59:31.614740639 (1732550371.614740639) ... ![]() Is looks like the frame names are different in the bag than in the picture you shown, but look at the timestamps in the tree, they should be around the time recorded in the bag. If not, you will get TF warnings like you had in rviz. |
Free forum by Nabble | Edit this page |