This guide explains how to use AirSLAM with live ROS topics from Intel RealSense D455 camera instead of pre-recorded datasets.
We've added live topic support to AirSLAM while preserving the original file-based functionality:
- Original:
visual_odometry- reads from EuRoC dataset files - NEW:
visual_odometry_live- subscribes to live ROS topics
include/ros_dataset.h- ROS topic-based dataset headersrc/ros_dataset.cc- ROS topic-based dataset implementationdemo/visual_odometry_live.cpp- Live topic visual odometry nodelaunch/visual_odometry/vo_d455_live.launch- Live D455 launch filelaunch/visual_odometry/vo_d455_complete.launch- Complete setup launch file
CMakeLists.txt- Added message_filters dependency and new executable
- All original files remain unchanged and functional
- Original
visual_odometrynode still works with datasets
cd ~/catkin_ws
source /home/robot/ros_catkin_ws/install_isolated/setup.bash
catkin_make
source devel/setup.bashIn Terminal 1:
source /opt/ros/humble/setup.bash
# Start D455 with clean IR images (no projector)
ros2 run realsense2_camera realsense2_camera_node --ros-args \
-p enable_infra1:=true \
-p enable_infra2:=true \
-p enable_depth:=false \
-p enable_color:=false \
-p enable_gyro:=true \
-p enable_accel:=true \
-p unite_imu_method:=2 \
-p infra_width:=848 -p infra_height:=480 -p infra_fps:=30 \
-p publish_tf:=true \
-p enable_auto_exposure:=true \
-p depth_module.emitter_enabled:=0 \
-p depth_module.emitter_always_on:=falseIn Terminal 2:
source /home/robot/ros_catkin_ws/install_isolated/setup.bash # ROS1
source /opt/ros/humble/setup.bash # ROS2
source ~/bridge_ws/install/setup.bash # Bridge workspace
# Start the bridge
ros2 run ros1_bridge dynamic_bridge --bridge-all-topicsIn Terminal 3:
cd ~/catkin_ws
source /home/robot/ros_catkin_ws/install_isolated/setup.bash
source devel/setup.bash
# Run live visual odometry
roslaunch air_slam vo_d455_live.launchThe live node subscribes to these topics by default:
- Left camera:
/camera/camera/infra1/image_rect_raw - Right camera:
/camera/camera/infra2/image_rect_raw - IMU data:
/camera/camera/imu
To use different topic names:
roslaunch air_slam vo_d455_live.launch \
left_image_topic:="/your/left/topic" \
right_image_topic:="/your/right/topic" \
imu_topic:="/your/imu/topic"| Parameter | Description | Default |
|---|---|---|
use_live_topics |
Enable topic mode (vs file mode) | true |
left_image_topic |
Left camera topic | /camera/camera/infra1/image_rect_raw |
right_image_topic |
Right camera topic | /camera/camera/infra2/image_rect_raw |
imu_topic |
IMU topic | /camera/camera/imu |
- Uses
message_filtersfor stereo image synchronization - Approximate time policy with 10ms tolerance
- Handles slight timestamp differences between left/right cameras
- IMU data is buffered independently
- Associated with image frames based on timestamps
- IMU data between consecutive frames is grouped together
- All data buffers are mutex-protected
- Safe for concurrent ROS callbacks and processing
- Buffer sizes limited to prevent memory issues (100 stereo pairs, 1000 IMU samples)
- Processing rate limited to 30 Hz to prevent overwhelming
- Queue-based processing ensures real-time performance
roslaunch air_slam vo_d455_live.launchroslaunch air_slam vo_d455_live.launch visualization:=falseroslaunch air_slam vo_d455_live.launch saving_dir:="/path/to/save"# Still works with datasets
roslaunch air_slam vo_euroc.launchProblem: AirSLAM starts but receives no camera data Check:
- Bridge is running and topics are available:
rostopic list - Camera is publishing:
rostopic echo /camera/camera/infra1/image_rect_raw - Topic names match in launch file
Problem: Only receiving left or right images Check:
- Both cameras publishing at same rate
- Timestamps are reasonable (not too different)
- No network delays in topics
Problem: System performance issues Solution:
- Reduce camera framerate:
infra_fps:=15 - Increase processing rate limit in code
- Close RViz if not needed
Problem: Topics not bridging from ROS2 to ROS1 Solution:
- Ensure both ROS1 and ROS2 environments are sourced
- Check bridge workspace is built correctly
- Restart bridge if topics change
| Aspect | File Mode (Original) | Live Mode (New) |
|---|---|---|
| Input | EuRoC dataset files | ROS topics |
| Timing | Fixed dataset order | Real-time streams |
| IMU | Pre-synchronized | Real-time sync |
| Performance | Deterministic | Variable (real-time) |
| Debugging | Repeatable | Live data only |
| Setup | Simple | Requires camera+bridge |
After live visual odometry works:
- Map Refinement: Create live version of map refinement
- Relocalization: Add live relocalization capability
- ROS2 Direct: Bypass bridge with native ROS2 support
- Multi-camera: Extend to multiple camera systems
All original functionality is preserved. To revert:
- Use original launch files (
vo_euroc.launch) - Original
visual_odometryexecutable unchanged - All modifications are additive (commented, not deleted)
The live topic system is designed to coexist with the original file-based system.