rtabmap_ros icon indicating copy to clipboard operation
rtabmap_ros copied to clipboard

can't get anything from rtabmap when replaying the rosbag

Open parastoobakhtiarii opened this issue 7 months ago • 1 comments

ROS2 Version: Humble RTABMap Version: RTABMap ROS2 Latest

Hi Matlabbe, I captured a ros2bag with my zed2i camera with this command: camera launch: ros2 launch zed_wrapper zed_camera.launch.py camera_model:=zed2i

ros2 bag record -o zed2i /tf /tf_static /zed/zed_node/rgb/image_rect_color /zed/zed_node/depth/depth_registered /zed/zed_node/rgb/camera_info /zed/zed_node/imu/data \ after launching rtabmap with this command:

ros2 launch rtabmap_launch rtabmap.launch.py
args:="--delete_db_on_start"
frame_id:=zed_camera_link
odom_topic:=/zed/zed_node/odom
visual_odometry:=false
rgb_topic:=/zed/zed_node/rgb/image_rect_color
depth_topic:=/zed/zed_node/depth/depth_registered
camera_info_topic:=/zed/zed_node/rgb/camera_info
wait_imu_to_init:=true
imu_topic:=/zed/zed_node/imu/data
rviz:=true
approx_sync:=false
rgbd_sync:=true
approx_rgbd_sync:=false
topic_queue_size:=2

I recieved this while showing nothing in Gui: [rtabmap-2] [WARN] [1746483355.608654908] [rtabmap.rtabmap]: rtabmap: Did not receive data since 5 seconds! Make sure the input topics are published ("$ ros2 topic hz my_topic") and the timestamps in their header are set. If topics are coming from different computers, make sure the clocks of the computers are synchronized ("ntpdate"). Parameter "approx_sync" is false, which means that input topics should have all the exact timestamp for the callback to be called. [rtabmap-2] rtabmap subscribed to (exact sync): [rtabmap-2] /rtabmap/odom
[rtabmap-2] /camera/rgb/image_rect_color
[rtabmap-2] /camera/depth_registered/image_raw
[rtabmap-2] /camera/rgb/camera_info
[rtabmap-2] /rtabmap/odom_info

I also have a ros2bag recorded using this command:

ros2 bag record -o zed2i \
/tf \
/tf_static \
/zed/zed_node/depth/camera_info \
/zed/zed_node/depth/depth_registered \
/zed/zed_node/imu/data \
/zed/zed_node/left/camera_info \
/zed/zed_node/left/image_rect_color/compressed \
/zed/zed_node/odom \
/zed/zed_node/path_map \
/zed/zed_node/path_odom \
/zed/zed_node/pose_with_covariance \
/zed/zed_node/right/camera_info \
/zed/zed_node/right/image_rect_color/compressed

Would you please guide me in this matter?

parastoobakhtiarii avatar May 05 '25 22:05 parastoobakhtiarii

It looks like in your first command, there are missing "\":

ros2 launch rtabmap_launch rtabmap.launch.py \
   args:="--delete_db_on_start" \
   frame_id:=zed_camera_link \
   odom_topic:=/zed/zed_node/odom \
   visual_odometry:=false \
   rgb_topic:=/zed/zed_node/rgb/image_rect_color \
   depth_topic:=/zed/zed_node/depth/depth_registered \
   camera_info_topic:=/zed/zed_node/rgb/camera_info \
   wait_imu_to_init:=true \
   imu_topic:=/zed/zed_node/imu/data \
   rviz:=true \
   approx_sync:=false \
   rgbd_sync:=true \
   approx_rgbd_sync:=false \
   topic_queue_size:=2 \
   use_sim_time:=true

[...]
[rgbd_sync-1] rgbd_sync subscribed to (exact sync):
[rgbd_sync-1]    /zed/zed_node/rgb/image_rect_color,
[rgbd_sync-1]    /zed/zed_node/depth/depth_registered,
[rgbd_sync-1]    /zed/zed_node/rgb/camera_info
[...]
[rtabmap-2] rtabmap subscribed to (exact sync):
[rtabmap-2]    /zed/zed_node/odom \
[rtabmap-2]    /rtabmap/rgbd_image
[...]
[rtabmap_viz-3] rtabmap_viz subscribed to (exact sync):
[rtabmap_viz-3]    /zed/zed_node/odom \
[rtabmap_viz-3]    /rtabmap/rgbd_image
[...]

And with the first rosbag command, the odom topic is missing, I tried with this bag and the command above and it works:

$ ros2 bag record -o zed2i \
   /tf \
   /tf_static \
   /zed/zed_node/rgb/image_rect_color \
   /zed/zed_node/depth/depth_registered \
   /zed/zed_node/rgb/camera_info \
   /zed/zed_node/imu/data \
   /zed/zed_node/odom

$ ros2 bag play zed2i --clock

Note that you should play the bag with --clock and launch rtabmap with use_sim_time:=true.

matlabbe avatar May 11 '25 02:05 matlabbe