关于编译vins_so的相关问题

关于编译vins_so的相关问题

1、电脑配置

ubuntu 16.04+ros kinetic或者ubuntu 18.04 +ros melodic

2、依赖项

cv_bridge,tf,message-filters,image-transport,opencv3

eigen,ceres

3、具体代码编译

mkdir catkin_vins_so
cd catkin_vins_so
mkdir src
cd src
git clone https://github.com/gaowenliang/vins_so.git
git clone https://github.com/gaowenliang/camera_model.git
git clone https://github.com/gaowenliang/code_utils.git
cd ..
catkin_make

4、编译问题
在这里插入图片描述
在这里插入图片描述
修改代码

(1)把sumpixel_test.cppestimator_node.cpp中的

#include "backward.hpp"

修改为

#include "code_utils/backward.hpp"

(2)向vins_parameters.cpp中添加

#include <boost/format.hpp>

(3)InitialEx.h修改为

#ifndef INITIALEX_H
#define INITIALEX_H

#include "InitialExRotationCamCam.h"
#include "InitialExRotationCamImu.h"

class InitialExParam
{
    public:
    InitialExParam( ) {}
   
    public:
    /***********************修改部分**************************/
    initialEx::InitialExRotationCamImuPtr * m_RicInitial;
    initialEx::InitialExRotationCamCamPtr * m_RccInitial;
       /***********************修改部分**************************/
};

#endif // INITIALEX_H
linux下编译C++代码报错,报错信息"field has incomplete type"。这种问题一般都是在头文件对类或者结构体进行了前向声明,后面使用了该类定义了对象,导致编译报错。原因在于前向声明类或者结构体,此时编译器还不知道定义,无法知道类内部成员,所以无法构造实例对象,因此前向声明的类或者结构体只能用来定义指针或者引用。

(4) 编译成功
在这里插入图片描述(5)代码附件

参考文献

编译报错"field has incomplete type"

https://github.com/gaowenliang/vins_so

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

纷繁中淡定

你的鼓励是我装逼的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值