版權(quán)聲明:本文為博主原創(chuàng)文章,未經(jīng)博主允許不得轉(zhuǎn)載。
前言
ORBSLAM2是一個(gè)非常適合SLAM入門(mén)學(xué)習(xí)的開(kāi)源工程。它支持單目、雙目、RGB-D使用,可以計(jì)算攝像機(jī)的軌跡,并且重建稀疏的3D地圖。
官網(wǎng)有源代碼和配置教程,地址是
https://github.com/raulmur/ORB_SLAM2
1 安裝必要工具
首先,有兩個(gè)工具是需要提前安裝的。即cmake和Git。
sudo apt-get install cmake
sudo apt-get install git
2 安裝Pangolin,用于可視化和用戶(hù)接口
安裝依賴(lài)項(xiàng):
sudo apt-get install libglew-dev
sudo apt-get install libpython2.7-dev
先轉(zhuǎn)到一個(gè)要存儲(chǔ)Pangolin的路徑下,例如~/Documents,然后
git clonehttps://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir build
cd build
cmake ..
make –j
sudo make install
3 安裝OpenCV
最低的OpenCV版本為2.4.3,建議采用OpenCV 2.4.11或者OpenCV 3.2.0。從OpenCV官網(wǎng)下載OpenCV2.4.11。然后安裝依賴(lài)項(xiàng):
sudo apt-get install build-essential
sudo apt-get install libgtk2.0-dev
sudo apt-get install pkg-config
將下載的OpenCV解壓到自己的指定目錄,然后cd到OpenCV的目錄下。
cd ~/Downloads/opencv-2.4.11
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local ..
make
sudo make install
4 安裝Eigen3
最低要求版本為3.1.0。在http://eigen.tuxfamily.org 下載Eigen3的最新版本,一般是一個(gè)壓縮文件,下載后解壓,然后cd到Eigen3的根目錄下。
mkdir build
cd build
cmake ..
make
sudo make install
5 安裝ORBSLAM2
先轉(zhuǎn)到自己打算存儲(chǔ)ORBSLAM2工程的路徑,然后執(zhí)行下列命令
git clonehttps://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2
cd ORB_SLAM2
chmod +x build.sh
./build.sh
之后會(huì)在lib文件夾下生成libORB_SLAM2.so,并且在Examples文件夾下生成mono_tum,mono_kitti, rgbd_tum,stereo_kitti, mono_euroc 和 stereo_euroc。
6 運(yùn)行單目SLAM實(shí)例
在http://vision.in.tum.de/data/datasets/rgbd-dataset/download下載一個(gè)序列,并解壓。轉(zhuǎn)到ORBSLAM2文件夾下,執(zhí)行下面的命令。根據(jù)下載的視頻序列freiburg1, freiburg2 和 freiburg3將TUMX.yaml分別轉(zhuǎn)換為T(mén)UM1.yaml,TUM2.yaml,TUM3.yaml。將PATH_TO_SEQUENCE_FOLDER更改為解壓的視頻序列文件夾。
./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txtExamples/Monocular/TUMX.yaml PATH_TO_SEQUENCE_FOLDER
例如,我自己的電腦上,該命令變?yōu)椋?/p>
./Examples/Monocular/mono_tumVocabulary/ORBvoc.txt Examples/Monocular/TUM1.yaml/home/bill/Downloads/rgbd_dataset_freiburg1_xyz
運(yùn)行截圖如下:
相關(guān)文獻(xiàn)
[Monocular] Raúl Mur-Artal, J. M. M. Montiel and Juan D. Tardós. ORB-SLAM: A Versatile and Accurate Monocular SLAM System. IEEE Transactions on Robotics, vol. 31, no. 5, pp. 1147-1163, 2015. (2015 IEEE Transactions on Robotics Best Paper Award). PDF.
[Stereo and RGB-D] Raúl Mur-Artal and Juan D. Tardós. ORB-SLAM2: an Open-Source SLAM System for Monocular, Stereo and RGB-D Cameras. ArXiv preprint arXiv:1610.06475 PDF.
[DBoW2 Place Recognizer] Dorian Gálvez-López and Juan D. Tardós. Bags of Binary Words for Fast Place Recognition in Image Sequences. IEEE Transactions on Robotics, vol. 28, no. 5, pp. 1188-1197, 2012. PDF
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注