其他分享
首页 > 其他分享> > 编译正确,运行ORB_SLAM3报错Segmentation fault

编译正确,运行ORB_SLAM3报错Segmentation fault

作者:互联网

  环境编译什么的都没问题,但一运行ORB_SLAM3(基于ROS)的时候就报Segmentation fault
  无论是单目还是RGBD,详细的报错信息如下:

max@max-virtual-machine:~/ORB_slam3_test/src/ORB_SLAM3$ rosrun ORB_SLAM3 Mono Vocabulary/ORBvoc.txt Examples/ROS/ORB_SLAM3/Asus.yaml 

ORB-SLAM3 Copyright (C) 2017-2020 Carlos Campos, Richard Elvira, Juan J. Gómez, José M.M. Montiel and Juan D. Tardós, University of Zaragoza.
ORB-SLAM2 Copyright (C) 2014-2016 Raúl Mur-Artal, José M.M. Montiel and Juan D. Tardós, University of Zaragoza.
This program comes with ABSOLUTELY NO WARRANTY;
This is free software, and you are welcome to redistribute it
under certain conditions. See LICENSE.txt.

Input sensor was set to: Monocular
段错误 (核心已转储)

  其实这个问题没有100%解决,但网络上对此的资料很少,这里提供一种尝试的方法:
  段错误原因:g2o出现内存溢出,g2o和ORB_SLAM3有一个编译选项(-march=native)不一致(CmakeList.txt中)

详细操作步骤见参考:
https://blog.csdn.net/DargonWain/article/details/109289833
https://github.com/raulmur/ORB_SLAM2/pull/844

  但我去观察的时候,我发现ORB_SLAM3的CmakeList.txt和g2o的CMakeList.txt确实没有一致,但是当我尝试同增或者同减时运行仍然报错。我和朋友交流,朋友过程没有遇到这个问题。于是我更换了ORB_SLAM3的源代码,重新编译,最后成功。

  问题没有完全解决,但换了一种方式跳过了这个问题,投机取巧吧~

标签:Segmentation,fault,编译,SLAM3,报错,g2o,txt,ORB
来源: https://blog.csdn.net/gls_nuaa/article/details/122106358