最近想学习slam结合深度学习的内容,我用了一位博主的代码在ubuntu22.04上进行复现,原帖如下
yolov5和orbslam2结合的实现方法 [使用UNIX域socket实现python和c++通信]_orbslam yolo-CSDN博客
遇到的问题:
1.根据运行命令要修改路径,在 detect_speedup_send.py 文件(rgbd_tum.cc,可能还有别的地方,文件未找到都是路径有问题,多找一找)
2.编译问题
参考我之前发的orbslam2博客ubuntu22.04运行orbslam2遇到的问题以及解决方法-CSDN博客进行修改,主要改动是
在cmakelists文件中将c++11改为c++14以及:
#find_package(Eigen3 3.1.0 REQUIRED)改为如下
find_package(Eigen3 3.1.0 REQUIRED NO_MODULE)
在LoopClosing.h中加入
#include <unistd.h>
问题3:error: static assertion failed: std::map must have the same value_type as its allocator
解决方法:在LoopCloseing.h中修改
typedef map<KeyFrame*,g2o::Sim3,std::less<KeyFrame*>,
Eigen::aligned_allocator<std::pair<const KeyFrame*, g2o::Sim3> > > KeyFrameAndPose;
3.运行过程提示核心已转储
在frame.cc中第1162行 const float d = imDepth.at<float>(v,u);修改为如下
// const float d = imDepth.at<float>(v,u);
if(v<0 || u<0)
continue;
const float d = imDepth.at<float>(v,u);
删除-march=native
接下来运行就没有问题了