[详细教程]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命令,也不行,改从该网站直接下载源码。下载后解压到自己的文件夹内。
在这里插入图片描述

二、编译

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<unistd.h>

三、检查

编译完后,在ORB_SLAM2/lib文件夹下有libORB_SLAM2.so文件,在ORB_SLAM2/Example文件夹下有 mono_tum, mono_kitti, rgbd_tum, stereo_kitti, mono_euroc and stereo_euroc可执行文件
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

四、测试

1.下载数据集
网址:https://vision.in.tum.de/data/datasets/rgbd-dataset/download#freiburg1_rpy
在这里插入图片描述
随便下载一个数据集,在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.
可以看到成功运行啦
在这里插入图片描述

  • 2
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值