2#include <NDEVR/Buffer.h>
3#include <NDEVR/Vertex.h>
7#include <Eigen/Geometry>
9#include <OrbSLAM/Thirdparty/Sophus/sophus/se3.hpp>
16 const float GRAVITY_VALUE = 9.81f;
24 Point(
const Ray<3, fltp04>& acc,
const Ray<3, fltp04>& gyro, fltp08 timestamp)
25 : acc(acc[
X], acc[
Y], acc[
Z])
26 , w(gyro[
X], gyro[
Y], gyro[
Z])
29 Point(fltp04 acc_x, fltp04 acc_y, fltp04 acc_z,
30 fltp04 ang_vel_x, fltp04 ang_vel_y, fltp04 ang_vel_z,
32 : acc(acc_x, acc_y, acc_z)
33 , w(ang_vel_x, ang_vel_y, ang_vel_z)
36 template<
class t_xyz_type>
37 Point(
const t_xyz_type Acc,
const t_xyz_type Gyro,
const double& timestamp)
38 : acc(Acc.x, Acc.y, Acc.z)
39 , w(Gyro.x, Gyro.y, Gyro.z)
46 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
53 Bias() :bax(0), bay(0), baz(0), bwx(0), bwy(0), bwz(0) {}
54 Bias(
const float& b_acc_x,
const float& b_acc_y,
const float& b_acc_z,
55 const float& b_ang_vel_x,
const float& b_ang_vel_y,
const float& b_ang_vel_z)
63 Bias(
const fltp08& b_acc_x,
const fltp08& b_acc_y,
const fltp08& b_acc_z,
64 const fltp08& b_ang_vel_x,
const fltp08& b_ang_vel_y,
const fltp08& b_ang_vel_z)
72 void CopyFrom(Bias& b);
77 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
85 Calib(
const Sophus::SE3<float>& Tbc,
const float& ng,
const float& na,
const float& ngw,
const float& naw)
87 Set(Tbc, ng, na, ngw, naw);
90 Calib(
const Calib& calib);
91 Calib() { mbIsSet =
false; }
94 void Set(
const Sophus::SE3<float>& sophTbc,
const float& ng,
const float& na,
const float& ngw,
const float& naw);
98 Sophus::SE3<float> mTcb;
99 Sophus::SE3<float> mTbc;
100 Eigen::DiagonalMatrix<float, 6> Cov, CovWalk;
101 bool mbIsSet =
false;
105 class IntegratedRotation
108 IntegratedRotation() {}
109 IntegratedRotation(
const Eigen::Vector3f& angVel,
const Bias& imuBias,
const float& time);
113 Eigen::Matrix3f deltaR;
114 Eigen::Matrix3f rightJ;
115 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
122 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
123 Preintegrated(
const Bias& b_,
const Calib& calib);
124 Preintegrated(Preintegrated* pImuPre);
127 void CopyFrom(Preintegrated* pImuPre);
128 void Initialize(
const Bias& b_);
129 void IntegrateNewMeasurement(
const Eigen::Vector3f& acceleration,
const Eigen::Vector3f& angVel,
const float& dt);
131 void MergePrevious(Preintegrated* pPrev);
132 void SetNewBias(
const Bias& bu_);
133 IMU::Bias GetDeltaBias(
const Bias& b_);
135 Eigen::Matrix3f GetDeltaRotation(
const Bias& b_);
136 Eigen::Vector3f GetDeltaVelocity(
const Bias& b_);
137 Eigen::Vector3f GetDeltaPosition(
const Bias& b_);
139 Eigen::Matrix3f GetUpdatedDeltaRotation();
140 Eigen::Vector3f GetUpdatedDeltaVelocity();
141 Eigen::Vector3f GetUpdatedDeltaPosition();
143 Eigen::Matrix3f GetOriginalDeltaRotation();
144 Eigen::Vector3f GetOriginalDeltaVelocity();
145 Eigen::Vector3f GetOriginalDeltaPosition();
147 Eigen::Matrix<float, 6, 1> GetDeltaBias();
149 Bias GetOriginalBias();
150 Bias GetUpdatedBias();
153 Eigen::Matrix<float, 15, 15>
C;
154 Eigen::Matrix<float, 15, 15> Info;
155 Eigen::DiagonalMatrix<float, 6> Nga, NgaWalk;
160 Eigen::Vector3f dV, dP;
161 Eigen::Matrix3f JRg, JVg, JVa, JPg, JPa;
162 Eigen::Vector3f avgA, avgW;
170 Eigen::Matrix<float, 6, 1> db;
174 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
176 integrable(
const Eigen::Vector3f& a_,
const Eigen::Vector3f& w_,
const float& t_) :a(a_), w(w_), t(t_) {}
177 Eigen::Vector3f a, w;
181 Buffer<integrable> mvMeasurements;
187 Eigen::Matrix3f RightJacobianSO3(
const float& x,
const float& y,
const float& z);
188 Eigen::Matrix3f RightJacobianSO3(
const Eigen::Vector3f& v);
190 Eigen::Matrix3f InverseRightJacobianSO3(
const float& x,
const float& y,
const float& z);
191 Eigen::Matrix3f InverseRightJacobianSO3(
const Eigen::Vector3f& v);
193 Eigen::Matrix3f NormalizeRotation(
const Eigen::Matrix3f& R);
float fltp04
Defines an alias representing a 4 byte floating-point number.
Definition BaseValues.hpp:157
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:514
@ Y
Definition BaseValues.hpp:202
@ X
Definition BaseValues.hpp:200
@ C
Definition BaseValues.hpp:205
@ Z
Definition BaseValues.hpp:204
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181