state-observation 1.8.0
General implementation of observers.
Loading...
Searching...
No Matches
stateObservation::DelayedMeasurementObserver Class Referenceabstract
Inheritance diagram for stateObservation::DelayedMeasurementObserver:
[legend]
Collaboration diagram for stateObservation::DelayedMeasurementObserver:
[legend]

Public Member Functions

 DelayedMeasurementObserver (double dt, Index n, Index m, unsigned long bufferCapacity, const std::shared_ptr< IndexedInputArrayInterface > input=nullptr, const std::shared_ptr< AsynchronousDataMapBase > async_input=nullptr, const std::shared_ptr< AsynchronousDataMapBase > async_meas=nullptr)
 DelayedMeasurementObserver ()=delete
 Default constructor.
virtual ~DelayedMeasurementObserver ()
 Destructor.
 DelayedMeasurementObserver (const DelayedMeasurementObserver &)=delete
 Not copyable: the copy would share the buffers of inputs and measurements.
DelayedMeasurementObserver & operator= (const DelayedMeasurementObserver &)=delete
const ObserverBase::StateVector & getCurrentEstimatedState ()
 Get the Current Estimated State.
virtual void initEstimator (const Vector &x)
 initializes the state vector.
virtual void setState (const ObserverBase::StateVector &x_k, TimeIndex k) override
 Set the value of the state vector at time index k.
virtual const ObserverBase::StateVector & getEstimatedState (TimeIndex k) override
 getestimated State
void setMeasurement (const Vector &y, TimeIndex k) override
 sets the measurement
void pushAsyncMeasurement (const AsynchronousDataBase &asyncMeas, TimeIndex k)
Vector getMeasurement (TimeIndex k) const
 Get the measurement of the time index k.
virtual TimeIndex getMeasurementTime () const
 Get the time index of the last given measurement.
virtual void clearMeasurements () override
 Remove all the given values of the measurements.
virtual void clearDelayedMeasurements ()
 Remove all the given values of the measurements.
void pushAsyncInput (const AsynchronousDataBase &asyncMeas, TimeIndex k)
virtual void setInput (const InputBase &u_k, TimeIndex k) override
virtual void clearInputs () override
virtual void clearDelayedInputs ()
void setCurrentState (const ObserverBase::StateVector &x_k)
 Modify the value of the state vector at the current time.
virtual void clearStates () override
 Removes the state estimation.
virtual void setStateCapacity (unsigned long stateCapacity)
 set the sampling time of the measurements
void setSamplingTime (const double dt)
 set the sampling time of the measurements
double getSamplingTime ()
TimeIndex getAsynchronousFirstIndex ()
virtual TimeIndex getCurrentTime () const
 Get the value of the time index of the current state estimation.
Public Member Functions inherited from stateObservation::ObserverBase
 ObserverBase (Index n, Index m)
 InputVector is the type of the input vector.
 ObserverBase ()
 default constructor (default values for n,m are zero)
virtual ~ObserverBase ()
 Destructor.
virtual void setStateSize (Index n)
 Changes the size of the state vector.
virtual Index getStateSize () const
 gets the size of the state vector
virtual void setMeasureSize (Index m)
 Changes the size of the measurement vector.
virtual Index getMeasureSize () const
 gets the size of the measurement vector
virtual void clearInputsAndMeasurements ()
 Remove all the given values of the inputs and measurements.
virtual void reset ()
virtual StateVector stateVectorConstant (double c) const
virtual StateVector stateVectorRandom () const
 Gives a vector of state vector size having random values.
virtual StateVector stateVectorZero () const
 Gives a vector of state vector size having zero values.
virtual bool checkStateVector (const StateVector &v) const
 Tells whether or not the vector has the dimensions of a state vector.
virtual MeasureVector measureVectorConstant (double c) const
 Gives a vector of measurement vector size having duplicated "c" value.
virtual MeasureVector measureVectorRandom () const
 Gives a vector of measurement vector size having random values.
