当前位置: 首页 > news >正文

ORB-SLAM3源码学习:G2oTypes.cc: void EdgeInertial::computeError 计算预积分残差

前言

 这部分函数涉及了g2o的内容以及IMU相关的推导内容,需要你先去进行这部分的学习。

1.函数声明

void EdgeInertial::computeError()

2.函数定义 

涉及到的IMU的公式: 

c8d6f9e364ee4715af328c7733afd5d4.png

92c2e3e72ee54856a1a5e3f6243e1584.png

65e6370b4a4d4f63aa9d93bfd7355ff4.png

{// TODO Maybe Reintegrate inertial measurments when difference between linearization point and current estimate is too big// 当线性化点与当前估计之间的差异过大时,可能需要重新积分惯性测量值。// 在父类中使用了using,故这里可以直接使用保护成员变量// 获取因子图的顶点const VertexPose* VP1 = static_cast<const VertexPose*>(_vertices[0]);           //位姿Ticonst VertexVelocity* VV1= static_cast<const VertexVelocity*>(_vertices[1]);    //速度viconst VertexGyroBias* VG1= static_cast<const VertexGyroBias*>(_vertices[2]);    //零偏Bgiconst VertexAccBias* VA1= static_cast<const VertexAccBias*>(_vertices[3]);      //零偏Baiconst VertexPose* VP2 = static_cast<const VertexPose*>(_vertices[4]);           //位姿Tjconst VertexVelocity* VV2 = static_cast<const VertexVelocity*>(_vertices[5]);   //速度vj// 获取IMU偏置的三个分量并计算预积分的增量// _estimate是类中的一个成员变量,表示该顶点的当前估计值。const IMU::Bias b1(VA1->estimate()[0],VA1->estimate()[1],VA1->estimate()[2],VG1->estimate()[0],VG1->estimate()[1],VG1->estimate()[2]);const Eigen::Matrix3d dR = mpInt->GetDeltaRotation(b1).cast<double>();const Eigen::Vector3d dV = mpInt->GetDeltaVelocity(b1).cast<double>();const Eigen::Vector3d dP = mpInt->GetDeltaPosition(b1).cast<double>();const Eigen::Vector3d er = LogSO3(dR.transpose()*VP1->estimate().Rwb.transpose()*VP2->estimate().Rwb);const Eigen::Vector3d ev = VP1->estimate().Rwb.transpose()*(VV2->estimate() - VV1->estimate() - g*dt) - dV;const Eigen::Vector3d ep = VP1->estimate().Rwb.transpose()*(VP2->estimate().twb - VP1->estimate().twb- VV1->estimate()*dt - g*dt*dt/2) - dP;_error << er, ev, ep;
}

结束语 

以上就是我学习到的内容,如果对您有帮助请多多支持我,如果哪里有问题欢迎大家在评论区积极讨论,我看到会及时回复。


http://www.mrgr.cn/news/80138.html

相关文章:

  • 代码随想录算法训练营第一天 | 数组理论基础,977.有序数组平方结果再排序
  • 玛哈特精密矫平机:制造业的隐秘
  • C语言数组和字符串笔记
  • 51c大模型~合集89
  • 考研数学【线性代数基础box(数二)】
  • ubuntu20.04+ROS Noetic 安装PX4+Mavros
  • Vue基础记录
  • 海康萤石摄像机接入EasyNVR流程:开启RTSP-》萤石视频添加到EasyNVR-》未来支持海康SDK协议添加到EasyNVR
  • 代码随想录算法训练营第三天 | 链表理论基础 | 707.设计链表
  • 从整个SecurityFilterChain的角度,一个请求经过Spring Security的流程
  • L23.【LeetCode笔记】验证回文串(剖析几种解法)
  • Spring 如何解决循环依赖?
  • Linux下socket广播通讯的实现
  • 图像融合算法笔记2024 CDTNet
  • pytorch_fid 安装笔记
  • 【AIGC】ChatGPT保护指令:高效提升GPTs提示词与知识库文件的安全性
  • 【PyCharm调试】显示一个对象值时会调用的方法
  • 长短期记忆神经网络(LSTM)介绍
  • 【ADS射频电路学习笔记】1. ADS基本操作
  • PHP搭建环境