[详细教程]ORB-SLAM2安装教程

1.参考网站:

https://github.com/raulmur/ORB_SLAM2

一、开始安装

1.下载源码

git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2

遇到问题

* GnuTLS recv error (-54): Error in the pull function.
* Closing connection 0
error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
fatal: The remote end hung up unexpectedly
fatal: protocol error: bad pack header

尝试git config --global http.postBuffer 40000000命令,也不行,改从该网站直接下载源码。下载后解压到自己的文件夹内。
[详细教程]ORB-SLAM2安装教程_第1张图片

二、编译

cd ORB_SLAM2
chmod +x build.sh
./build.sh

遇到问题1

/home/ning/1.software/ORB_SLAM2/src/LoopClosing.cc:630:20: error: ‘usleep’ was not declared in this scope
         usleep(5000);
                    ^
/home/ning/1.software/ORB_SLAM2/src/LoopClosing.cc: In member function ‘void ORB_SLAM2::LoopClosing::RunGlobalBundleAdjustment(long unsigned int)’:
/home/ning/1.software/ORB_SLAM2/src/LoopClosing.cc:670:28: error: ‘usleep’ was not declared in this scope
                 usleep(1000);

解决方案:
在出错的文件中 加上#include

三、检查

编译完后,在ORB_SLAM2/lib文件夹下有libORB_SLAM2.so文件,在ORB_SLAM2/Example文件夹下有 mono_tum, mono_kitti, rgbd_tum, stereo_kitti, mono_euroc and stereo_euroc可执行文件
[详细教程]ORB-SLAM2安装教程_第2张图片
[详细教程]ORB-SLAM2安装教程_第3张图片

[详细教程]ORB-SLAM2安装教程_第4张图片
[详细教程]ORB-SLAM2安装教程_第5张图片

四、测试

1.下载数据集
网址:https://vision.in.tum.de/data/datasets/rgbd-dataset/download#freiburg1_rpy
[详细教程]ORB-SLAM2安装教程_第6张图片
随便下载一个数据集,在ORB_SLAM2文件下执行下面的命令

./Examples/Monocular/mono_tum Vocabulary/ORBvoc.txt Examples/Monocular/TUMX.yaml PATH_TO_SEQUENCE_FOLDER

注:数据集版本和tumx.yaml文件应匹配。 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.
可以看到成功运行啦
[详细教程]ORB-SLAM2安装教程_第7张图片

你可能感兴趣的:(安装软件)