state-observation 1.7.0
Loading...
Searching...
No Matches
observer-base.hpp
Go to the documentation of this file.
1
17#ifndef OBSERVERBASEHPP
18#define OBSERVERBASEHPP
19
20#include <boost/assert.hpp>
21#include <boost/static_assert.hpp>
22
23#include <state-observation/api.h>
25
26namespace stateObservation
27{
39{
40public:
43
46
49
55
58
60 virtual ~ObserverBase(){};
61
63 virtual void setStateSize(Index n);
64
66 virtual Index getStateSize() const;
67
69 virtual void setMeasureSize(Index m);
70
72 virtual Index getMeasureSize() const;
73
75 virtual void setInputSize(Index p);
76
78 virtual Index getInputSize() const;
79
81 virtual void setState(const StateVector & x_k, TimeIndex k) = 0;
82
84 virtual void clearStates() = 0;
85
87 virtual void setMeasurement(const MeasureVector & y_k, TimeIndex k) = 0;
88
90 virtual void clearMeasurements() = 0;
91
93 virtual void setInput(const InputVector & x_k, TimeIndex k) = 0;
94
96 virtual void clearInputs() = 0;
97
100
104
107 virtual void reset();
108
112 virtual StateVector stateVectorConstant(double c) const;
113
116
119
121 virtual bool checkStateVector(const StateVector & v) const;
122
124 virtual MeasureVector measureVectorConstant(double c) const;
125
128
131
133 virtual bool checkMeasureVector(const MeasureVector &) const;
134
136 virtual InputVector inputVectorConstant(double c) const;
137
140
143
145 virtual bool checkInputVector(const InputVector &) const;
146
147protected:
150
153
156};
157
158} // namespace stateObservation
159
160#endif // OBSERVERBASEHPP
The base class for observers. The observer is destinated to any dynamical system with a vector state ...
Definition observer-base.hpp:39
virtual StateVector stateVectorZero() const
Gives a vector of state vector size having zero values.
Index p_
inputSize is the size of the input vector
Definition observer-base.hpp:155
virtual void clearInputs()=0
Remove all the given values of the inputs.
Vector StateVector
StateVector is the type of state vector.
Definition observer-base.hpp:42
virtual void setState(const StateVector &x_k, TimeIndex k)=0
Set the value of the state vector at time index k.
virtual MeasureVector measureVectorZero() const
Gives a vector of measurement vector size having zero values.
virtual Index getMeasureSize() const
gets the size of the measurement vector
virtual InputVector inputVectorRandom() const
Gives a vector of input vector size having random values.
virtual ~ObserverBase()
Destructor.
Definition observer-base.hpp:60
Vector InputVector
InputVector is the type of the input vector.
Definition observer-base.hpp:48
virtual StateVector stateVectorRandom() const
Gives a vector of state vector size having random values.
ObserverBase()
default constructor (default values for n,m,p are zero)
virtual void setInput(const InputVector &x_k, TimeIndex k)=0
Set the value of the input vector at time index k.
virtual StateVector stateVectorConstant(double c) const
virtual void clearMeasurements()=0
Remove all the given values of the measurements.
virtual void setInputSize(Index p)
Changes the size of the input vector.
virtual InputVector inputVectorZero() const
Gives a vector of input vector size having zero values.
virtual bool checkMeasureVector(const MeasureVector &) const
Tells whether or not the vector has the dimensions of a measurement vector.
virtual Index getInputSize() const
gets the size of the input vector
virtual bool checkInputVector(const InputVector &) const
Tells whether or not the vector has the dimensions of a input vector.
virtual void setMeasurement(const MeasureVector &y_k, TimeIndex k)=0
Set the value of the measurements vector at time index k.
virtual InputVector inputVectorConstant(double c) const
Gives a vector of input vector size having duplicated "c" value.
ObserverBase(Index n, Index m, Index p=0)
Index n_
stateSize is the size of the state vector
Definition observer-base.hpp:149
virtual bool checkStateVector(const StateVector &v) const
Tells whether or not the vector has the dimensions of a state vector.
Vector MeasureVector
MeasureVector is the type of measurements vector.
Definition observer-base.hpp:45
virtual StateVector getEstimatedState(TimeIndex k)=0
virtual MeasureVector measureVectorConstant(double c) const
Gives a vector of measurement vector size having duplicated "c" value.
Index m_
measureSize is the size of measurements vector
Definition observer-base.hpp:152
virtual void setStateSize(Index n)
Changes the size of the state vector.
virtual void clearInputsAndMeasurements()
Remove all the given values of the inputs and measurements.
virtual MeasureVector measureVectorRandom() const
Gives a vector of measurement vector size having random values.
virtual void setMeasureSize(Index m)
Changes the size of the measurement vector.
virtual void clearStates()=0
Remove all the given values of the state.
virtual Index getStateSize() const
gets the size of the state vector
Definitions of types and some structures.
Definition bidim-elastic-inv-pendulum-dyn-sys.hpp:21
long int TimeIndex
Definition definitions.hpp:139
Eigen::MatrixXd Matrix
Dynamic sized Matrix.
Definition definitions.hpp:100
Eigen::Index Index
Definition definitions.hpp:138
Eigen::VectorXd Vector
Dynamic sized scalar vector.
Definition definitions.hpp:76