stateObservation::ZeroDelayObserver Class Referenceabstract

Defines the base class of online zero delay observers. Zero delay observers are the classical state observers where input and state values at instant k and the measurement value at instant k+1 are enough to provide the estimation of the state at instant k+1. This class mostly defines the data structures for storing the vectors, it describes the set routines and the observation loop mechanism. It requires to be derviated to implement the new oneStepEstimation_() method. More...

#include <state-observation/observer/zero-delay-observer.hpp>

Inheritance diagram for stateObservation::ZeroDelayObserver:
Collaboration diagram for stateObservation::ZeroDelayObserver:

Public Member Functions

 ZeroDelayObserver (Index n, Index m, Index p=0)
 
 ZeroDelayObserver ()
 Default constructor (default values for n,m,p are zero) More...
 
virtual ~ZeroDelayObserver ()
 Destructor. More...
 
virtual void setState (const ObserverBase::StateVector &x_k, TimeIndex k)
 Set the value of the state vector at time index k. More...
 
virtual void setCurrentState (const ObserverBase::StateVector &x_k)
 Modify the value of the state vector at the current time. More...
 
virtual void clearStates ()
 Removes the state estimation. More...
 
bool stateIsSet () const
 Returns if the state is set or not. The state being set is mandatory to start the estimator. More...
 
virtual void setMeasurement (const ObserverBase::MeasureVector &y_k, TimeIndex k)
 
virtual void pushMeasurement (const ObserverBase::MeasureVector &y_k)
 Sets the measurement value at the next time index. More...
 
virtual void clearMeasurements ()
 Remove all the given values of the measurements. More...
 
virtual void setInput (const ObserverBase::InputVector &u_k, TimeIndex k)
 
virtual void pushInput (const ObserverBase::InputVector &u_k)
 Set the input value at the next time indext. More...
 
virtual void clearInputs ()
 
virtual void clearInputsAndMeasurements ()
 Remove all the given values of the inputs and measurements. More...
 
virtual TimeIndex estimateState ()
 run the observer until the measurement vector is depleted. More...
 
virtual ObserverBase::StateVector getEstimatedState (TimeIndex k)
 getestimated State More...
 
virtual ObserverBase::StateVector getCurrentEstimatedState () const
 Get the Current Estimated State. More...
 
virtual TimeIndex getCurrentTime () const
 Get the value of the time index of the current state estimation. More...
 
Vector getInput (TimeIndex k) const
 Get the value of the input of the time index k. More...
 
virtual TimeSize getInputsNumber () const
 Get the number of available inputs. More...
 
virtual TimeIndex getInputTime () const
 Get the time index of the last given input. More...
 
Vector getMeasurement (TimeIndex k) const
 Get the measurement of the time index k. More...
 
virtual TimeIndex getMeasurementTime () const
 Get the time index of the last given measurement. More...
 
virtual TimeSize getMeasurementsNumber () const
 Gets the number of regitered measurements. More...
 
virtual void setStateSize (Index n)
 changes the size of the state vector: resets the stored state vector More...
 
virtual void setMeasureSize (Index m)
 changes the size of the measurement vector: reset the stored measurement vectors More...
 
virtual void setInputSize (Index p)
 changes the size of the input vector: reset the stored input vectors More...
 
- Public Member Functions inherited from stateObservation::ObserverBase
 ObserverBase (Index n, Index m, Index p=0)
 
 ObserverBase ()
 default constructor (default values for n,m,p are zero) More...
 
virtual ~ObserverBase ()
 Destructor. More...
 
virtual Index getStateSize () const
 gets the size of the state vector More...
 
virtual Index getMeasureSize () const
 gets the size of the measurement vector More...
 
virtual Index getInputSize () const
 gets the size of the input vector More...
 
virtual void reset ()
 
virtual StateVector stateVectorConstant (double c) const
 
virtual StateVector stateVectorRandom () const
 Gives a vector of state vector size having random values. More...
 
virtual StateVector stateVectorZero () const
 Gives a vector of state vector size having zero values. More...
 
virtual bool checkStateVector (const StateVector &v) const
 Tells whether or not the vector has the dimensions of a state vector. More...
 
virtual MeasureVector measureVectorConstant (double c) const
 Gives a vector of measurement vector size having duplicated "c" value. More...
 
virtual MeasureVector measureVectorRandom () const
 Gives a vector of measurement vector size having random values. More...
 
virtual MeasureVector measureVectorZero () const
 Gives a vector of measurement vector size having zero values. More...
 
virtual bool checkMeasureVector (const MeasureVector &) const
 Tells whether or not the vector has the dimensions of a measurement vector. More...
 
virtual InputVector inputVectorConstant (double c) const
 Gives a vector of input vector size having duplicated "c" value. More...
 
virtual InputVector inputVectorRandom () const
 Gives a vector of input vector size having random values. More...
 