virtual MeasureVector measureVectorZero () const
 Gives a vector of measurement vector size having zero values.
virtual bool checkMeasureVector (const MeasureVector &) const
 Tells whether or not the vector has the dimensions of a measurement vector.

Protected Types

typedef boost::circular_buffer< IndexedVector >::iterator StateIterator

Protected Member Functions

virtual StateVector oneStepEstimation_ (StateIterator it)=0
 Runs one loop of the estimator.
virtual void startNewIteration_ ()=0
const boost::circular_buffer< IndexedVector > & getStateVectorBuffer () const
bool stateIsSet () const

Protected Attributes

double dt_
 Sampling time.
boost::circular_buffer< IndexedVector > xBuffer_
 The state estimation of the observer (only one state is recorded).
IndexedVectorArray y_
 Container for the measurements.
std::shared_ptr< IndexedInputArrayInterface > u_
 Container for the inputs.
TimeIndex currentIterIndex_
std::shared_ptr< AsynchronousDataMapBase > y_asynchronous_
 Container for the asynchronous measurements.
std::shared_ptr< AsynchronousDataMapBase > u_asynchronous_
 Container for the asynchronous inputs.
Protected Attributes inherited from stateObservation::ObserverBase
Index n_
 stateSize is the size of the state vector
Index m_
 measureSize is the size of measurements vector

Additional Inherited Members

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

Detailed Description

Definition at line 77 of file delayed-measurements-observer.hpp.

Member Typedef Documentation

◆ StateIterator

typedef boost::circular_buffer<IndexedVector>::iterator stateObservation::DelayedMeasurementObserver::StateIterator
protected

Definition at line 203 of file delayed-measurements-observer.hpp.

Constructor & Destructor Documentation

◆ DelayedMeasurementObserver()

stateObservation::DelayedMeasurementObserver::DelayedMeasurementObserver ( double dt,
Index n,
Index m,
unsigned long bufferCapacity,
const std::shared_ptr< IndexedInputArrayInterface > input = nullptr,
const std::shared_ptr< AsynchronousDataMapBase > async_input = nullptr,
const std::shared_ptr< AsynchronousDataMapBase > async_meas = nullptr )

The constructor

  • n : size of the state vector
  • m : size of the measurements vector
  • dt : timestep between each iteration
  • bufferCapacity : capacity of the iteration buffer. Given in seconds, as the buffer's duration.

◆ ~DelayedMeasurementObserver()

virtual stateObservation::DelayedMeasurementObserver::~DelayedMeasurementObserver ( )
inlinevirtual

Destructor.

Definition at line 98 of file delayed-measurements-observer.hpp.

Member Function Documentation

◆ getCurrentEstimatedState()

const ObserverBase::StateVector & stateObservation::DelayedMeasurementObserver::getCurrentEstimatedState ( )

Get the Current Estimated State.

Returns
ObserverBase::StateVector

◆ initEstimator()

virtual void stateObservation::DelayedMeasurementObserver::initEstimator ( const Vector & x)
virtual

initializes the state vector.

Parameters
xThe initial state vector

◆ setState()

virtual void stateObservation::DelayedMeasurementObserver::setState ( const ObserverBase::StateVector & x_k,
TimeIndex k )
overridevirtual

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

This replaces the current state estimate and discards the stored past states: the estimation restarts from x_k.

Parameters
x_k
k

Implements stateObservation::ObserverBase.

◆ getEstimatedState()

virtual const ObserverBase::StateVector & stateObservation::DelayedMeasurementObserver::getEstimatedState ( TimeIndex k)
overridevirtual

getestimated State

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

Implements stateObservation::ObserverBase.

◆ setMeasurement()

void stateObservation::DelayedMeasurementObserver::setMeasurement ( const Vector & y,
TimeIndex k )
overridevirtual

sets the measurement

Parameters
ythe measurement vector
kthe time index

Implements stateObservation::ObserverBase.

