RTAB-Map Mapping

RTAB-Map Mapping1. Contents1.1 Introduction to RTAB-Map1.2. RTAB-Map Working Principle2. Preparation3. Program Startup4. Instruction analysis

1. Contents

This section explains how to combine a vehicle chassis, LiDAR, and a depth camera to implement RTAB-Map mapping.

1.1 Introduction to RTAB-Map

RTAB-MAP (Real-Time Appearance-Based Mapping) is a vision-based real-time simultaneous localization and mapping (SLAM) algorithm primarily used for mapping and navigation tasks in fields such as robotics and augmented reality. RTAB-Map has the following features.

1.2. RTAB-Map Working Principle

This section requires entering commands in the terminal. The terminal you open depends on your motherboard type. This lesson uses the Raspberry Pi 5 as an example. For Raspberry Pi and Jetson-Nano boards, you need to open a terminal on the host computer and enter the command to enter the Docker container. Once inside the Docker container, enter the commands mentioned in this section in the terminal. For instructions on entering the Docker container from the host computer, refer to this product tutorial [Configuration and Operation Guide]--[Enter the Docker (Jetson Nano and Raspberry Pi 5 users, see here)].

For Orin boards, simply open a terminal and enter the commands mentioned in this lesson.

2. Preparation

Due to performance limitations, the Raspberry Pi 5 and Jetson Nano cannot smoothly run the RTAB-Map algorithm in Docker on the motherboard. Therefore, a virtual machine is required to facilitate this. To enable distributed communication between the vehicle and the virtual machine, two steps are required:

The Orin motherboard can be run directly on the motherboard.

3. Program Startup

First, enter the following command in the robot terminal to start the chassis, radar, and camera.

Then, open a terminal in the virtual machine and enter the following command to control the robotic arm to move to the mapping pose.

Open a terminal in the virtual machine and enter the following command to start RTAB-Map mapping.

After successful startup, the image below appears.

image-20250702104455365

Modify the settings in rviz to change the point cloud display to RGB, as shown below.

image-20250702104421539

Finally, open a terminal in the virtual machine and enter the following command to enable keyboard control of the car's movement and mapping.

Here, control the car's movement as slowly as possible. Press the [z] key to reduce the linear velocity and deceleration. Then, press the [i] key to move the car forward, the [,] key to move it backward, the [j] key to rotate the car left, and the [l] key to rotate the car right.

As shown below, the map is complete.

image-20250702115425093

After the map is created, press Ctrl+C in the terminal where you launched rtabmap.launch.py to close the program. The map will be saved in /home/yahboom/.ros/rtabmap.db.

4. Instruction analysis

RTAB-Map mapping instructions are as follows: