Practical engineering guide
What you can build with RTAB-Map and where problems start
RTAB-Map performs graph-based mapping and localization using visual, depth and/or LiDAR observations, with appearance-based loop closure and pose-graph optimization. It needs compatible odometry and synchronized sensor data for metric SLAM.
Download, install and launch RTAB-Map
On Ubuntu 24.04 with ROS 2 Jazzy installed, install the RTAB-Map ROS package. Check its launch files, then choose the launch that matches the recorded RGB-D or stereo data; do not enable mapping before confirming calibration.
Download RTAB-Mapsudo apt update
sudo apt install ros-jazzy-rtabmap-ros
source /opt/ros/jazzy/setup.bash
ros2 pkg prefix rtabmap_rosA first test you can reproduce
- 01.Pick a sensor configuration: RGB-D, stereo, 2D scan or 3D point cloud and inspect the matching ROS 2 example.
- 02.Calibrate the camera pair or depth source and publish correct camera_info, odom and TF transforms.
- 03.Run a short mapping loop that revisits the same location and inspect accepted and rejected loop closures.
- 04.Save the map database, restart in localization mode and confirm relocalization in a known corridor.
Questions that come up during real implementation
Why does RTAB-Map create a distorted map or no loop closures?
Check depth scale, image rectification, camera timestamps and odometry drift. Feature-poor scenes, blur and repetitive textures can defeat place recognition. Examine loop-closure scores and geometric verification rather than forcing a lower threshold as the first fix.
Can RTAB-Map combine cameras and LiDAR?
Yes, supported ROS setups can consume RGB-D or stereo inputs alongside laser scans or point clouds. Fusion requires synchronized observations and proper extrinsics; ICP refinement can fail if clouds have wrong units or frame alignment. Validate each modality separately.
What is the difference between mapping mode and localization mode?
Mapping adds observations and grows or updates a pose graph. Localization searches for a pose in an existing database. For a deployed robot, control map updates deliberately and verify that the saved database is loaded when restarting.
Checks before using it on a robot
- Evaluate drift before and after loop closure on a route with known points.
- Check whether localization resumes after a sensor dropout or robot relocation.
Official technical reference
https://github.com/introlab/rtabmap_ros/blob/ros2/rtabmap_slam/doc/rtabmap.mdCompatibility and installation
- Developer
- RTAB-Map project
- License
- Open source
- Operating systems
- Linux, Windows, macOS
- ROS support
- ROS, ROS 2
- Languages
- C++
- Installation method
- Official releases, ROS packages and source builds