XTDrone和PX4学习期间问题记录(一)

Written By PiscesAlpaca

前言:

出现问题可以去官方网站http://ceres-solver.org/index.html查看文档,搜索引擎很难搜到对应的问题。(不过我写了这些问题的解决办法,没准以后就能搜到了hh

1.视觉SLAM篇

URL:视觉SLAM · 语雀

ORBSLAM2编译

编译依赖见ORBSLAM2编译依赖

注意该ORBSLAM2是在原版本基础上略做修改,其虽然支持ROS,但不是标准的ROS架构,因此不能采用catkin build编译。

cp -r ~/XTDrone/sensing/slam/vslam/ORB_SLAM2/ ~/catkin_ws/src/

mkdir ~/catkin_ws/scripts/

cp ~/catkin_ws/src/ORB_SLAM2/xtdrone* ~/catkin_ws/scripts/

cd ~/catkin_ws/src/ORB_SLAM2

chmod +x build.sh

./build.sh

export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/catkin_ws/src/ORB_SLAM2/Examples/ROS #将这句放到~/.bashrc中,以后使用更方便

chmod +x build_ros.sh

./build_ros.sh

问题:在进行./build.sh时,遇到了make[2]: *** No rule to make target '../Thirdparty/DBoW2/lib/libDBoW2.so', needed by '../lib/libORB_SLAM3.so'. Stop.

解决办法:手动cd进目录ORB_SLAM3/Thirdparty/DBoW2/build,依次运行cmake ..build -j4,之后就可以发现libDBoW2.so文件生成在lib目录下,再按照教程运行./build.sh即可100%完成编译。

2.三维激光SLAM篇

问题:在进行catkin_make命令时,遇到了/home/pisces/catkin_ws/src/A- LOAM/src/laserOdometry.cpp:286:29: error: expected type-specifier 286 | new ceres::EigenQuaternionParameterization(); | ^~~~~

解决办法:

官方文档显示

EigenQuaternionParameterization is deprecated. It will be

removed in version 2.2.0 of Ceres Solver. Please use EigenQuaternionManifold instead.

证明EigenQuaternionParameterization已经过时,需要使用EigenQuaternionManifold替换,即:

ceres::LocalParameterization *q_parameterization = new ceres::EigenQuaternionParameterization();

替换为:``

ceres::LocalParameterization *q_parameterization = new ceres::EigenQuaternionManifold();

3.视觉惯性里程计

问题:

/home/pisces/catkin_ws/src/VINS-Fusion/camera_models/src/calib/CameraCalibration.cc:508:17: error: cannot convert ‘camodocal::EigenQuaternionParameterization*’ to ‘ceres::LocalParameterization*’ in initialization new EigenQuaternionParameterization; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

解决方法:更改ceres::LocalParameterization*为ceres::Manifold*

        ceres::Manifold* quaternionParameterization =
new EigenQuaternionParameterization;

问题:

