ORB_SLAM2的编译运行

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_35252878/article/details/71435661

1.安装必要的工具

sudo apt-get install cmake
sudo apt-get install Git
sudo apt-get install gcc g++  

2.安装Pangolin

在安装Pangolin之前,先要安装必要的依赖

sudo apt-get install libglew-dev
sudo apt-get install libboost-dev libboost-thread-dev libboost-filesystem-dev
sudo apt-get install libpython2.7-dev

安装:

git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir build
cd build
cmake -DCPP11_NO_BOOSR=1 ..
make -j

3.安装OpenCV

$ sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen2-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev  
$ unzip  opencv-2.4.13.zip    
$ cd opencv-2.4.13;mkdir build;cd build;   
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -DINSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -DBUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -DCUDA_GENERATION=Kepler ..      
$ make  
$ sudo make install   

4.安装Eigen3.1.0

最低要求版本为3.1.0。在http://eigen.tuxfamily.org 下载Eigen3的最新版本,一般是一个压缩文件,下载后解压,然后cd到Eigen3的根目录下。

mkdir build
cd build
cmake ..
make
sudo make install

5.安装ORBSLAM2

在catkin_ws/src下:

git clonehttps://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2
cd ORB_SLAM2
chmod +x build.sh
./build.sh

之后会在lib文件夹下生成libORB_SLAM2.so,并且在Examples文件夹下生成mono_tum,mono_kitti, rgbd_tum,stereo_kitti, mono_euroc 和 stereo_euroc。

6.运行TMU实例

http://vision.in.tum.de/data/datasets/rgbd-dataset/download下载并解压一个序列,如:rgbd_dataset_freiburg1_desk2.tgz

解压到主文件夹后执行:

./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt ./Examples/Monocular/TUMX.yaml PATH_TO_SEQUENCE_FOLDER
//例如:
./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt ./Examples/Monocular/TUM1.yaml /home/xym/rgbd_dataset_freiburg1_xyz  

这里写图片描述

展开阅读全文

没有更多推荐了,返回首页