XTDrone和PX4学习期间问题记录(一)
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(); | ^~~~~
解决办法:
官方文档显示
EigenQuaternionParameterizationis deprecated. It will be
removed in version 2.2.0 of Ceres Solver. Please useEigenQuaternionManifoldinstead.
证明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(); ^~~~~
解决方法:
QuaternionParameterizationis deprecated. It will be removed in version 2.2.0 of Ceres Solver. Please useQuaternionManifoldinstead.
即
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, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
解决方法:
AutoDiffParameterizationis deprecated. It will be removed in version 2.2.0 of Ceres Solver. Please useAutoDiffManifoldinstead.
即
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。如果有使用上述方法成功的读者可以在评论告诉我~
欢迎指出错误和不足~
转载请注明出处!
本篇发布在以下博客或网站:
双鱼座羊驼 的个人主页 - 动态 - 掘金 (juejin.cn)
XTDrone和PX4学习期间问题记录(一)的更多相关文章
- Java学习-007-Log4J 日志记录配置文件详解及实例源代码
此文主要讲述在初学 Java 时,常用的 Log4J 日志记录配置文件详解及实例源代码整理.希望能对初学 Java 编程的亲们有所帮助.若有不足之处,敬请大神指正,不胜感激!源代码测试通过日期为:20 ...
- PX4学习之-uORB msg 自动生成模板解读
最后更新日期 2019-06-22 一.前言 在 PX4学习之-uORB简单体验 中指出, 使用 uORB 进行通信的第一步是新建 msg.在实际编译过程中,新建的 msg 会转换成对应的 .h..c ...
- Redis入门学习(学习过程记录)
Redis(入门笔记) 学习一个大的技术点,然后顺带着就把这个技术点的面试题给学习了. 学习完一个技术后,如果面试题还不能够解答的话,只能说明学的不精,需要查漏补缺. 下一个学习的方向:Redis-非 ...
- UWP学习开发笔记记录(开篇)
零零散散开发微软移动2年多了,基本上从未记录或写过任何笔记.所以打算写一些自己的心得和技术的分享,大家一起来共同探讨.虽然现在UWP的工作几乎没有了,但是我感觉大家都是在观望,再看接下来微软的动作,所 ...
- CI 学习笔记、记录
[ci框架]ci框架目录结构分析 分类: [CodeIgniter深入研究]2013-05-09 00:24 7420人阅读 评论(5) 收藏 举报 [php] view plaincopy mysh ...
- Python模块学习 ---- logging 日志记录
许多应用程序中都会有日志模块,用于记录系统在运行过程中的一些关键信息,以便于对系统的运行状况进行跟踪.在.NET平台中,有非常著名的第三方开源日志组件log4net,c++中,有人们熟悉的log4cp ...
- Opengl_入门学习分享和记录_00
2019.7.4 本着对游戏创作的热情,本人初步了解了一部分的unity引擎的使用,也学习了一点C#可是越学习unity我就反而对引擎内部感兴趣(不知道有没有一样的朋友=,=). 接着了解到了open ...
- 当时学习《鸟哥的Linux私房菜-基础学习篇》记录的点
1.当执行一个指令的时候,举例来说[ls],系统会依照PATH的设定去每个PATH定义的目录下搜寻文件名为ls的可执行文件,如果在PATH定义的目录中含有多个文件名为ls的可执行文件,那么先搜寻到的同 ...
- 优秀编程学习网站&博文记录
记录优秀讲解知识点博客内容,侵删! 编程者学习网站 LearnKu终身编程者的知识社区 自动化测试内容 Python 接口自动化测试 应用开源接口网站:https://httpbin.org/#/St ...
- mybatis 学习视频总结记录
学习mybaits简单增删改查例子记录 此整理是学习视频后的视频内容整理,后半段还没有整理 网易云课堂 SSM高级整合视频 地址 : http://study.163.com/course/cours ...
随机推荐
- Linux_etc-passwd文件总结
文件内容 ## # User Database # # Note that this file is consulted directly only when the system is runnin ...
- 【读书笔记】C#高级编程 第二十二章 安全性
(一)身份验证和授权 安全性的两个基本支柱是身份验证和授权.身份验证是标识用户的过程,授权在验证了所标识用户是否可以访问特性资源之后进行的. 1.标识和Principal 使用标识可以验证运行应用程序 ...
- 【ASP.NET Core】自定义Session的存储方式
在开始今天的表演之前,老周先跟大伙伴们说一句:"中秋节快乐". 今天咱们来聊一下如何自己动手,实现会话(Session)的存储方式.默认是存放在分布式内存中.由于HTTP消息是无状 ...
- c#中容易被忽视的foreach
有句俗语:百姓日用而不知.我们c#程序员很喜欢,也非常习惯地用foreach.今天呢,我就带大家一起探索foreach,走,开始我们的旅程. 一.for语句用的好好的,为什么要提供一个foreach? ...
- Kubernetes 多租户:资源配额
资源配额用于管理命名空间中对象使用的资源量,我们可以按 CPU 和内存用量或对象数量来设置配额.通过资源配额,可以确保租户不会使用超过其分配份额的集群资源. 资源配额是通过 ResourceQuota ...
- Pod 的生命周期
上图展示了一个 Pod 的完整生命周期过程,其中包含 Init Container.Pod Hook.健康检查 三个主要部分,接下来我们就来分别介绍影响 Pod 生命周期的部分: 首先在介绍 Pod ...
- 第六章:Django 综合篇 - 3:使用MySQL数据库
在实际生产环境,Django是不可能使用SQLite这种轻量级的基于文件的数据库作为生产数据库.一般较多的会选择MySQL. 下面介绍一下如何在Django中使用MySQL数据库. 一.安装MySQL ...
- 使用nginx代理nexus,不是/根路径
location /nexus/ { proxy_pass http://192.168.0.218:8081/; proxy_set_header Host $host:$server_port; ...
- typescript中对象属性可选属性与只读属性与索引签名
可选属性 type类型别名 type 会给一个类型起个新名字. type 有时和 interface 很像,但是可以作用于原始值(基本类型),联合类型,元组以及其它任何你需要手写的类型. interf ...
- H5调用微信支付
这里用的是 vue项目; 首先在mounted中判断是否有openId,如果没有,则去获取 let openid = localStorage.getItem('openid'); if (!open ...