/home/pisces/catkin_ws/src/VINS-Fusion/camera_models/src/calib/CameraCalibration.cc:510:17: error: ‘class ceres::Problem’ has no member named ‘SetParameterization’; did you mean ‘SetParameterLowerBound’? problem.SetParameterization(transformVec.at(i).rotationData(), ^~~~~~~~~~~~~~~~~~~ SetParameterLowerBound

解决方法:

This method is deprecated and will be removed in Ceres Solver version 2.2.0. Please move to using the SetManifold instead.

        problem.SetManifold(transformVec.at(i).rotationData(),
quaternionParameterization);

问题:

/home/pisces/catkin_ws/src/VINS-Fusion/global_fusion/src/globalOpt.cpp:109:72: error: expected type-specifier ceres::LocalParameterization* local_parameterization = new ceres::QuaternionParameterization(); ^~~~~

解决方法:

QuaternionParameterization is deprecated. It will be removed in version 2.2.0 of Ceres Solver. Please use QuaternionManifold instead.

            ceres::Manifold* local_parameterization = new ceres::QuaternionManifold();

问题:

/home/pisces/catkin_ws/src/VINS-Fusion/camera_models/src/calib/CameraCalibration.cc:508:17: error: invalid new-expression of abstract class type ‘camodocal::EigenQuaternionParameterization’ new EigenQuaternionParameterization; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

解决方法:本质是因为新继承的Manifold类出现了新的纯虚函数,只需要在EigenQuaternionParameterization类实现就行

在EigenQuaternionParameterization类public:下加入

    virtual int AmbientSize() const {return 7;}
virtual int TangentSize() const {return 1;}
virtual bool PlusJacobian(const double* x, double* jacobian) const {return 1;}
virtual bool Minus(const double* y,
const double* x,
double* y_minus_x) const {return 1;}
virtual bool MinusJacobian(const double* x, double* jacobian) const {return 1;}

class EigenQuaternionParameterization : public ceres::Manifold
{
public:
virtual ~EigenQuaternionParameterization() {}
virtual bool Plus(const double* x,
const double* delta,
double* x_plus_delta) const;
virtual bool ComputeJacobian(const double* x,
double* jacobian) const;
virtual int GlobalSize() const { return 4; }
virtual int LocalSize() const { return 3; } //edit by PiscesAlpaca
virtual int AmbientSize() const {return 1;}
virtual int TangentSize() const {return 1;}
virtual bool PlusJacobian(const double* x, double* jacobian) const {return 1;}
virtual bool Minus(const double* y,
const double* x,
double* y_minus_x) const {return 1;}
virtual bool MinusJacobian(const double* x, double* jacobian) const {return 1;} private:
template<typename T>
void EigenQuaternionProduct(const T z[4], const T w[4], T zw[4]) const;
};

问题:

/home/pisces/catkin_ws/src/VINS-Fusion/loop_fusion/src/pose_graph.h:134:24: error: ‘AutoDiffLocalParameterization’ in namespace ‘ceres’ does not name a template type return (new ceres::AutoDiffLocalParameterization<AngleLocalParameterization, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

解决方法:

AutoDiffParameterization is deprecated. It will be removed in version 2.2.0 of Ceres Solver. Please use AutoDiffManifold instead.

  static ceres::Manifold* Create() {
return (new ceres::AutoDiffManifold <AngleLocalParameterization,
1, 1>);
}

注意:如果进行更改后编译提示缺少Plus和Minus函数,可以在pose_graph.h文件加入

class AngleLocalParameterization {
public: template <typename T>
bool operator()(const T* theta_radians, const T* delta_theta_radians,
T* theta_radians_plus_delta) const {
*theta_radians_plus_delta =
NormalizeAngle(*theta_radians + *delta_theta_radians); return true;
} //edit by pisces
bool Plus(const double* x,
const double* delta,
double* x_plus_delta) {
return true;
}
//edit by pisces
bool Minus(const double* y,
const double* x,
double* y_minus_x) {
return true;
}
//edit by pisces
template <typename T>
bool Plus(const T* x,
const T* delta,
T* x_plus_delta) const{
return true;
}
//edit by pisces
template <typename T>
bool Minus(const T* y,
const T* x,
T* y_minus_x) const{
return true;
} static ceres::Manifold* Create() {
return (new ceres::AutoDiffManifold <AngleLocalParameterization,
1, 1>);
}
};

//edit by pisces为增加的函数

问题:

/home/pisces/catkin_ws/src/VINS-Fusion/vins_estimator/src/estimator/../factor/pose_local_parameterization.h:16:49: error: invalid use of incomplete type ‘class ceres::LocalParameterization’ class PoseLocalParameterization : public ceres::LocalParameterization ^~~~~~~~~~~~~~~~~~~~~

解决方法:更改ceres::LocalParameterization*为ceres::Manifold*

同本节问题1

问题:

/home/pisces/catkin_ws/src/VINS-Fusion/loop_fusion/src/pose_graph.cpp:474:52: error: cannot convert ‘ceres::Manifold*’ to ‘ceres::LocalParameterization*’ in initialization AngleLocalParameterization::Create(); ^

解决方法:

            ceres::Manifold* angle_local_parameterization =
AngleLocalParameterization::Create();

不过上述方法最终没有能够让VINS-Fusion接收到正确数据,还是对ceres进行了降级才实现,版本为1.14。如果有使用上述方法成功的读者可以在评论告诉我~

欢迎指出错误和不足~

转载请注明出处!

本篇发布在以下博客或网站:

双鱼座羊驼 - 知乎 (zhihu.com)

双鱼座羊驼的博客_CSDN博客

双鱼座羊驼 - SegmentFault 思否

双鱼座羊驼 的个人主页 - 动态 - 掘金 (juejin.cn)

双鱼座羊驼 - 博客园 (cnblogs.com)

XTDrone和PX4学习期间问题记录(一)的更多相关文章

  1. Java学习-007-Log4J 日志记录配置文件详解及实例源代码

    此文主要讲述在初学 Java 时,常用的 Log4J 日志记录配置文件详解及实例源代码整理.希望能对初学 Java 编程的亲们有所帮助.若有不足之处,敬请大神指正,不胜感激!源代码测试通过日期为:20 ...

  2. PX4学习之-uORB msg 自动生成模板解读

    最后更新日期 2019-06-22 一.前言 在 PX4学习之-uORB简单体验 中指出, 使用 uORB 进行通信的第一步是新建 msg.在实际编译过程中,新建的 msg 会转换成对应的 .h..c ...

  3. Redis入门学习(学习过程记录)

    Redis(入门笔记) 学习一个大的技术点,然后顺带着就把这个技术点的面试题给学习了. 学习完一个技术后,如果面试题还不能够解答的话,只能说明学的不精,需要查漏补缺. 下一个学习的方向:Redis-非 ...

  4. UWP学习开发笔记记录(开篇)

    零零散散开发微软移动2年多了,基本上从未记录或写过任何笔记.所以打算写一些自己的心得和技术的分享,大家一起来共同探讨.虽然现在UWP的工作几乎没有了,但是我感觉大家都是在观望,再看接下来微软的动作,所 ...

  5. CI 学习笔记、记录

    [ci框架]ci框架目录结构分析 分类: [CodeIgniter深入研究]2013-05-09 00:24 7420人阅读 评论(5) 收藏 举报 [php] view plaincopy mysh ...

  6. Python模块学习 ---- logging 日志记录

    许多应用程序中都会有日志模块,用于记录系统在运行过程中的一些关键信息,以便于对系统的运行状况进行跟踪.在.NET平台中,有非常著名的第三方开源日志组件log4net,c++中,有人们熟悉的log4cp ...

  7. Opengl_入门学习分享和记录_00

    2019.7.4 本着对游戏创作的热情,本人初步了解了一部分的unity引擎的使用,也学习了一点C#可是越学习unity我就反而对引擎内部感兴趣(不知道有没有一样的朋友=,=). 接着了解到了open ...

  8. 当时学习《鸟哥的Linux私房菜-基础学习篇》记录的点

    1.当执行一个指令的时候,举例来说[ls],系统会依照PATH的设定去每个PATH定义的目录下搜寻文件名为ls的可执行文件,如果在PATH定义的目录中含有多个文件名为ls的可执行文件,那么先搜寻到的同 ...

  9. 优秀编程学习网站&博文记录

    记录优秀讲解知识点博客内容,侵删! 编程者学习网站 LearnKu终身编程者的知识社区 自动化测试内容 Python 接口自动化测试 应用开源接口网站:https://httpbin.org/#/St ...

  10. mybatis 学习视频总结记录

    学习mybaits简单增删改查例子记录 此整理是学习视频后的视频内容整理,后半段还没有整理 网易云课堂 SSM高级整合视频 地址 : http://study.163.com/course/cours ...

随机推荐

  1. 第九十七篇:CSS的选择器及优先级

    好家伙,来补一点关于CSS的基础 1.id选择器 id 选择器可以为标有特定 id 的 HTML 元素指定特定的样式 使用#号来定义样式 2.class选择器 class 选择器用于描述一组元素的样式 ...

  2. KingbaseES R6 主备流复制集群创建级联复制案例

    案例环境: 数据库: test=# select version(); version -------------------------------------------------------- ...

  3. day35-IO流02

    JavaOI流02 4.常用的类 4.1文件字节流输入流-FileInputStream InputStream抽象类是所有类字节输入流的超类 InputStream常用的子类: FileInputS ...

  4. The 19th Zhejiang Provincial Collegiate Programming Contest

    目录 A.JB Loves Math B.JB Loves Comma C. JB Wants to Earn Big Money G. Easy Glide I. Barbecue L. Candy ...

  5. Spring Boot 整合Hibernate Validator

    Spring Boot 整合Hibernate Validator 依赖 <dependencies> <dependency> <groupId>org.spri ...

  6. 微服务系列之授权认证(三) JWT

    1.JWT简介 官方定义:JWT是JSON Web Token的缩写,JSON Web Token是一个开放标准(RFC 7519),它定义了一种紧凑的.自包含的方式,可以将各方之间的信息作为JSON ...

  7. 4.Ceph 基础篇 - 对象存储使用

    文章转载自:https://mp.weixin.qq.com/s?__biz=MzI1MDgwNzQ1MQ==&mid=2247485256&idx=1&sn=39e07215 ...

  8. MySQL数据库-数据表(下)

    分析:给 reader 表添加数据. INSERT INTO:插入数据,插入数据的时候会检查主键或者唯一索引,如果出现重复就会报错: 语法:INSERT INTO table_name VALUES ...

  9. C++实现双向RRT算法

    C++实现双向RRT算法 背景介绍 RRT(Rapidly-exploring Random Trees)是Steven M. LaValle和James J. Kuffner Jr.提出的一种通过所 ...

  10. python-D3-语法入门1

    Python语法注释 什么是注释 注释其实就是对一段代码的解释说明(注释是代码之母) 如何编写注释 方式1:解释说明文字前加警号 (pycharm中有快捷键ctrl+?) # 注释(单行注释) 方式2 ...