state-observation 1.7.0
General implementation of observers.
Loading...
Searching...
No Matches
dynamical-system-functor-base.hpp
1
12
13#ifndef STATEOBSERVERDYNAMICALSYSTEMFUNCTORBASE_H
14#define STATEOBSERVERDYNAMICALSYSTEMFUNCTORBASE_H
15
16#include <state-observation/api.h>
18
19namespace stateObservation
20{
21
31
32class STATE_OBSERVATION_DLLAPI DynamicalSystemFunctorBase
33{
34public:
35 DynamicalSystemFunctorBase();
36 virtual ~DynamicalSystemFunctorBase();
37
39 virtual Vector stateDynamics(const Vector & x, const Vector & u, TimeIndex k) = 0;
40
42 virtual Vector measureDynamics(const Vector & x, const Vector & u, TimeIndex k) = 0;
43
46 virtual void reset() {}
47
49 virtual Index getStateSize() const = 0;
51 virtual Index getInputSize() const = 0;
53 virtual Index getMeasurementSize() const = 0;
54
56 virtual bool checkStateVector(const Vector &);
58 virtual bool checkInputvector(const Vector &);
59
60protected:
61 inline void assertStateVector_(const Vector & v)
62 {
63 (void)v; // avoid warning
64 BOOST_ASSERT(checkStateVector(v) && "ERROR: The state vector has the wrong size");
65 }
66 inline void assertInputVector_(const Vector & v)
67 {
68 (void)v; // avoid warning
69 BOOST_ASSERT(checkInputvector(v) && "ERROR: The input vector has the wrong size");
70 }
71
72private:
73};
74
75} // namespace stateObservation
76
77#endif // STATEOBSERVERDYNAMICSYSTEMFUNCTORBASE_H
virtual bool checkStateVector(const Vector &)
Gives a boolean answer on whether or not the vector is correctly sized to be a state vector.
virtual bool checkInputvector(const Vector &)
Gives a boolean answer on whether or not the vector is correctly sized to be an input vector.
virtual Vector stateDynamics(const Vector &x, const Vector &u, TimeIndex k)=0
The function to overload to describe the dynamics of the state.
virtual Index getStateSize() const =0
gets the state size
virtual Index getInputSize() const =0
gets the input size
virtual Vector measureDynamics(const Vector &x, const Vector &u, TimeIndex k)=0
The function to overload to describe the dynamics of the sensor (measurements).
virtual Index getMeasurementSize() const =0
gets the measurements size
Definitions of types and some structures.
Filtering of divergent component of motion (DCM) and estimation of a bias betweeen the DCM and the co...
Eigen::VectorXd Vector
Dynamic sized scalar vector.