Installation: Plain CMake (No ROS)
首先,建立一个工作目录比如:workspace,然后把下面的需要的都在该目录下进行.
(tip:一定不要使用中文名字,尽管你的系统是中文默认的名字。不然下面的依赖项将会十分困难,cmake找不到配置文件。)
mkdir workspace cd workspace
Boost - c++ Librairies (thread and system are needed)
sudo apt-<span style="color: #0000ff;">get</span> install libboost-all-dev
Eigen 3 - Linear algebra
apt-<span style="color: #0000ff;">get</span> install libeigen3-dev
OpenCV - Computer vision library for loading and displaying images(我下载的是OpenCV3.0)
<span style="color: #000000;">mkdir build cd build cmake .. make</span>
Sophus - Lie groups
<span style="color: #000000;">cd workspace git clone https:</span><span style="color: #008000;">//</span><span style="color: #008000;">github.com/strasdat/Sophus.git</span> <span style="color: #000000;">cd Sophus git checkout a621ff mkdir build cd build cmake .. make</span>
如果此时遇到了“unit_complex_.imag() = 0."的错误,需要改代码为:”unit_complex_.imag(0.)“
Fast - Corner Detector
<span style="color: #000000;">cd workspace git clone https:</span><span style="color: #008000;">//</span><span style="color: #008000;">github.com/uzh-rpg/fast.git</span> <span style="color: #000000;">cd fast mkdir build cd build cmake .. make</span>
g2o - General Graph Optimization OPTIONAL
耐心和细心,G2O的每个版本的依赖项很复杂,需要耐心看版本号。不然错误很多都摸不到头脑了。之前在网上也是看了很多博客,并没有真正的解决依赖项的问题。下面我整理自己做的过程,完整正确版本。
首先安装g2o的依赖项:
sudo apt-<span style="color: #0000ff;">get</span> install cmake libeigen4-dev libsuitesparse-dev, qt4-qmake libqglviewer-dev libsuitesparse-dev libcxsparse3.<span style="color: #800080;">1.2</span> libcholmod-dev
然后进行下载,编译等:
<span style="color: #000000;">cd workspace git clone https:</span><span style="color: #008000;">//</span><span style="color: #008000;">github.com/RainerKuemmerle/g2o.git</span> <span style="color: #000000;">cd g2o mkdir build cd build cmake .. make sudo make install</span>
vikit_common - Some useful tools that we need
vikit包含相机模型,SVO需要的一些数学和插值函数。
<span style="color: #000000;">cd workspace git clone https:</span><span style="color: #008000;">//</span><span style="color: #008000;">github.com/uzh-rpg/rpg_vikit.git</span>
在pg_vikit/vikit_common/CMakeLists.txt 文件中设置 USE_ROS为FALSE.
cd rpg_vikit/<span style="color: #000000;">vikit_common mkdir build cd build cmake .. make</span>
SVO
<span style="color: #000000;">cd workspace git clone https:</span><span style="color: #008000;">//</span><span style="color: #008000;">github.com/uzh-rpg/rpg_svo.git</span> cd rpg_svo/svo
在文件 svo/CMakeLists.txt中,设置USE_ROS为 FALSE.
<span style="color: #000000;">mkdir build cd build cmake .. make</span>
Run SVO without ROS
首先,创建一个存储数据的文件夹:
mkdir Datasets
然后设置一个环境变量去存储路径
export SVO_DATASET_DIR=${HOME}/Datasets
执行脚本.bashrc,然后进去新文件夹下面去下载测试数据
source ~/<span style="color: #000000;">.bashrc cd ${SVO_DATASET_DIR} wget http:</span><span style="color: #008000;">//</span><span style="color: #008000;">rpg.ifi.uzh.ch/datasets/sin2_tex2_h1_v8_d.tar.gz -O - | tar -xz</span>
然后在测试数据上面运行SVO即可:
cd svo/<span style="color: #000000;">bin .</span>/test_pipeline
以上是SVO-SLAM环境搭建指南的详细内容。更多信息请关注PHP中文网其他相关文章!