ubuntu20.04 ros noetic cv4 编译sg-slam问题汇总

1.CV_RGB2GRAY
2.CV_MINMAX
3.CV_RGB2GRAY
4.CV_FILLED

引入头文件
#include<opencv2/imgproc/types_c.h>

#include<opencv2/opencv.hpp>

#include <opencv2/highgui/highgui_c.h>

#include <opencv2/imgproc/imgproc_c.h>

或者1和3将CV_改为cv::COLOR_

5.fatal error: opencv/cv.h: 没有那个文件或目录

#include <opencv/cv.h>
换成
#include<opencv2/imgproc/imgproc_c.h>
#include <opencv2/highgui/highgui_c.h>
 

6.sim3报错

error: static assertion failed: std::map must have the same value_type as its allocator
static_assert(is_same<typename _Alloc::value_type, value_type>::value,

把LoopClosing.h第49行的
     typedef map<KeyFrame*,g2o::Sim3,std::less<KeyFrame*>,
        Eigen::aligned_allocator<std::pair<const KeyFrame*, g2o::Sim3> > > KeyFrameAndPose;
改成下面
    typedef map<KeyFrame*,g2o::Sim3,std::less<KeyFrame*>,
        Eigen::aligned_allocator<std::pair<KeyFrame* const, g2o::Sim3> > > KeyFrameAndPose;
 

7.error:usleep

System.h,添加头文件#include<unistd.h>

8.‘CvMat’ has not been declared

报错对应文件添加头文件#include <opencv2/core/types_c.h>

9.‘CV_REDUCE_SUM’ was not declared in this scope

报错对应文件添加头文件#include<opencv2/core/core_c.h>

10.CV_LOAD_IMAGE_UNCHANGED’ was not declared in this scope

修改为cv::IMREAD_UNCHANGED

11.No rule to make target '/home/ajin/slam_study/SG-SLAM/src/sg-slam/Thirdparty/DBoW2/lib/libDBoW2.so', needed by '/home/ajin/slam_study/SG-SLAM/src/sg-slam/lib/libsg-slam.so'.  Stop.

cd path/SG-SLAM/src/sg-slam/Thirdparty/DBoW2

mkdir lib

把libDBoW2.so复制到lib,libDBoW2.so位置自行locate

12.跑到最后一帧没反应

//if (mpViewer)
//        pangolin::BindToContext("ORB-SLAM2: Map Viewer");
注视system.cc这段代码 389行左右

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值