virtual InputVector inputVectorZero () const
 Gives a vector of input vector size having zero values. More...
 
virtual bool checkInputVector (const InputVector &) const
 Tells whether or not the vector has the dimensions of a input vector. More...
 

Protected Member Functions

virtual StateVector oneStepEstimation_ ()=0
 

Protected Attributes

IndexedVector x_
 while the measurements and iputs are put in lists More...
 
IndexedVectorArray y_
 Container for the measurements. More...
 
IndexedVectorArray u_
 Container for the inputs. More...
 
- Protected Attributes inherited from stateObservation::ObserverBase
Index n_
 stateSize is the size of the state vector More...
 
Index m_
 measureSize is the size of measurements vector More...
 
Index p_
 inputSize is the size of the input vector More...
 

Additional Inherited Members

- Public Types inherited from stateObservation::ObserverBase
typedef Vector StateVector
 StateVector is the type of state vector. More...
 
typedef Vector MeasureVector
 MeasureVector is the type of measurements vector. More...
 
typedef Vector InputVector
 InputVector is the type of the input vector. More...
 

Detailed Description

Defines the base class of online zero delay observers. Zero delay observers are the classical state observers where input and state values at instant k and the measurement value at instant k+1 are enough to provide the estimation of the state at instant k+1. This class mostly defines the data structures for storing the vectors, it describes the set routines and the observation loop mechanism. It requires to be derviated to implement the new oneStepEstimation_() method.

Constructor & Destructor Documentation

◆ ZeroDelayObserver() [1/2]

stateObservation::ZeroDelayObserver::ZeroDelayObserver ( Index  n,
Index  m,
Index  p = 0 
)
inline

The constructor

  • n : size of the state vector
  • m : size of the measurements vector
  • p : size of the input vector

◆ ZeroDelayObserver() [2/2]

stateObservation::ZeroDelayObserver::ZeroDelayObserver ( )
inline

Default constructor (default values for n,m,p are zero)

◆ ~ZeroDelayObserver()

virtual stateObservation::ZeroDelayObserver::~ZeroDelayObserver ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ clearInputs()

virtual void stateObservation::ZeroDelayObserver::clearInputs ( )
virtual

Remove all the given values of the inputs If there is no input, this instruction has no effect

Implements stateObservation::ObserverBase.

◆ clearInputsAndMeasurements()

virtual void stateObservation::ZeroDelayObserver::clearInputsAndMeasurements ( )
virtual

Remove all the given values of the inputs and measurements.

Reimplemented from stateObservation::ObserverBase.

◆ clearMeasurements()

virtual void stateObservation::ZeroDelayObserver::clearMeasurements ( )
virtual

Remove all the given values of the measurements.

Implements stateObservation::ObserverBase.

◆ clearStates()

virtual void stateObservation::ZeroDelayObserver::clearStates ( )
virtual

Removes the state estimation.

inherited from ObserverBase

Implements stateObservation::ObserverBase.

Reimplemented in stateObservation::KalmanFilterBase.

◆ estimateState()

virtual TimeIndex stateObservation::ZeroDelayObserver::estimateState ( )
virtual

run the observer until the measurement vector is depleted.

the observer has to be able to reconstruct all the state values from the current time to the last measurement time. That means all the input values reauired have to be provided before.

Returns
the current time

◆ getCurrentEstimatedState()

virtual ObserverBase::StateVector stateObservation::ZeroDelayObserver::getCurrentEstimatedState ( ) const
virtual

Get the Current Estimated State.

Returns
ObserverBase::StateVector

◆ getCurrentTime()

virtual TimeIndex stateObservation::ZeroDelayObserver::getCurrentTime ( ) const
virtual

Get the value of the time index of the current state estimation.

◆ getEstimatedState()

virtual ObserverBase::StateVector stateObservation::ZeroDelayObserver::getEstimatedState ( TimeIndex  k)
virtual

getestimated State

Parameters
kThe time index of the expected state value
Returns
ObserverBase::StateVector

If k is equal to the current time k_0, this will give the value of the last state/estimate.

If k is larger than the current time k_0, this will run the observer loop and get the state estimation of the state at instant k.

In order to estimate the state k, two conditions have to be met:

  • the time index k must be superior or equal to the current time k_0, the estimator does not record past values of the state and cannot observe past states.
  • the observer has to be able to reconstruct all the state values from k_0 to k. That means all the measurements or input values reauired have to be provided before.

That means generally (for most zero delay observers) that when current time is k_0 (we know an estimation of x_{k_0}) and we want to reconstruct the state at time k>k_0 we need to have the values of y_{k_0+1} to y_{k} and u_{k_0} to u_{k-1} (or u_{k} depending on the measure dynamics)

This method sets the current time to k

Implements stateObservation::ObserverBase.

◆ getInput()

