Overview
ORB-SLAM3 ROS nodes support all sensor configurations:- Mono: Monocular camera
- Mono_Inertial: Monocular camera with IMU
- Stereo: Stereo camera pair
- Stereo_Inertial: Stereo cameras with IMU
- RGBD: RGB-D depth camera
- MonoAR: Monocular with augmented reality demo
ROS integration has been tested with ROS Melodic on Ubuntu 18.04. It should work with other ROS distributions with minimal modifications.
Building ROS Nodes
Prerequisites
Before building ROS nodes:- Install ROS: Follow instructions at ros.org
- Build ORB-SLAM3: Complete the main build process first
- Source ROS:
source /opt/ros/melodic/setup.bash
Setup ROS Package Path
Build the ROS Nodes
Use the provided build script:- Navigates to
Examples_old/ROS/ORB_SLAM3 - Creates a build directory
- Runs CMake with
ROS_BUILD_TYPE=Release - Compiles all ROS nodes
Build Output
After successful compilation, executables are created:ROS Node Types
Monocular Node
Processes monocular camera images from/camera/image_raw:
/camera/image_raw(sensor_msgs/Image)
Monocular-Inertial Node
Processes monocular images with IMU data:/camera/image_raw(sensor_msgs/Image)/imu(sensor_msgs/Imu)
EQUALIZATION: Set totrueto apply CLAHE histogram equalization (useful for TUM-VI dataset)
Stereo Node
Processes stereo camera pair:/camera/left/image_raw(sensor_msgs/Image)/camera/right/image_raw(sensor_msgs/Image)
true: Node rectifies images (provide rectification matrices in YAML)false: Images must be pre-rectified- Not needed for fisheye cameras (works with original images)
Stereo-Inertial Node
Processes stereo cameras with IMU:/camera/left/image_raw(sensor_msgs/Image)/camera/right/image_raw(sensor_msgs/Image)/imu(sensor_msgs/Imu)
RGB-D Node
Processes RGB-D depth camera:/camera/rgb/image_raw(sensor_msgs/Image)/camera/depth_registered/image_raw(sensor_msgs/Image)
Topic Configuration
By default, ROS nodes subscribe to standard topics. Remap topics when running with different camera drivers:Topic Remapping
Default Topic Names
Monocular
/camera/image_raw
Stereo
/camera/left/image_raw/camera/right/image_raw
RGB-D
/camera/rgb/image_raw/camera/depth_registered/image_raw
IMU
/imu
Running with ROS Bags
Test ORB-SLAM3 with recorded ROS bags:Complete Example: EuRoC Stereo-Inertial
Playback Tips
TUM-VI Dataset Rebag Issue
TUM-VI rosbags may have playback issues due to large chunk size:Running with Live Cameras
Using RealSense Cameras
For Intel RealSense cameras, use therealsense-ros package:
USB Webcam
For simple USB cameras:Troubleshooting
Node doesn't start: ROS_PACKAGE_PATH error
Node doesn't start: ROS_PACKAGE_PATH error
Cause: ROS can’t find ORB-SLAM3 package.Solution:
Vocabulary takes forever to load
Vocabulary takes forever to load
Cause: Text vocabulary file is slow to parse.Solution: Be patient (30-60 seconds). Consider converting to binary format for faster loading.
No images received
No images received
Cause: Topic mismatch or message type incompatibility.Solution:
IMU initialization fails
IMU initialization fails
Cause: Insufficient IMU data, poor calibration, or timestamp issues.Solution:
- Ensure IMU publishing at correct frequency (check config:
IMU.Frequency) - Verify camera-IMU timestamps are synchronized
- Check IMU calibration parameters in YAML
- Provide sufficient motion during initialization (15-20 seconds)
Tracking lost immediately
Tracking lost immediately
Cause: Incorrect camera calibration or configuration.Solution:
- Verify camera calibration parameters in YAML
- Check image resolution matches config (
Camera.width,Camera.height) - Ensure vocabulary file loaded correctly
- Test with lower ORB threshold (
ORBextractor.minThFAST: 5) - Verify sufficient visual texture in scene
Stereo depth inconsistent
Stereo depth inconsistent
Cause: Stereo synchronization or rectification issues.Solution:
- Ensure stereo images are properly synchronized
- Check
Stereo.T_c1_c2transformation is correct - Verify baseline (
Stereo.ThDepth) is appropriate - For pinhole: Enable online rectification or pre-rectify images
Performance Optimization
Real-Time Performance Tips
Saving Trajectory
After running ORB-SLAM3, save the estimated trajectory:Next Steps
- Map Saving and Loading - Persist and reuse maps
- Configuration Guide - Customize ROS node settings
- EuRoC Examples - Test with benchmark datasets