RTAB-Map Setup¶
This guide covers setting up RTAB-Map to provide SLAM poses for RTSM.
Overview¶
RTSM needs camera poses (position + orientation) to project 2D detections into 3D space. RTAB-Map is a popular open-source visual SLAM system that works well with RGB-D cameras.
Installation¶
Ubuntu / WSL2¶
Or build from source:
git clone https://github.com/introlab/rtabmap.git
cd rtabmap/build
cmake ..
make -j$(nproc)
sudo make install
Windows¶
Download from RTAB-Map releases.
Running with RealSense¶
Option 1: Standalone (No ROS)¶
This opens the RTAB-Map GUI with RealSense input.
Option 2: ROS 2¶
ros2 launch rtabmap_launch rtabmap.launch.py \
rgb_topic:=/camera/color/image_raw \
depth_topic:=/camera/depth/image_rect_raw \
camera_info_topic:=/camera/color/camera_info
ZeroMQ Bridge¶
RTSM expects poses via ZeroMQ. Use the bridge utility:
# From the rtsm-rtabmap-bridge repo
python rtabmap_zmq_bridge.py --rtabmap-addr localhost:5555 --zmq-pub tcp://*:5556
Message Format¶
The bridge publishes pose messages:
{
"timestamp": 1705312200.123,
"position": [1.2, 0.4, 2.1],
"orientation": [0.0, 0.0, 0.0, 1.0],
"frame_id": 12345
}
Configuration¶
RTAB-Map Parameters¶
For indoor robotics, these defaults work well:
RTSM Configuration¶
In config/rtsm.yaml:
Troubleshooting¶
"No poses received"¶
- Check RTAB-Map is running and tracking
- Verify ZMQ bridge is connected:
netstat -an | grep 5556 - Check for firewall blocking localhost ports
Drift / Poor Tracking¶
- Ensure adequate lighting
- Add visual features to the environment (avoid blank walls)
- Reduce camera motion speed
- Enable loop closure in RTAB-Map
WSL2 USB Issues¶
WSL2 doesn't natively support USB. Use usbipd-win:
Next Steps¶
- RealSense Setup — Camera configuration
- Configuration — RTSM settings