Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/rpng/open_vins/llms.txt

Use this file to discover all available pages before exploring further.

OpenVINS can be built in three modes: against ROS 1 (Kinetic, Melodic, Noetic), against ROS 2 (Dashing, Galactic), or entirely without ROS as a standalone library. All three paths share the same core dependencies — OpenCV (3.x or 4.x), Eigen3, and Ceres solver — but differ in how the workspace is set up and the system is built. The ROS paths are recommended for most users because they provide ready-made launch files, rosbag playback, and RViz visualization.

Install ROS 1

OpenVINS has been tested on Ubuntu 16.04 (Kinetic), 18.04 (Melodic), and 20.04 (Noetic). The instructions below target Noetic on 20.04; adjust the distro variable for older systems.
1

Add the ROS apt repository

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
2

Install ROS 1 and core dependencies

export ROS1_DISTRO=noetic  # kinetic=16.04, melodic=18.04, noetic=20.04
sudo apt-get install ros-$ROS1_DISTRO-desktop-full
sudo apt-get install python3-catkin-tools python3-osrf-pycommon  # Ubuntu 20.04
# For Ubuntu 16.04 / 18.04 use: python-catkin-tools
sudo apt-get install libeigen3-dev libboost-all-dev libceres-dev
3

Source ROS 1 on every terminal

If ROS 1 is your only ROS install, add a permanent source to your shell:
echo "source /opt/ros/$ROS1_DISTRO/setup.bash" >> ~/.bashrc
source ~/.bashrc
If you also plan to install ROS 2, do not add a global source. Use an alias instead:
echo "alias ros1_source=\"source /opt/ros/$ROS1_DISTRO/setup.bash\"" >> ~/.bashrc
echo "alias source_devel=\"source devel/setup.bash\"" >> ~/.bashrc
source ~/.bashrc
# Run `ros1_source` whenever you open a new terminal for ROS 1 work.
4

Create a catkin workspace and clone OpenVINS

mkdir -p ~/workspace/catkin_ws_ov/src/
cd ~/workspace/catkin_ws_ov/src/
git clone https://github.com/rpng/open_vins/
cd ..
5

Build the workspace

catkin build
To build in Debug mode:
catkin build --cmake-args -DCMAKE_BUILD_TYPE=Debug

Build options

All three build paths accept the same CMake flags. Pass them with catkin build -D<flag>=VALUE, colcon build --cmake-args -D<flag>=VALUE, or cmake -D<flag>=VALUE ...
FlagDefaultDescription
ENABLE_ROSONEnable or disable the ROS build. Set to OFF for the standalone build.
ENABLE_ARUCO_TAGSONEnable ArUco tag SLAM features. Requires OpenCV contrib modules.
BUILD_OV_EVALONBuild the ov_eval evaluation package.
DISABLE_MATPLOTLIBOFFDisable matplotlib-based plot generation in ov_eval.

Evaluation dependencies (ov_eval)

The ov_eval package can generate plots directly from C++ using the matplotlib-cpp wrapper. Install the Python dependencies matching your system:
# Python 3 systems (Ubuntu 20.04 / ROS Noetic)
sudo apt-get install python3-dev python3-matplotlib python3-numpy python3-psutil python3-tk

# Python 2 systems (Ubuntu 16.04 / 18.04)
sudo apt-get install python2.7-dev python-matplotlib python-numpy python-psutil
Control the feature at build time:
catkin build -DDISABLE_MATPLOTLIB=OFF  # build with visualization (default)
catkin build -DDISABLE_MATPLOTLIB=ON   # build without visualization

OpenCV from source

Try the system or ROS-provided OpenCV first. Build from source only if you cannot compile (e.g., you need ArUco support but have no contrib modules, or need a newer version). OpenVINS has been tested with OpenCV 3.2, 3.3, 3.4, 4.2, and 4.5.
git clone https://github.com/opencv/opencv/
git clone https://github.com/opencv/opencv_contrib/
mkdir opencv/build/
cd opencv/build/
cmake -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ..
make -j8
sudo make install
If you cannot build the contrib modules, disable ArUco tag support:
catkin build -DENABLE_ARUCO_TAGS=OFF
# or for cmake builds:
cmake -DENABLE_ARUCO_TAGS=OFF ..

Ceres solver from source

Install Ceres from apt first with sudo apt-get install libceres-dev. Build from source only if you encounter an Eigen version mismatch error such as: "Failed to find Ceres - Found Eigen dependency, but the version of Eigen found (3.3.7) does not exactly match the version of Eigen Ceres was compiled with (3.3.4)."
sudo apt-get install -y cmake libgoogle-glog-dev libgflags-dev \
    libatlas-base-dev libeigen3-dev libsuitesparse-dev

CERES_VERSION="2.0.0"
git clone https://ceres-solver.googlesource.com/ceres-solver
cd ceres-solver
git checkout tags/${CERES_VERSION}
mkdir build && cd build
cmake ..
make
sudo make install

Next steps

Once the build succeeds, follow the Tutorial to download the EuRoC MAV dataset and run your first estimation.

Build docs developers (and LLMs) love