关于编译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.cpp
和estimator_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