本人邮箱:[email protected],欢迎交流讨论,
欢迎转载,转载请注明网址http://blog.csdn.net/u010128736/
ORB-SLAM是15年一个西班牙博士做的[1],工程效果来看,是目前最好的了。ORB-SLAM是针对单目做的slam,最新的是ORB-SLAM2,支持单目、双目和RGB-D接口。这里对ORB-SLAM2的环境搭建做一个记录,里面遇到的坑也有解决办法,可以参考。
系统环境:Ubuntu14.04
(1)打开一个终端Ternimal,输入
sudo passwd
然后设置root用户的密码
(2)新建文件夹:
mkdir ORB_SLAM
cd ORB_SLAM
(1)更新apt库
sudo apt-get update
(2)安装git
sudo apt-get install git
(3)安装cmake
sudo apt-get install cmake
(4)安装Pangolin
安装依赖:
a、opengl:
b、GLEW:
sudo apt-get install libglew-dev
c、Boost:
sudo apt-get install libboost-dev libboost-thread-dev libboost-filesystem-dev
d、Python2/Python3:
sudo apt-get install libpython2.7-dev
e、编译基础库
sudo apt-get install build-essential
安装Pangolin:
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
修改
Pangolin/src/display/device/display_x11.cpp
注释第123行和124行(这个地方有朋友说没有找到,可能是胖果林后面更新了,把这里改了,那就不用管了)
//GLX_SAMPLE_BUFFERS , glx_sample_buffers,
//GLX_SAMPLES , glx_sample_buffers > 0 ? glx_samples : 0,
终端里输入
mkdir build
cd build
cmake -DCPP11_NO_BOOST=1 ..
make -j
(建议不要使用make -j,使用make。如果用make -j是使用多处理器编译,可能造成死机)
(5)安装OpenCV
安装依赖:
a、编译器相关:
sudo apt-get install build-essential
b、必须依赖:
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev
libavformat-dev libswscale-dev
c、可选安装:
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
安装OpenCV:
a、官网下载OpenCV 2.4.11 for Linux下载地址,解压到Ubuntu中
b、进入OpenCV文件夹,配置工程
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
c、编译
make
sudo make install
(6)安装Eigen
下载Eigen下载地址,进入到在解压后的Eigen文件夹(例如eigen-eigen-07105f7124f9)下
mkdir build
cd build
cmake ..
make
sudo make install
(7)安装BLAS and LAPACK库
sudo apt-get install libblas-dev
sudo apt-get install liblapack-dev
3.安装ORB_SLAM:
(1)Clone the repository:
git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2
(2)编译:
cd ORB_SLAM2
chmod +x build.sh
修改./build.sh,可以安装vim
sudo apt-get install vim
vim ./build.sh
修改最后一行,改为make
./build.sh
这里下载了一个单目相机的测试数据集进行测试。
(1)下载测试数据集
Download a sequence from http://vision.in.tum.de/data/datasets/rgbd-dataset/download and uncompress it.
(2)执行命令:
Execute the following command. Change TUMX.yaml to TUM1.yaml,TUM2.yaml or TUM3.yaml for freiburg1, freiburg2 and freiburg3 sequences respectively. Change PATH_TO_SEQUENCE_FOLDERto the uncompressed sequence folder.
./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/TUMX.yaml PATH_TO_SEQUENCE_FOLDER
出结果就OK了,以后会对ORB-SLAM的算法进行一些研究记录,敬请期待。
[1] 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.