RTAB-Map Documentation
repository·master·Indexed 26 days ago
https://github.com/introlab/rtabmapA library and standalone application for real-time loop closure detection and mapping used in robotics. It includes tools for 2D and 3D pose graph optimization using Ceres, camera calibration (rtabmap-calibration), camera testing (rtabmap-camera, CameraRGBD), and IMU filtering. RTAB-Map supports integration with ROS (Noetic, Humble, Jazzy, Kilted, Lyrical, and Rolling) and provides Docker environments for reproducing SLAM results on KITTI, EuRoC, and TUM datasets.
What's inside RTAB-Map
- RTAB-Map is both a library and a standalone application used for real-time loop closure detection and mapping. It can be used as a standalone tool or integrated into robotics frameworks like ROS.
Use IMU filters for orientation estimation
masterThe
imufiltermodule provides two primary filters for fusing IMU data (angular velocities, accelerations, and optionally magnetic readings) into an orientation:MadgwickFilter: Fuses sensor readings into an orientation. Note: This filter is licensed under GPL.ComplementaryFilter: Fuses sensor readings into an orientation quaternion using a complementary fusion approach. This filter is licensed under BSD.
Disable MadgwickFilter to avoid GPL licensing
masterThe
MadgwickFilteris licensed under GPL. If you need to avoid GPL licensing in your project, you can disable this filter during the compilation process by passing theWITH_MADGWICKflag to CMake.cmake -DWITH_MADGWICK=OFF ..Run dataset processing scripts
masterUse the provided shell scripts to run the SLAM processing. Results are written to
results/euroc,results/kitti, andresults/tumsubfolders.Note: Running all datasets with all odometry approaches can take over 10 hours. You can modify
run_all.shto limit the scope.- Process all datasets:
./run_all.sh - Process KITTI sequence 07 with F2M odometry:
./run_kitti_datasets.sh f2m 0 0 07
- Process all datasets:
Use RTAB-Map via Docker
masterRTAB-Map is available as a Docker image for containerized deployment. You can pull the image from Docker Hub:
introlab3it/rtabmap.Synchronize TUM datasets using associate.py
masterBefore processing TUM datasets, you must synchronize the RGB and depth images using the
associate.pyscript. This createsrgb_syncanddepth_syncfolders.Usage:
python associate.py rgb.txt depth.txtpython associate.py rgb.txt depth.txtRun the Pose Graph 2D optimizer
masterThe
pose_graph_2dexecutable solves 2D pose graph optimization problems using Ceres. It accepts problem definitions in theg2oformat.When run, the executable prints the Ceres solver summary to the console and generates two output files:
poses_original.txt: The initial poses before optimization.poses_optimized.txt: The optimized poses.
Each output file contains poses in the following format, sorted by
pose_idin ascending order:pose_id x y yaw_radians/path/to/bin/pose_graph_2d --input /path/to/dataset/dataset.g2oInstall RTAB-Map for ROS
masterTo use RTAB-Map within the Robot Operating System (ROS), you can install the corresponding ROS binaries. The package name follows the pattern
ros-$ROS_DISTRO-rtabmap.Available ROS distributions include:
- ROS 1: Noetic
- ROS 2: Humble, Jazzy, Kilted, Lyrical, and Rolling
For detailed installation instructions and examples, refer to the RTAB-Map wiki. For ROS-specific integration, visit the ROS wiki page.
Run the Pose Graph 3D optimizer
masterThe
pose_graph_3dexecutable performs 3D pose graph optimization using Ceres. It accepts problem definitions in theg2oformat that use quaternions for orientation.Upon completion, the tool prints a Ceres solver summary and generates two files:
poses_original.txt: The initial poses.poses_optimized.txt: The optimized poses.
Both files follow this format (sorted by
pose_idin ascending order):pose_id x y z q_x q_y q_z q_w/path/to/bin/pose_graph_3d --input /path/to/dataset/dataset.g2oSet up the JFR 2018 reproduction Docker environment
masterThis Docker image is used to reproduce the results presented in the paper "RTAB-Map as an Open-Source Lidar and Visual SLAM Library for Large-Scale and Long-Term Online Operation" (Labbé and Michaud, 2018) for KITTI, EuRoC, and TUM datasets.
You can either pull the pre-built image or build it locally from the provided
Dockerfile.# Pull the pre-built image docker pull introlab3it/rtabmap:jfr2018 # Or build it locally cd rtabmap/docker/jfr2018 docker build -t introlab3it/rtabmap:jfr2018 .Organize datasets for JFR 2018 reproduction
masterTo use the reproduction scripts, you must organize your datasets in a
datasetssubfolder relative to the scripts. The directory structure must follow this pattern:datasets/ kitti/ devkit dataset/sequences/00 ... euroc/ MH_01_easy ... tum/ rgbd_dataset_freiburg1_desk ... run_all.sh run_kitti_datasets.sh run_euroc_datasets.sh run_tum_datasets.shVisualize Pose Graph 3D results
masterYou can visualize the difference between initial and optimized poses using the provided Python script. Use the
--axes_equalflag if you want to enable equal axes in the visualization./path/to/repo/examples/slam/pose_graph_3d/plot_results.py --optimized_poses ./poses_optimized.txt --initial_poses ./poses_original.txt