◆ clearMeasurements()

virtual void stateObservation::DelayedMeasurementObserver::clearMeasurements ( )
overridevirtual

Remove all the given values of the measurements.

Implements stateObservation::ObserverBase.

◆ setInput()

virtual void stateObservation::DelayedMeasurementObserver::setInput ( const InputBase & u_k,
TimeIndex k )
overridevirtual

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

Implements stateObservation::ObserverBase.

◆ clearInputs()

virtual void stateObservation::DelayedMeasurementObserver::clearInputs ( )
overridevirtual

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

Implements stateObservation::ObserverBase.

◆ clearDelayedInputs()

virtual void stateObservation::DelayedMeasurementObserver::clearDelayedInputs ( )
virtual

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

◆ setCurrentState()

void stateObservation::DelayedMeasurementObserver::setCurrentState ( const ObserverBase::StateVector & x_k)

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

◆ clearStates()

virtual void stateObservation::DelayedMeasurementObserver::clearStates ( )
overridevirtual

Removes the state estimation.

inherited from ObserverBase

Implements stateObservation::ObserverBase.

◆ setStateCapacity()

virtual void stateObservation::DelayedMeasurementObserver::setStateCapacity ( unsigned long stateCapacity)
inlinevirtual

set the sampling time of the measurements

Definition at line 182 of file delayed-measurements-observer.hpp.

◆ setSamplingTime()

void stateObservation::DelayedMeasurementObserver::setSamplingTime ( const double dt)
inline

set the sampling time of the measurements

Definition at line 188 of file delayed-measurements-observer.hpp.

◆ getSamplingTime()

double stateObservation::DelayedMeasurementObserver::getSamplingTime ( )
inline

Definition at line 192 of file delayed-measurements-observer.hpp.

◆ oneStepEstimation_()

virtual StateVector stateObservation::DelayedMeasurementObserver::oneStepEstimation_ ( StateIterator it)
protectedpure virtual

Runs one loop of the estimator.

Parameters
itIterator that points to the updated state. Points to x_{k} = f(x_{k-1}, u_{k-1})

Implemented in stateObservation::DelayedMeasurementComplemFilter.

◆ getStateVectorBuffer()

const boost::circular_buffer< IndexedVector > & stateObservation::DelayedMeasurementObserver::getStateVectorBuffer ( ) const
inlineprotected

Definition at line 210 of file delayed-measurements-observer.hpp.

Member Data Documentation

◆ dt_

double stateObservation::DelayedMeasurementObserver::dt_
protected

Sampling time.

Definition at line 219 of file delayed-measurements-observer.hpp.

◆ xBuffer_

boost::circular_buffer<IndexedVector> stateObservation::DelayedMeasurementObserver::xBuffer_
protected

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

Definition at line 221 of file delayed-measurements-observer.hpp.

◆ y_

IndexedVectorArray stateObservation::DelayedMeasurementObserver::y_
protected

Container for the measurements.

Definition at line 223 of file delayed-measurements-observer.hpp.

◆ u_

std::shared_ptr<IndexedInputArrayInterface> stateObservation::DelayedMeasurementObserver::u_
protected

Container for the inputs.

Definition at line 225 of file delayed-measurements-observer.hpp.

◆ currentIterIndex_

TimeIndex stateObservation::DelayedMeasurementObserver::currentIterIndex_
protected

Definition at line 229 of file delayed-measurements-observer.hpp.

◆ y_asynchronous_

std::shared_ptr<AsynchronousDataMapBase> stateObservation::DelayedMeasurementObserver::y_asynchronous_
protected

Container for the asynchronous measurements.

Definition at line 231 of file delayed-measurements-observer.hpp.

◆ u_asynchronous_

std::shared_ptr<AsynchronousDataMapBase> stateObservation::DelayedMeasurementObserver::u_asynchronous_
protected

Container for the asynchronous inputs.

Definition at line 233 of file delayed-measurements-observer.hpp.


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