(总结)(2)编译ORB_SLAM2遇到的错误

问题一:/ORB_SLAM2_PointCloud/src/pointcloudmapping.cc:42:24: error: ‘make_shared’ is not a member of ‘boost’42 | globalMap = boost::make_shared< PointCloud >( );

解决办法:添加#include <boost/make_shared.hpp>

问题二:error: ‘plusscalar’ is not a member of ‘pcl::traits’
  698 | POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointDEM,

解决办法:找到CMakeLists.txt文件,加入

set(CMAKE_CXX_STANDARD 14)

问题三:error: ‘CV_RGB2GRAY’ was not declared in this scope
  177 |             cvtColor(mImGray,mImGray,CV_RGB2GRAY);

解决办法:在头文件里添加 #include <opencv2/imgproc/types_c.h>

问题四:error: ‘CvMat’ does not name a type
  102 |   void find_betas_approx_1(const CvMat * L_6x10, const CvMat * Rho, double * betas);

解决办法:添加头文件

#include <opencv2/core/types_c.h>

问题五

    error: ‘cvCreateMat’ was not declared in this scope; did you mean ‘cvCreateSparseMat’?
    error: ‘cvMulTransposed’ was not declared in this scope
    error: ‘CV_SVD_MODIFY_A’ was not declared in this scope; did you mean ‘CV_HAL_SVD_MODIFY_A’
    error: ‘CV_SVD_U_T’ was not declared in this scope
    error: ‘cvSVD’ was not declared in this scope
    error: ‘cvReleaseMat’ was not declared in this scope
    error: ‘CV_SVD’ was not declared in this scope; did you mean ‘CV_AVX’?
    error: ‘cvInvert’ was not declared in this scope; did you mean ‘cvInvSqrt’?
    error: ‘cvCreateMat’ was not declared in this scope; did you mean ‘cvCreateSparseMat’?
    error: ‘cvMulTransposed’ was not declared in this scope
    error: ‘CV_SVD_MODIFY_A’ was not declared in this scope; did you mean ‘CV_HAL_SVD_MODIFY_A’?
    error: ‘CV_SVD_MODIFY_A’ was not declared in this scope; did you mean ‘CV_HAL_SVD_MODIFY_A’?

解决方法:

#include <opencv2/imgproc/types_c.h>

#include <opencv2/imgproc.hpp>

问题六error:static assertion failed:std::map must have the same value_type as its allocator

解决方法: 在ORB_SLAM2的安装路径下打开 /include 文件夹,在 LoopClosing.h 中修改第49-50行,将

    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;

问题七/usr/include/pcl-1.10/pcl/pcl_config.h:7:4: error: #error PCL requires C++14 or above| #error PCL requires C++14 or above

解决方案修改/ORB_SLAM2_modified/CMakeLists.txt文件-std=c++11换成-std=c++14


                
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值