PL-SLAM是Ruben Gomez-Ojeda大神融合点和线特征SLAM的最新成果,并开放了源代码,本博文记录安装运行PL-SLAM遇到的一些问题。php
1源代码地址html
https://github.com/rubengooj/pl-slam
2编译配置PL-SLAMgit
It can be easily found at http://opencv.org.
建议安装OpenCV 3.1.0,不然编译过程当中会出现一些.so文件的错误,推测做者可能用的这个版本。github
参考教程web
http://www.javashuo.com/article/p-zytoivvx-gp.htmlapi
sudo apt-get install libeigen3-dev
sudo apt-get install libboost-dev
g2o - General Graph Optimization
It can be found at:
https://github.com/RainerKuemmerle/g2o.git
这里在编译时可能会出现错误,将安装好的g2o文件夹中的cmake_modules文件夹复制到~/pl-slam文件夹中便可。 bash
Installation on Ubuntu:app
sudo apt-get install libyaml-cpp-dev
It can be found at:ide
https://github.com/rubengooj/stvo-pl
这个项目一样是做者的工做,必须安装这个项目,由于会用到这个项目的东西。测试
https://github.com/MRPT/mrpt/tree/0c3d605c3cbf5f2ffb8137089e43ebdae5a55de3
必须使用这个指定版本的MRPT,不然会编译报错
Line Descriptor
We have modified the line_descriptor module from the OpenCV/contrib library (both BSD) which is included in the 3rdparty folder.
这里不用操做,后面的脚本build.sh会一并安装。
可是这里值得特别注意,通常状况下咱们安装OpenCV就够用了,可是为了使用line_descriptor,必须安装opencv_contrib,并且最好同时安装,不然会可能出现一些错误。
cd ~/pl-slam
sh build.sh
编译过程会出现找不到g2o库文件的错误,经过如下方式解决
cd /usr/local/lib
sudo ln -sv libg2o_csparse_extension.so libg2o_ext_csparse.so
Usage
Datasets configuration
We employ an environment variable, ${DATASETS_DIR}, pointing the directory that contains our datasets. Each sequence from each dataset must contain in its root folder a file named dataset_params.yaml, that indicates at least the camera model and the subfolders with the left and right images. We provide dataset parameters files for several datasets and cameras with the format xxxx_params.yaml.
关键是设置数据集路径的环境变量,阅读~/pl-slam/app/plslam-dataset.cpp能够加深理解。
gedit ~/.bashrc export DATASETS_DIR=/home/zn(改成你的工做目录) source ~/.bashrc
在KITTI下载kitti/00数据,并将其放到~/KITTI目录下。
将~/pl-slam/config/dataset_params/kitti00-02.yaml复制到~/KITTI/kitti/00,而后将kitti00-02.yaml改成dataset_params.yaml.
将~/pl-slam/config/config/config_kitti.yaml中vocabulary_p和vocabulary_l的路径改成本身的。
./build/plslam_dataset kitti/00 -c config/config/config_kitti.yaml -o 100 -s 2 -n 1000
至此,整个编译测试过程完成。