state-observation 1.7.0
General implementation of observers.
Loading...
Searching...
No Matches
observer-base.hpp
Go to the documentation of this file.
1
16
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{
37
38class STATE_OBSERVATION_DLLAPI ObserverBase
39{
40public:
43
46
49
54 ObserverBase(Index n, Index m, Index p = 0);
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
103 virtual StateVector getEstimatedState(TimeIndex k) = 0;
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:
149 Index n_;
150
152 Index m_;
153
155 Index p_;
156};
157
158} // namespace stateObservation
159
160#endif // OBSERVERBASEHPP
virtual StateVector stateVectorZero() const
Gives a vector of state vector size having zero values.
Index p_
inputSize is the size of the input vector
virtual void clearInputs()=0
Remove all the given values of the inputs.
Vector StateVector
StateVector is the type of state vector.
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.
Vector InputVector
InputVector is the type of the input vector.
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
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.
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
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.
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.