Ubuntu14.04上跑ORB-SLAM2

一、首先按照GitHub上的说明来进行安装相应的库:https://github.com/raulmur/ORB_SLAM2

主要的问题:

1、安装 Pangolin 的时候 make -j4 出错。后来查明是Ubuntu自带的版本的g++,gcc是4.8.4的原因。

将其升级到 gcc5.5.0,g++5.5.0的版本后,编译通过。可能是由于gcc,g++4.8.4的版本对c++11的新特性支持的问题。

最后要将 Pangolin 安装(sudo make install)。

2、在编译ORB-SLAM2时,运行的 ./build.sh 时卡死在59%:

  •     将 build.sh 文件中的后面两个 make -j 修改为 make;
  •     由于System.h 文件缺省一个头文件,将  #include <unistd.h> 加入到 System.h 文件中。

然后按照说明来编译即可。

二、在ORB-SLAM2上运行录制的视频时,总是提示

error Failed to open settings file at: ./myvideo.yaml

最后终于找到原因是 myvideo.cpp中的 string parameterFile 和 string vocFile , string videoFile 的路径是错误的,所以找不到相应的 .yaml 文件才使运行失败。将其修改到自己对应文件的路径下即可。

// 如果你系统上的路径不同,请修改它
string parameterFile = "./Examples/Myvideo/myvideo.yaml";
//string vocFile = "./Vocabulary/ORBvoc.txt";
string vocFile = "./Vocabulary/ORBvoc.txt";

// 视频文件
string videoFile = "./test/myvideo/myvideo.mp4";

参考资料:

[1] https://blog.csdn.net/qq184861643/article/details/53519714

[2] https://github.com/raulmur/ORB_SLAM2/issues/661

[3] https://github.com/raulmur/ORB_SLAM2/issues/559

[4] https://www.jianshu.com/p/ad040b374b2f

[5] https://blog.csdn.net/zzlyw/article/details/54730830

猜你喜欢

转载自blog.csdn.net/Jeffxu_lib/article/details/85345372
今日推荐