Skip to content
Sigurd Totland edited this page Oct 20, 2020 · 8 revisions

SVO can be used conveniently with ROS (www.ros.org). We use two workspaces, one for the plain CMake projects Sophus, Fast and optionally g2o and another workspace for the ROS-Catkin projects rpg_vikit and rpg_svo. Make sure to clone in the right folder.

Sophus - Lie groups

Sophus by Hauke Strasdat implements Lie groups that we need to describe rigid body transformations. Checkout in your workspace for plain CMake projects.

cd workspace
git clone https://github.com/strasdat/Sophus.git
cd Sophus
git checkout a621ff
mkdir build
cd build
cmake ..
make

You don't need to install the library since cmake .. writes the package location to ~/.cmake/packages/ where CMake can later find it.

If make fails with the error lvalue required as left operand of assignment in so2.cpp, see this issue.

Fast - Corner Detector

The Fast detector by Edward Rosten is used to detect corners. To simplify installation we provide a CMake package that contains the fast detector from the libCVD library (http://www.edwardrosten.com/cvd/).

cd workspace
git clone https://github.com/uzh-rpg/fast.git
cd fast
mkdir build
cd build
cmake ..
make

g2o - General Graph Optimization OPTIONAL

Only required if you want to run bundle adjustment. It is not necessary for visual odometry. In fact, we don't run it on our MAVs. g2o requires the following system dependencies: cmake, libeigen3-dev, libsuitesparse-dev, libqt4-dev, qt4-qmake, libqglviewer-qt4-dev, install them with apt-get

I suggest an out-of-source build of g2o:

cd workspace
wget https://github.com/RainerKuemmerle/g2o/archive/20160424_git.tar.gz -O g2o-20160424_git.tar.gz
tar xvzf g2o-20160424_git.tar.gz
cd g2o-20160424_git
mkdir build
cd build
cmake ..
make
sudo make install

If you don't want to make a system install, then you can replace the cmake command with cmake .. -DCMAKE_INSTALL_PREFIX:PATH=$HOME/installdir

vikit - Some useful tools that we need

vikit for contains camera models, some math and interpolation functions that SVO needs. vikit is a catkin project, therefore, download it into your catkin workspace source folder.

cd catkin_ws/src
git clone https://github.com/uzh-rpg/rpg_vikit.git

ROS dependencies

Sometimes cmake-modules is missing (required for including Eigen in ROS Indigo):

sudo apt-get install ros-hydro-cmake-modules

(replace hydro with your distribution).

SVO

Now we are ready to build SVO. Clone it into your catkin workspace

cd catkin_ws/src
git clone https://github.com/uzh-rpg/rpg_svo.git

If you installed g2o then set HAVE_G2O in svo/CMakeLists.txt to TRUE.

If you installed g2o in $HOME/installdir, you can tell find_package by setting the environment variable G2O_ROOT

export G2O_ROOT=$HOME/installdir

Finally, build:

catkin_make