This package provides RTAB-Map SLAM functionality that can subscribe to camera data from a remote OAK-D driver over ROS2 network.
- Real-time SLAM mapping
- Loop closure detection
- Map visualization
- Subscribes to remote camera topics
- Database persistence
# Build the package
colcon build --packages-select map_builder
# Source the workspace
source install/setup.bash
# Launch the map builder (subscribes to remote camera)
ros2 launch map_builder map_builder.launch.py robot_name:=oakrobot_name: Name of the remote robot/camera to subscribe to (default: "oak")use_sim_time: Whether to use simulation time (default: "false")config_file: Path to RTAB-Map configuration file
/{robot_name}/rgb/image_raw: RGB camera images from robot/{robot_name}/rgb/camera_info: RGB camera info from robot/{robot_name}/stereo/image_raw: Depth images from robot/{robot_name}/vio/odometry: Visual-inertial odometry from robot
/rtabmap/mapData: Map data/rtabmap/grid_map: Occupancy grid map/rtabmap/cloud_map: Point cloud map
- Ensure both robot and laptop are on the same network
- Set the same ROS_DOMAIN_ID on both machines:
export ROS_DOMAIN_ID=42
-
On the robot: Launch the oakd_driver to publish camera data
ros2 launch oakd_driver driver.launch.py
-
On the laptop: Launch the map_builder to receive data and build maps
ros2 launch map_builder map_builder.launch.py
-
Check topics: Verify the data flow between robot and laptop
ros2 topic list ros2 topic echo /oak/rgb/image_raw --max-count 1
Edit config/rtabmap_config.yaml to modify SLAM parameters:
- Detection rates
- Feature extraction settings
- Loop closure parameters
- Memory management
Maps are automatically saved to ~/.ros/rtabmap.db. You can visualize saved maps using:
rtabmap-databaseViewer ~/.ros/rtabmap.db