ROS Package



  • ROS : noetic is recommended. (If you have built OpenCV (3.3.1 or later) manually, you can use melodic or later.)

  • OpenVSLAM

  • image_transport : Required by this ROS package examples.

  • cv_bridge : Please build it with the same version of OpenCV used in OpenVSLAM.


Tested for Ubuntu 18.04.

Please install the following dependencies.


Please build OpenVSLAM with PangolinViewer or SocketViewer if you plan on using it for the examples.

Install the dependencies via apt.

apt update -y
apt install ros-${ROS_DISTRO}-image-transport

Download the source of cv_bridge.

mkdir -p ~/catkin_ws/src
git clone --branch ${ROS_DISTRO} --depth 1
cp -r vision_opencv/cv_bridge ~/catkin_ws/src
rm -rf vision_opencv

Build Instructions

When building with support for PangolinViewer, please specify the following cmake options: -DUSE_PANGOLIN_VIEWER=ON and -DUSE_SOCKET_PUBLISHER=OFF as described in build of OpenVSLAM. openvslam and openvslam_ros need to be built with the same options.

cd ~/catkin_ws/src
git clone --branch ros --depth 1
cd ~/catkin_ws


Run the core program required for ROS-based system in advance.



Please leave the roscore run.


If you want to input image sequences or videos into openvslam_ros, please use ROS2.

Publish Images of a USB Camera

For using a standard USB camera for visual SLAM or localization.

apt install ros-${ROS_DISTRO}-usb-cam
rosparam set usb_cam/pixel_format yuyv
rosrun usb_cam usb_cam_node

Republish the ROS topic to /camera/image_raw.

rosrun image_transport republish \
    raw in:=/usb_cam/image_raw raw out:=/camera/image_raw


Subscribers continually receive images. Please execute one of the following command snippets in the new terminal.


Option arguments are the same as the examples of OpenVSLAM.

Tracking and Mapping

We provide an example snippet for visual SLAM. The source code is placed at openvslam_ros/src/

source ~/catkin_ws/devel/setup.bash
rosrun openvslam_ros run_slam \
    -v /path/to/orb_vocab.fbow \
    -c /path/to/config.yaml


We provide an example snippet for localization based on a prebuilt map. The source code is placed at openvslam_ros/src/

source ~/catkin_ws/devel/setup.bash
rosrun openvslam_ros run_localization \
    -v /path/to/orb_vocab.fbow \
    -c /path/to/config.yaml \
    --map-db /path/to/map.msg