state-observation 1.7.0
Loading...
Searching...
No Matches
dynamical-system-functor-base.hpp
Go to the documentation of this file.
1
13#ifndef STATEOBSERVERDYNAMICALSYSTEMFUNCTORBASE_H
14#define STATEOBSERVERDYNAMICALSYSTEMFUNCTORBASE_H
15
16#include <state-observation/api.h>
18
19namespace stateObservation
20{
21
32class STATE_OBSERVATION_DLLAPI DynamicalSystemFunctorBase
33{
34public:
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
This is the base class of any functor that describes the dynamics of the state and the measurement....
Definition dynamical-system-functor-base.hpp:33
void assertStateVector_(const Vector &v)
Definition dynamical-system-functor-base.hpp:61
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.
void assertInputVector_(const Vector &v)
Definition dynamical-system-functor-base.hpp:66
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
virtual void reset()
Definition dynamical-system-functor-base.hpp:46
Definitions of types and some structures.
Definition bidim-elastic-inv-pendulum-dyn-sys.hpp:21
long int TimeIndex
Definition definitions.hpp:139
Eigen::Index Index
Definition definitions.hpp:138
Eigen::VectorXd Vector
Dynamic sized scalar vector.
Definition definitions.hpp:76