Vector stateObservation::ZeroDelayObserver::getInput ( TimeIndex  k) const

Get the value of the input of the time index k.

◆ getInputsNumber()

virtual TimeSize stateObservation::ZeroDelayObserver::getInputsNumber ( ) const
virtual

Get the number of available inputs.

◆ getInputTime()

virtual TimeIndex stateObservation::ZeroDelayObserver::getInputTime ( ) const
virtual

Get the time index of the last given input.

◆ getMeasurement()

Vector stateObservation::ZeroDelayObserver::getMeasurement ( TimeIndex  k) const

Get the measurement of the time index k.

◆ getMeasurementsNumber()

virtual TimeSize stateObservation::ZeroDelayObserver::getMeasurementsNumber ( ) const
virtual

Gets the number of regitered measurements.

◆ getMeasurementTime()

virtual TimeIndex stateObservation::ZeroDelayObserver::getMeasurementTime ( ) const
virtual

Get the time index of the last given measurement.

◆ oneStepEstimation_()

virtual StateVector stateObservation::ZeroDelayObserver::oneStepEstimation_ ( )
protectedpure virtual

This method describes one loop of the observer (from k_0 to k_0+1) it has to be implemented in derived classes.

Implemented in stateObservation::KalmanFilterBase, and stateObservation::TiltEstimator.

◆ pushInput()

virtual void stateObservation::ZeroDelayObserver::pushInput ( const ObserverBase::InputVector u_k)
virtual

Set the input value at the next time indext.

Parameters
u_kValue of the next input

◆ pushMeasurement()

virtual void stateObservation::ZeroDelayObserver::pushMeasurement ( const ObserverBase::MeasureVector y_k)
virtual

Sets the measurement value at the next time index.

Parameters
y_kValue of the next measurement

◆ setCurrentState()

virtual void stateObservation::ZeroDelayObserver::setCurrentState ( const ObserverBase::StateVector x_k)
virtual

Modify the value of the state vector at the current time.

Parameters
x_kThe new state value

This method should NOT be used for first initialization Use setState() instead.

Calling this function will not affect the measurements nor the input vectors. It will only replace the current state/estimate with a new one

◆ setInput()

virtual void stateObservation::ZeroDelayObserver::setInput ( const ObserverBase::InputVector u_k,
TimeIndex  k 
)
virtual

Set the value of the input vector at time index k. The inputs have to be inserted in chronological order without gaps. If there is no input in the system (p==0), this instruction has no effect

Implements stateObservation::ObserverBase.

◆ setInputSize()

virtual void stateObservation::ZeroDelayObserver::setInputSize ( Index  p)
virtual

changes the size of the input vector: reset the stored input vectors

Reimplemented from stateObservation::ObserverBase.

Reimplemented in stateObservation::LinearKalmanFilter.

◆ setMeasurement()

virtual void stateObservation::ZeroDelayObserver::setMeasurement ( const ObserverBase::MeasureVector y_k,
TimeIndex  k 
)
virtual

Set the value of the measurements vector at time index k. The measurements have to be inserted in chronological order without gaps.

Implements stateObservation::ObserverBase.

◆ setMeasureSize()

virtual void stateObservation::ZeroDelayObserver::setMeasureSize ( Index  m)
virtual

changes the size of the measurement vector: reset the stored measurement vectors

Reimplemented from stateObservation::ObserverBase.

Reimplemented in stateObservation::KalmanFilterBase, and stateObservation::LinearKalmanFilter.

◆ setState()

virtual void stateObservation::ZeroDelayObserver::setState ( const ObserverBase::StateVector x_k,
TimeIndex  k 
)
virtual

Set the value of the state vector at time index k.

This replaces the current state estimate. If k < current time then the measurements and the inputs are also cleared. Otherwise only past measurements and inputs are removed.

Parameters
x_k
k

Implements stateObservation::ObserverBase.

◆ setStateSize()

virtual void stateObservation::ZeroDelayObserver::setStateSize ( Index  n)
virtual

changes the size of the state vector: resets the stored state vector

Reimplemented from stateObservation::ObserverBase.

Reimplemented in stateObservation::KalmanFilterBase, and stateObservation::LinearKalmanFilter.

◆ stateIsSet()

bool stateObservation::ZeroDelayObserver::stateIsSet ( ) const

Returns if the state is set or not. The state being set is mandatory to start the estimator.

Returns
true is set
false is not set

Member Data Documentation

◆ u_

IndexedVectorArray stateObservation::ZeroDelayObserver::u_
protected

Container for the inputs.

◆ x_

IndexedVector stateObservation::ZeroDelayObserver::x_
protected

while the measurements and iputs are put in lists

The state estimation of the observer (only one state is recorded)

◆ y_

IndexedVectorArray stateObservation::ZeroDelayObserver::y_
protected

Container for the measurements.


The documentation for this class was generated from the following file: