rtabmap_ros icon indicating copy to clipboard operation
rtabmap_ros copied to clipboard

Is the processing of the image duplicated by rgbd-node and rtabmap-node???

Open LeslieJay opened this issue 10 months ago • 1 comments

In the ROS2 Humble version, the RGBD node generates odometer information by subscribing to color images and depth images, and the RTABMAP node also generates maps by subscribing to color images and depth images. Is the processing of the image duplicated by these two nodes? If it is duplicated, why doesn't the rtabmap node directly use the processing result of the rgbd node? here is my command line: ros2 launch rtabmap_examples rgbd_slam_datasets.launch.py

LeslieJay avatar Feb 14 '25 02:02 LeslieJay

Yes, both would reprocess independently the images by default. We can however optimize how data is transferred to avoid duplicating same processes (e.g., re-extracting same visual features already extracted from vo). I updated rgbd_slam_datasets.launch.py in commit above to link vo's output odom_rgbd_image to corresponding input of rtabmap and rtabmap_viz nodes. odom_rgbd_image contains 2d keypoints, 3d points and descriptors for each feature extracted by vo. With Mem/UseOdomFeatures on rtabmap side, the features received from that topic are directly used in slam back-end.

Here is a comparison of computation time without and with this optimization respectively, from rtabmap node point of view:

Image

Image

We roughly save 7.6 ms per frame in this example. Another optimization could be to use Composable Nodes to avoid serialization/deserialization of odom_rgbd_image.

matlabbe avatar Mar 02 '25 01:03 matlabbe