ubuntu 16.04环境下编译ORB-SLAM2

这里假设我们已经配置好了相关的依赖项
首先git下来源码

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

接着运行程序中自带的脚本“build.sh

	cd /'''/ORB-SLAM2
	./build.sh

编译过程中因为我的机器经常卡死,所以我把脚本中 “ make -j” 改成了“ make -j3”
在这里我除了两个问题
(1)提示与pangolin相关的库文件找不到
可能是因为安装pangolin的文件路径改变了,我把这个文件重新编译安装了一次即可。
(2)usleep未定义

	ORM_SLAM2/ORB_SLAM2/src/Viewer.cc:159:28: error: ‘usleep’ was not declared in this scope
	usleep(3000);

这种情况是缺少引用unistd.h造成的
在以下文件中加入#include <unistd.h>即可解决

Examples/Monocular/mono_euroc.cc
Examples/Monocular/mono_kitti.cc
Examples/Monocular/mono_tum.cc
Examples/RGB-D/rgbd_tum.cc
Examples/Stereo/stereo_euroc.cc
Examples/Stereo/stereo_kitti.cc
src/LocalMapping.cc
src/LoopClosing.cc
src/System.cc
src/Tracking.cc
src/Viewer.cc

如果有其他报错可以参考博文http://www.bubuko.com/infodetail-2038049.html
下面就是跑一下TUM数据集,ROS链接摄像头啦,搞起

猜你喜欢

转载自blog.csdn.net/qq_36122936/article/details/88426349