gtsam
Loading...
Searching...
No Matches
GalileanPreintegration.h
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2
3 * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4 * Atlanta, Georgia 30332-0415
5 * All Rights Reserved
6 * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8 * See LICENSE for the license information
9
10 * -------------------------------------------------------------------------- */
11
27
28#pragma once
29
30#include <gtsam/base/Matrix.h>
31#include <gtsam/geometry/Gal3.h>
35
36namespace gtsam {
37
46class GTSAM_EXPORT GalileanPreintegration : public PreintegrationBase {
47 public:
48 using Base = PreintegrationBase;
49 using Params = PreintegrationBase::Params;
50 using Matrix10 = Eigen::Matrix<double, 10, 10>;
51 using Matrix106 = Eigen::Matrix<double, 10, 6>;
52 using Matrix910 = Eigen::Matrix<double, 9, 10>;
53
55 inline static constexpr bool kLegacyUsesLogmap = true;
56
57 protected:
59 Matrix106 biasJacobian_;
60
62 static Vector9 NavStateTangent(const Gal3& galilean,
64
66 void updateGal3(const Vector3& measuredAcc, const Vector3& measuredOmega,
67 double dt, Matrix10* A, Matrix106* B);
68
71
72 public:
75 const std::shared_ptr<Params>& p,
76 const imuBias::ConstantBias& biasHat = {});
77
78 Rot3 deltaRij() const override { return preintMatrix_.rotation(); }
79 Vector3 deltaPij() const override { return preintMatrix_.translation(); }
80 Vector3 deltaVij() const override { return preintMatrix_.velocity(); }
81 NavState deltaXij() const override {
82 return NavState(preintMatrix_.rotation(), preintMatrix_.translation(),
83 preintMatrix_.velocity());
84 }
85
87 Vector9 preintegrated() const { return biasCorrectedDelta(biasHat_); }
88
90 Vector9 biasCorrectedDelta(const imuBias::ConstantBias& bias_i,
91 OptionalJacobian<9, 6> H = {}) const override;
92
97 void update(const Vector3& measuredAcc, const Vector3& measuredOmega,
98 double dt, Matrix9* A, Matrix93* B, Matrix93* C) override;
99
101 void resetIntegration() override;
102
103 void print(const std::string& s = "GalileanPreintegration") const override;
104 bool equals(const GalileanPreintegration& other, double tol = 1e-9) const;
105
106 private:
107#if GTSAM_ENABLE_BOOST_SERIALIZATION
108 friend class boost::serialization::access;
109 template <class Archive>
110 void serialize(Archive& archive, const unsigned int /*version*/) {
111 archive& BOOST_SERIALIZATION_BASE_OBJECT_NVP(PreintegrationBase);
112 archive& BOOST_SERIALIZATION_NVP(preintMatrix_);
113 archive& BOOST_SERIALIZATION_NVP(biasJacobian_);
114 }
115#endif
116};
117
118} // namespace gtsam
typedef and functions to augment Eigen's MatrixXd
3D Galilean Group SGal(3) state (attitude, position, velocity, time)
Navigation state composing of attitude, position, and velocity.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition OptionalJacobian.h:40
Represents an element of the 3D Galilean group SGal(3).
Definition Gal3.h:39
const Velocity3 & velocity(OptionalJacobian< 3, 10 > H={}) const
Access velocity component (Vector3).
Definition Gal3.cpp:156
const Point3 & translation(OptionalJacobian< 3, 10 > H={}) const
Access translation component (Point3).
Definition Gal3.cpp:146
const Rot3 & rotation(OptionalJacobian< 3, 10 > H={}) const
Access rotation component (Rot3).
Definition Gal3.cpp:137
IMU preintegration on Gal(3) using GTSAM's left-invariant local error.
Definition GalileanPreintegration.h:46
GalileanPreintegration()
Default constructor for serialization.
Definition GalileanPreintegration.h:70
Vector9 preintegrated() const
Return the Galilean delta in NavState tangent ordering.
Definition GalileanPreintegration.h:87
void resetIntegration() override
Reset the mean, elapsed time, and bias Jacobian.
Definition GalileanPreintegration.cpp:32
Matrix106 biasJacobian_
Right correction wrt (accel, gyro) bias.
Definition GalileanPreintegration.h:59
static Vector9 NavStateTangent(const Gal3 &galilean, OptionalJacobian< 9, 10 > H={})
Extract the factor tangent and its Jacobian from a Gal(3) element.
Definition GalileanPreintegration.cpp:113
static constexpr bool kLegacyUsesLogmap
Select the SE_2(3) logarithm in Legacy factor-error mode.
Definition GalileanPreintegration.h:55
Vector9 biasCorrectedDelta(const imuBias::ConstantBias &bias_i, OptionalJacobian< 9, 6 > H={}) const override
Apply the first-order physical bias correction on the right.
Definition GalileanPreintegration.cpp:137
Gal3 preintMatrix_
Mean increment in Gal(3).
Definition GalileanPreintegration.h:58
Definition ImuBias.h:34
Bias biasHat_
Acceleration and gyro bias used for preintegration.
Definition PreintegrationBase.h:57
PreintegrationBase()
Default constructor for serialization.
Definition PreintegrationBase.h:63