gtsam
Loading...
Searching...
No Matches
AHRS.h
1/*
2 * AHRS.h
3 *
4 * Created on: Jan 26, 2012
5 * Author: cbeall3
6 */
7
8#pragma once
9
10#include <gtsam/config.h>
11
12#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V43
13
14#include "Mechanization_bRn2.h"
15#include <gtsam_unstable/dllexport.h>
17
18namespace gtsam {
19
25class GTSAM_UNSTABLE_EXPORT AHRS {
26
27private:
28
29 // Initial state
30 Mechanization_bRn2 mech0_;
31 KalmanFilter KF_;
32
33 // Quantities needed for integration
34 Matrix3 F_g_;
35 Matrix3 F_a_;
36
37 typedef Eigen::Matrix<double,12,1> Variances;
38 Variances var_w_;
39
40 // Quantities needed for aiding
41 Vector3 sigmas_v_a_;
42 Vector3 n_g_;
43 Matrix3 n_g_cross_;
44
45 Matrix3 Pg_, Pa_;
46
47public:
48
49 typedef Eigen::Matrix<double,3,Eigen::Dynamic> Vector3s;
50 static Matrix3 Cov(const Vector3s& m);
51
58 AHRS(const Matrix& stationaryU, const Matrix& stationaryF, double g_e, bool flat=false);
59
60 std::pair<Mechanization_bRn2, KalmanFilter::State> initialize(double g_e);
61
62 std::pair<Mechanization_bRn2, KalmanFilter::State> integrate(
63 const Mechanization_bRn2& mech, KalmanFilter::State state,
64 const Vector& u, double dt);
65
66 bool isAidingAvailable(const Mechanization_bRn2& mech,
67 const Vector& f, const Vector& u, double ge) const;
68
76 std::pair<Mechanization_bRn2, KalmanFilter::State> aid(
77 const Mechanization_bRn2& mech, KalmanFilter::State state,
78 const Vector& f, bool Farrell=0) const;
79
80 std::pair<Mechanization_bRn2, KalmanFilter::State> aidGeneral(
81 const Mechanization_bRn2& mech, KalmanFilter::State state,
82 const Vector& f, const Vector& f_expected, const Rot3& R_previous) const;
83
85 void print(const std::string& s = "") const;
86
87 virtual ~AHRS();
88};
89
90} /* namespace gtsam */
91
92#endif // GTSAM_ALLOW_DEPRECATED_SINCE_V43
Simple linear Kalman filter implemented using factor graphs, i.e., performs Cholesky or QR-based SRIF...
Global functions in a separate testing namespace.
Definition chartTesting.h:28
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:143