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中文網其他相關文章!