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 ...
随机推荐
- Tomcat入门学习笔记
Tomcat服务器 Tomcat使用 Tomcat下载 官网地址:Apache Tomcat - Apache Tomcat 8 Software Downloads 下载Windows 64位版To ...
- API设计中性能提升的10种解决方法
api的设计涉及到的方面很多, 分类是一个基本的思考方式.如果可以形成一个系列性的文字,那就从性能开始吧. 就像任何性能一样,API 性能主要取决于如何响应不同类型的请求.例如:典型的电商场景,显示用 ...
- spark 执行spark-example
1. 找到CDH 安装spark的目录 执行 which spark-shell /usr/bin/spark-shell 执行 ll /usr/bin/spark-shell lrwxrwxrwx ...
- LVGL 模拟仿真(Windows+CodeBlocks)
一.准备材料 Code Blocks官网:https://www.codeblocks.org/ Code Blocks 汉化包:链接: https://pan.baidu.com/s/12zB5bD ...
- 阿里云下配置keepalive,利用HAVIP实现HA
注:这篇文章参考网络,有些称呼都变了,比如阿里云上的现在是弹性ip 包括阿里云在内的很多云环境,因为不支持浮动IP广受诟病.目前阿里云在VPC网络下发布了HAVIP,能够实现arp宣告IP.这样也就让 ...
- Alermanager_template,email
default.tmpl {{ define "__subject" }}[{{ .Status | toUpper }}{{ if eq .Status "firing ...
- kubernetes为容器定义环境变量
示例Pod 的配置文件 envars.yaml Copy envars.yaml to clipboard apiVersion: v1 kind: Pod metadata: name: envar ...
- 部署AlertManager
部署Alertmanager Alertmanager和Prometheus Server一样均采用Golang实现,并且没有第三方依赖.一般来说我们可以通过以下几种方式来部署Alertmanager ...
- 在 Fedora 中使用 Cockpit 创建虚拟机
本文向你展示如何在 Fedora 31 上使用安装 Cockpit 所需软件来创建和管理虚拟机.Cockpit 是一个交互式管理界面,可让你在任何受支持的 Web 浏览器上访问和管理系统.随着 vir ...
- 20_IO
IO框架 一. 流的概念 概念:内存与存储设备之间传输数据的通道 水借助管道传输:数据借助流传输 二. 流的分类 按方向[重点] 输入流:将<存储设备>中的内容读入到<内存>中 ...