gtsam
Loading...
Searching...
No Matches
Gal3ImuEKF.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
31
32#pragma once
33
35#include <gtsam/geometry/Gal3.h>
36#include <gtsam/navigation/InvariantEKF.h> // Include the base class
38
39namespace gtsam {
40
42class GTSAM_EXPORT Gal3ImuEKF : public InvariantEKF<Gal3> {
43 public:
44 using Base = InvariantEKF<Gal3>;
45 using TangentVector = typename Base::TangentVector; // Vector10
46 using Jacobian = typename Base::Jacobian; // 10x10
47 using Covariance = typename Base::Covariance; // 10x10
48
55
63 Gal3ImuEKF(const Gal3& X0, const Covariance& P0,
64 const std::shared_ptr<PreintegrationParams>& params,
65 Mode mode = TRACK_TIME_NO_COVARIANCE);
66
69 static Gal3 Gravity(const Vector3& g_n, double dt) {
70 return {Rot3(), g_n * (0.5 * dt * dt), g_n * dt, 0.0};
71 }
72
76 static Gal3 TimeZeroingGravity(const Vector3& g_n, double dt) {
77 return {Rot3(), -g_n * (0.5 * dt * dt), g_n * dt, -dt};
78 }
79
83 static Gal3 CompensatedGravity(const Vector3& g_n, double dt, double t_k) {
84 const Point3 pW(-t_k * g_n * dt - g_n * (0.5 * dt * dt));
85 const Vector3 vW = g_n * dt;
86 return {Rot3(), pW, vW, 0.0};
87 }
88
90 static Gal3 Imu(const Vector3& omega_b, const Vector3& f_b, double dt) {
91 Gal3::TangentVector xi;
92 xi << omega_b, f_b, Z_3x1, 1.0;
93 return Gal3::Expmap(xi * dt);
94 }
95
115 static Gal3 Dynamics(const Vector3& g_n, const Gal3& X,
116 const Vector3& omega_b, const Vector3& f_b, double dt,
117 Mode mode = TRACK_TIME_WITH_COVARIANCE,
119
131 void predict(const Vector3& omega_b, const Vector3& f_b, double dt);
132
134 const std::shared_ptr<PreintegrationParams>& params() const;
135 const Vector3& gravity() const;
136 const Covariance& processNoise() const;
137
138 private:
139 std::shared_ptr<PreintegrationParams> params_;
140 Mode mode_{TRACK_TIME_NO_COVARIANCE};
141 Covariance Q_ = Covariance::Zero();
142};
143
144} // namespace gtsam
Macros for Vector constants to avoid excessive template instantiation.
3D Galilean Group SGal(3) state (attitude, position, velocity, time)
Left-Invariant Extended Kalman Filter implementation.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
Vector3 Point3
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point3 to Vector3...
Definition Point3.h:38
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
static Gal3 Expmap(const TangentVector &xi, OptionalJacobian< 10, 10 > Hxi={})
Exponential map at identity: tangent vector xi -> manifold element g.
Definition Gal3.cpp:303
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
Definition Rot3.h:65
Specialized EKF for IMU-driven on Gal3.
Definition Gal3ImuEKF.h:42
static Gal3 TimeZeroingGravity(const Vector3 &g_n, double dt)
Calculate W: gravity with correction to neutralize time change, Using this W(t_k) together with Imu()...
Definition Gal3ImuEKF.h:76
Mode
The Gal3 EKF has three modes of operation.
Definition Gal3ImuEKF.h:50
@ TRACK_TIME_WITH_COVARIANCE
Track time and its covariance.
Definition Gal3ImuEKF.h:53
@ TRACK_TIME_NO_COVARIANCE
Track time, but not its covariance (default).
Definition Gal3ImuEKF.h:52
@ NO_TIME
Do not track time, state remains in NavState sub-group.
Definition Gal3ImuEKF.h:51
Gal3ImuEKF(const Gal3 &X0, const Covariance &P0, const std::shared_ptr< PreintegrationParams > &params, Mode mode=TRACK_TIME_NO_COVARIANCE)
Construct with initial state/covariance and preintegration params (for gravity and IMU covariances).
Definition Gal3ImuEKF.cpp:25
static Gal3 Imu(const Vector3 &omega_b, const Vector3 &f_b, double dt)
Calculate U from raw IMU (no gravity): body-frame increments.
Definition Gal3ImuEKF.h:90
static Gal3 Gravity(const Vector3 &g_n, double dt)
Calculate gravity-only left composition, world-frame increments p = +1/2 g dt^2, v = g dt,...
Definition Gal3ImuEKF.h:69
static Gal3 CompensatedGravity(const Vector3 &g_n, double dt, double t_k)
Calculate W: position-compensated gravity (left composition) that enables tracking absolute time in-s...
Definition Gal3ImuEKF.h:83
typename Base::Jacobian Jacobian
Definition InvariantEKF.h:64
typename Base::TangentVector TangentVector
Definition InvariantEKF.h:61
InvariantEKF(const Gal3 &X0, const Covariance &P0)
Definition InvariantEKF.h:73
typename Base::Covariance Covariance
Definition InvariantEKF.h:66