ROS2 node for ORB-SLAM 3.
Currently, supports Monocular and RGB-D modes.
The node subscribes to /camera/rgb/image_color (monocular)
or to /camera/rgb/image_color AND /camera/depth/image (RGB-D)
and publishes:
- Camera pose (
/pose_orb1) - The map points being tracked (
/tracked_mappoints) - All map points (
/all_mappoints) - The anotated tracking image (
/tracking_image) - The keyframe ref. frames (
/kf_markers) - Odometry messages (
/odom)
The implementation is based on this and this implementations.
Tested on:
- Ubuntu 24.04 LTS
- ROS2 Jazzy
- Download and compile ORB-SLAM 3.
- Install the required ROS2 dependencies:
ros-jazzy-image-transportros-jazzy-cv-bridgeros-jazzy-vision-opencvros-jazzy-message-filters
-
Download or clone this repo under your <ROS2_Workspace>/src folder. ( i.e:
/home/user/ros2_ws/src) -
Set the install path of your ROS2 distro in the
CMakeLists.txtfile:set(ENV{PYTHONPATH} "/opt/ros/<ROS2_site_packages>")In my case, the line should be set to:
set(ENV{PYTHONPATH} "/opt/ros/jazzy/lib/python3.12/site-packages") -
Set the root path of your ORB-SLAM3 folder in the
CMakeModules/FindORB_SLAM3.cmakefile:set(ORB_SLAM3_ROOT_DIR "<path_to_your_ORBSLAM3_root_folder>")In my case, the line should be set to:
set(ORB_SLAM3_ROOT_DIR "/home/bruno/Projects/ORB_SLAM3") -
Source your ROS2 installation:
$ source /opt/ros/<ros2_distro>/setup.bash -
Build the package:
$ cd /home/user/ros2_ws$ colcon build
-
Source your ROS2 workspace:
$ source /home/user/ros2_ws/install/setup.bash -
Launch the node:
$ ros2 run ros2_orbslam3 mono <path_to_vocabulary> <path_to_settings>(monocular mode)or
$ ros2 run ros2_orbslam3 rgbd <path_to_vocabulary> <path_to_settings>(RGB-D mode)