Behavior of rtabmap different in ROS2 compared to ROS1

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

Behavior of rtabmap different in ROS2 compared to ROS1

akc
Hello ,

I have tested out the ROS2 branch of RtabMap and I am facing some issues.

What I have done

General specs

OS: Ubuntu 20.04

Branches
:
 -- introlab/rtabmap : master
 -- introlab/rtabmap_ros : ros2

ROS2 version : Galactic

Details

Modifying the standard launch file rtabmap.py.launch (please find attached the launch file stereo_rtabmap.launch.py)
and launch it with the below cmd:

ros2 launch rtabmap_ros stereo_rtabmap.launch.py stereo:=true

For the dataset,  converted a ROS1 bag to ROS2 using the rosbags-converter tool

playing the bag using the --clock and --qos-profile-overrides-path to match the qos needed for rtabmap

Note stereo proc was run externally (local build) , as stereo proc in galactic seems broken.


What are the issues being faced


The issue I face is that I have the same data ROS1 where I  rtabmap run smoothly but in ROS2 the same dataset  doesn't yield the same results.

The image in the Rtabmap GUI updates very slowly and erratically, I crossed checked it in rviz and the image stream is fine.


Question


is there something that still needs to be done to make it work? and how?


stereo_rtabmap.py

Best regards

Anil Kumar C
Reply | Threaded
Open this post in threaded view
|

Re: Behavior of rtabmap different in ROS2 compared to ROS1

matlabbe
Administrator
Can you share the converted or original bag? Maybe there is a problem with the conversion.
akc
Reply | Threaded
Open this post in threaded view
|

Re: Behavior of rtabmap different in ROS2 compared to ROS1

akc
Hello ,

Thank you for the quick reply.

Please download the datasets from this link . I have put both the ros1 and ros2 datasets  zipped.

To run in ros1 I am using this file : ros1_stereo_mapping.launch


Best regards
Reply | Threaded
Open this post in threaded view
|

Re: Behavior of rtabmap different in ROS2 compared to ROS1

matlabbe
Administrator
Hi,

The recorded images are not rectified. In your ros1 launch file, you feed correctly the output of stereo_image_proc in rtabmap. For ros2, it was more complicated to test your launch file. To go around stereo_image_proc and use only rtabmap.launch or rtabmap.launch.py, we can use Rtabmap/ImagesAlreadyRectified parameter to tell rtabmap to rectify the images for convenience. One issue with your bag is that the camera_info doesn't include a frame_id. I did a patch in this commit (also merged to ros2 branch) as a workaround as the calibration contains the baseline.

ROS1:
roslaunch rtabmap_ros rtabmap.launch \
    stereo_namespace:=/stereo \
    left_image_topic:=/stereo/left/image_raw \
    right_image_topic:=/stereo/right/image_raw \
    stereo:=true \
    frame_id:=camera_link \
    use_sim_time:=true \
    args:="-d --Rtabmap/ImagesAlreadyRectified false"

rosbag play --clock --pause sample_ros1.bag


ROS2:
ros2 launch rtabmap_ros rtabmap.launch.py \
    stereo_namespace:=/stereo \
    left_image_topic:=/stereo/left/image_raw \
    right_image_topic:=/stereo/right/image_raw \
    stereo:=true \
    frame_id:=camera_link \
    use_sim_time:=true \
    args:="-d --Rtabmap/ImagesAlreadyRectified false"

ros2 bag play  sample_ros2.db3  --clock

The paths are pretty similar:
akc
Reply | Threaded
Open this post in threaded view
|

Re: Behavior of rtabmap different in ROS2 compared to ROS1

akc
Hello

Thanks for the update, it works on my side too :)

Best,