一、ORB_SLAM2依赖项的安装
1 安装Pangolin,用于可视化和用户接口
1.1安装Pangolin所需的依赖库
sudo apt-get install libglew-dev libpython2.7-dev libboost-dev libboost-thread-dev libboost-filesystem-dev
1.2下载Pangolin并编译安装
cd ~/catkin/src
git clone https://github.com/stevenlovegrove/Pangolin
cd pangolin
mkdir build && cd build
cmake ..
make
sudo make install
2下载安装opencv
1 git clone https://github.com/opencv/opencv.git
2 cd opencv/
3 cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
4 make
5 sudo make install
3安装Eigen3
sudo apt-get install libeigen3-dev
二、下载ORB_SLAM2及编译运行
1下载ORB_SLAM2
cd catkin_ws/src
git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2
2编译ORB_SLAM2
首先打开build.sh文件,将所有的make -j改为make(低性能电脑照做,高性能电脑忽略此步),之后修改文件权限并运行编译:
1 cd ORB_SLAM2
2 gedit build.sh(打开build.sh文件,然后手动删除-j,保存退出)
3 chmod +x build.sh
4 ./build.sh
3运行ORB_SLAM2(使用RGB-D数据集演示)
前往https://vision.in.tum.de/data/datasets/rgbd-dataset/download下载对应的数据集,这里将名称(rgbd_database_test)代替下载的数据集名称用以演示,将其存放在ORB_SLAM2根目录下。
./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/TUM1.yaml ~/catkin_ws/src/ORB_SLAM2/rgbd_dataset_test