SVO环境搭建

时间:2022-07-13 18:54:26

我是装了双系统,实验OS:Ubuntu14.04

Installation: Plain CMake (No ROS)

首先,建立一个工作目录比如:workspace,然后把下面的需要的都在该目录下进行.

(tip:一定不要使用中文名字,尽管你的系统是中文默认的名字。不然下面的依赖项将会十分困难,cmake找不到配置文件。)

mkdir workspace
cd workspace

Boost - c++ Librairies (thread and system are needed)

sudo apt-get install libboost-all-dev

Eigen 3 - Linear algebra

apt-get install libeigen3-dev

OpenCV - Computer vision library for loading and displaying images(我下载的是OpenCV3.0)

mkdir build
cd build
cmake ..
make

Sophus - Lie groups

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

如果此时遇到了“unit_complex_.imag() = 0."的错误,需要改代码为:”unit_complex_.imag(0.)“

Fast - Corner Detector

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

g2o - General Graph Optimization OPTIONAL

耐心和细心,G2O的每个版本的依赖项很复杂,需要耐心看版本号。不然错误很多都摸不到头脑了。之前在网上也是看了很多博客,并没有真正的解决依赖项的问题。下面我整理自己做的过程,完整正确版本。

首先安装g2o的依赖项:

sudo apt-get  install cmake libeigen4-dev libsuitesparse-dev, qt4-qmake libqglviewer-dev libsuitesparse-dev libcxsparse3.1.2  libcholmod-dev

然后进行下载,编译等:

cd workspace
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
mkdir build
cd build
cmake ..
make
sudo make install

vikit_common - Some useful tools that we need

vikit包含相机模型,SVO需要的一些数学和插值函数。

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

rpg_vikit/vikit_common/CMakeLists.txt 文件中设置 USE_ROS 为FALSE.

cd rpg_vikit/vikit_common
mkdir build
cd build
cmake ..
make

SVO

cd workspace
git clone https://github.com/uzh-rpg/rpg_svo.git
cd rpg_svo/svo

在文件 svo/CMakeLists.txt中,设置USE_ROS 为 FALSE.

mkdir build
cd build
cmake ..
make

Run SVO without ROS

首先,创建一个存储数据的文件夹:

mkdir Datasets

然后设置一个环境变量去存储路径

export SVO_DATASET_DIR=${HOME}/Datasets

执行脚本.bashrc,然后进去新文件夹下面去下载测试数据

source ~/.bashrc
cd ${SVO_DATASET_DIR}
wget http://rpg.ifi.uzh.ch/datasets/sin2_tex2_h1_v8_d.tar.gz -O - | tar -xz

然后在测试数据上面运行SVO即可:

cd svo/bin
./test_pipeline