网上有很多运行的博客(ubuntu 14.04.5下运行ORB-SLAM2的数据:http://www.linuxdiyf.com/linux/26767.html),我参照的来运行自己的,在最后一步运行ORB_SLAM2的时候竟然一直在卡住,很是头疼啊,经过几天的查找和询问各种大牛,问题算是解决了,打卡记录下。
问题一:在执行./build.sh这一步的时候出现下列问题:
问题的原因是虚拟机内存不够,关闭虚拟机,将虚拟机的内存扩大。(我扩大到3G就可以了)
问题二:出现/ws/ORB_SLAM2/src/LoopClosing.cc: In member function ‘void ORB_SLAM2::LoopClosing::Run()’:
/ws/ORB_SLAM2/src/LoopClosing.cc:84:20: error: ‘usleep’ was not declared in this scope
usleep(5000);
^
/ws/ORB_SLAM2/src/LocalMapping.cc: In member function ‘void ORB_SLAM2::LocalMapping::Run()’:
/ws/ORB_SLAM2/src/LocalMapping.cc:94:28: error: ‘usleep’ was not declared in this scope
usleep(3000);
^
/ws/ORB_SLAM2/src/LocalMapping.cc:108:20: error: ‘usleep’ was not declared in this scope
usleep(3000);
需要打开相应的代码,在头文件里面添加usleep 的头文件unistd.h,问题就解决了!