RTAB-Map 3D Mapping Navigation

 

Official website of rtabmap: http://introlab.github.io/rtabmap/

rtabmap ros-humble: https://github.com/introlab/rtabmap/tree/humble-devel

7.1. Introduction

rtabmap is a SLAM method based on RGB-D images. It uses a global Bayesian loop closure detector based on bag of words and can build maps in real time in large-scale environments.

Features of rtabmap include:

7.2, Map Building

Note: When building a map, the slower the speed, the better the effect (note that the rotation speed should be slower), too fast, the effect will be very poor.

Execute the following launch files in the terminal:

  1. Start the Astra camera, this step is executed on the car side

  1. Start the chassis, this step is executed on the car side

  1. Start the map, this step is executed in the virtual machine, and multi-machine communication needs to be configured in the virtual machine

  1. Start rviz to display the map, this step is executed in the virtual machine, and multi-machine communication needs to be configured in the virtual machine

Note: If the 3D map is not displayed for a long time, or an error is reported in rviz, the reason should be: due to the limited resources of RDK X5, rtabmap mapping has to be executed in the virtual machine. The camera's RGB and depth data need to be transmitted between the RDK X5 master and the virtual machine. Unstable data transmission may cause mapping failure. The solution at this time is to connect a network cable to the RDK X5 master to improve the stability of data transmission and improve the mapping effect.

image-20241115112204532

  1. Start the keyboard control node. This step is performed in the car end, or use the remote control [Slowly move the car] to start building the map until the complete map is built

image-20241115112746564

  1. Save the map

When the map is built, just [ctrl+c] to exit the map building node, and the system will automatically save the map. The default map save path is [~/.ros/rtabmap.db]

7.3, Navigation

Execute in different terminals:

7.3.1, Start the camera [Execute on the car side]

7.3.2, Start the chassis [Execute on the car side]

7.3.3, Start rviz to display the map [Execute on the virtual machine side]

This step is executed in the virtual machine, and multi-machine communication needs to be configured in the virtual machine.

image-20241115114907686

7.3.4, Start the navigation node [virtual machine execution]

image-20241115114933321

7.3.5, Display rtabmap_viz [virtual machine execution]

rtabmap_viz is the visualization interface of RTAB-Map, which is RTAB-Map A wrapper for the GUI graphics library, similar to rviz but with options for RTAB-Map. It can subscribe to different topics, such as odom, rgb/image, depth/image, scan, etc., to display the SLAM process and results, and load the 3D map into rviz. This step is started in the virtual machine.

image-20241115115206858

7.3.6, Navigation preparation

Navigation can be divided into single-point navigation and multi-point navigation, which will be introduced below

  1. Click [2D Pose Estimate] on rviz, and then compare the position of the car to mark an initial position of the car on the map:

  2. Compare the overlap of the radar scanning point and the obstacle, and set the initial position of the car multiple times until the radar scanning point and the obstacle roughly overlap;

image-20241115113505845

7.3.7, Single-point navigation

After the initial pose is set, you can click [2D Goal Pose] to set a navigation target point, and the car will start single-point navigation;

image-20241115143618703

7.3.8, Multi-point navigation

  1. After the initial pose is set, you can click [Panels] in the upper left corner of rviz---Select [Navigation 2], and the [Navigation 2] panel will be displayed

image-20241115144127655

  1. Click [Waypoint / Nav Through Poses Mode] in the above picture, and then click [Nav2 Goal】, you can mark a target point on the map, click [Navigation2 Goal] again, you can mark the second target point on the map, and repeat the cycle to mark multiple target points at once;

image-20241115144617989

  1. After marking multiple target points, click [Start Nav Through Poses] to start multi-point navigation. After multi-point navigation is completed, the car will stay at the position of the last target point;

  2. rviz may exit during navigation, which may be caused by insufficient resources. You can turn off the display of rtabmap_viz on the virtual machine after the navigation node starts to fully display the 3D map

7.4. Node analysis

7.4.1. Display calculation graph

rosgraph

7.4.2. TF transformation

image-20241115150250123