state-observation 1.7.0
General implementation of observers.
Loading...
Searching...
No Matches
imu-dynamical-system.hpp
Go to the documentation of this file.
1
12
13#ifndef IMU_DYNAMICAL_SYSTEM_HPP
14#define IMU_DYNAMICAL_SYSTEM_HPP
15
16#include <state-observation/api.h>
17#include <state-observation/dynamical-system/dynamical-system-functor-base.hpp>
21
22namespace stateObservation
23{
24
34class STATE_OBSERVATION_DLLAPI IMUDynamicalSystem : public DynamicalSystemFunctorBase
35{
36public:
38 IMUDynamicalSystem(bool withGyroBias = false);
39
42
44 virtual Vector stateDynamics(const Vector & x, const Vector & u, TimeIndex k);
45
47 virtual Vector measureDynamics(const Vector & x, const Vector & u, TimeIndex k);
48
50 virtual void setProcessNoise(NoiseBase *);
52 virtual void resetProcessNoise();
54 virtual NoiseBase * getProcessNoise() const;
55
59 virtual void resetMeasurementNoise();
61 virtual NoiseBase * getMeasurementNoise() const;
62
64 virtual void setSamplingPeriod(double dt);
65
67 virtual Index getStateSize() const;
69 virtual Index getInputSize() const;
71 virtual Index getMeasurementSize() const;
72
74 void setWithGyroBias(bool);
75
76 void updatestatesize()
77 {
78 if(withGyroBias_)
79 {
80 statesize_ = stateSizeBase_ + 3;
81 }
82 else
83 {
84 statesize_ = stateSizeBase_;
85 }
86 }
87
88 struct indexes : public kine::indexes<kine::rotationVector>
89 {
90 static const Index gyroBias = 18;
91 };
92
93protected:
95
96 NoiseBase * processNoise_;
97
98 double dt_;
99
100 Vector3Unaligned orientationVector_;
101 QuaternionUnaligned quaternion_;
102
103 Quaternion computeQuaternion_(const Vector3 & x);
104
105 static const Index stateSizeBase_ = 18;
107 static const Index inputSize_ = 6;
108 static const Index measurementSize_ = 6;
109
110 bool withGyroBias_;
111
113 static constexpr double one_ = 0.9999;
114
115private:
116public:
117 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
118};
119} // namespace stateObservation
120#endif // IMU-DYNAMICAL-SYSTEM_HPP
Implements the accelerometer-gyrometer inertial measuremen.
Implements the accelerometer-gyrometer measurements.
virtual Index getStateSize() const
Gets the state size.
virtual NoiseBase * getMeasurementNoise() const
Gets a pointer on the measurement noise.
virtual void setMeasurementNoise(NoiseBase *)
Sets a noise which disturbs the measurements.
virtual Vector stateDynamics(const Vector &x, const Vector &u, TimeIndex k)
Description of the state dynamics.
static constexpr double one_
the factor that approximate the "one" to avoid drifting of unobservable values
virtual void resetProcessNoise()
Removes the process noise.
virtual Vector measureDynamics(const Vector &x, const Vector &u, TimeIndex k)
Description of the sensor's dynamics.
virtual void resetMeasurementNoise()
Removes the measurement noise.
virtual Index getInputSize() const
Gets the input size.
void setWithGyroBias(bool)
Set whether we use Gyro Bias.
Index statesize_
the state size may be bigger if the bias is considered
virtual NoiseBase * getProcessNoise() const
Gets the process noise.
virtual void setProcessNoise(NoiseBase *)
Sets a noise which disturbs the state dynamics.
virtual void setSamplingPeriod(double dt)
Set the period of the time discretization.
virtual ~IMUDynamicalSystem()
The virtual destructor.
virtual Index getMeasurementSize() const
Gets the measurement size.
IMUDynamicalSystem(bool withGyroBias=false)
The constructor.
Filtering of divergent component of motion (DCM) and estimation of a bias betweeen the DCM and the co...
Eigen::Quaterniond Quaternion
Quaternion.
Eigen::Vector3d Vector3
3D vector
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vector3Unaligned
3D vector unaligned
Eigen::VectorXd Vector
Dynamic sized scalar vector.
Eigen::Quaternion< double, Eigen::DontAlign > QuaternionUnaligned
Quaternion Unaligned.
Implements integrators for the kinematics, in terms or rotations and translations.