Running rtabmap on ROS2 with zed camera data in rosbag

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

Running rtabmap on ROS2 with zed camera data in rosbag

tapan
Need help in finding resources to run rtabmap on ROS2 with zed camera data in rosbag
Reply | Threaded
Open this post in threaded view
|

Re: Running rtabmap on ROS2 with zed camera data in rosbag

dave
Hi tapan,

You should be able to find the resources on the GitHub page of the repository, there is an example inside the rtabmap_launch directory: https://github.com/introlab/rtabmap_ros/tree/ros2/rtabmap_launch

The example is as follows:

```
ros2 launch rtabmap_launch rtabmap.launch.py \
    rtabmap_args:="--delete_db_on_start" \
    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 \
    frame_id:=zed_camera_link \
    approx_sync:=false \
    wait_imu_to_init:=true \
    imu_topic:=/zed/zed_node/imu/data \
    rviz:=true
```
In the example above, it assumes you use the depth module of the ZED camera.

If you want to use the ZED camera as a stereo camera, you can use the following, like me (I use the ZED2 camera):

"""
ros2 launch rtabmap_launch rtabmap.launch.py \
    stereo:=true \
    use_sim_time:=true \
    frame_id:=zed2_left_camera_frame \
    args:="--delete_db_on_start" \
    left_image_topic:=/zed2/zed_node/left/image_rect_color \
    right_image_topic:=/zed2/zed_node/right/image_rect_color \
    left_camera_info_topic:=/zed2/zed_node/left/camera_info \
    right_camera_info_topic:=/zed2/zed_node/right/camera_info
"""

Note that, as you want to use a rosbag, you might want to set the parameter `use_sim_time:=true` so rtabmap can use the time from the rosbag instead of the system time.

Let me know if you have more questions.

With kind regards,
Dave