ORB-SLAM2记录

使用的源码是http://github.com/electech6/ORB_SLAM2_detailed_comments

系统是ubuntu 20.04

在cmake的时候遇到pangolin版本不对的问题,

具体报错:

Build type: Release
-- Using flag -std=c++11.
CMake Error at CMakeLists.txt:40 (find_package):
  Found package configuration file:
 
    /usr/local/lib/cmake/Pangolin/PangolinConfig.cmake
 
  but it set Pangolin_FOUND to FALSE so package "Pangolin" is considered to
  be NOT FOUND.  Reason given by package:
 
  Pangolin could not be found because dependency Eigen3 could not be found.
 
 
 
-- Configuring incomplete, errors occurred!
Makefile:911: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
————————————————

                            

把pangolin版本回退到0.5版本。

首先清理原有的pangolin版本

在终端输入

locate pangolin

使用以下命令删除 Pangolin 的安装目录,通常位于 `/usr/local` 或 `/usr/include`:

sudo rm -rf /usr/local/include/pangolin
sudo rm -rf /usr/local/lib/libpangolin

卸载完毕后安装0.5版本,在

https://github.com/stevenlovegrove/Pangolin.git

里面选择0.5版本,不过ubuntu20.04安装0.5版本时会编译报错

具体参考博客:视觉SLAM十四讲 Ubuntu20.04 Pangolin 环境配置-CSDN博客

安装完成后在编译时会报一段错误:

/usr/include/c++/9/bits/stl_map.h:122:71: error: static assertion failed: std::map must have the same value_type as its allocator
  122 |       static_assert(is_same<typename _Alloc::value_type, value_type>::value,
      |                                                                       ^~~~~

解决办法是在LoopClosing.h中修改

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;
 

        至此编译成功。       

参考博客:(总结)编译ORB_SLAM2遇到的错误_error: no match for call to ‘(pcl::getfieldindex(c-CSDN博客           

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值