File control/src/Observer/Observer.hpp

Go to the source code of this file

General interface to define an Observer.

class Observer
#include <Observer.hpp>

Observers Base Class.

Abstract class, interface to user-defined observers.

An Observer is dedicated to estimate the state of a DynamicalSystem given its dynamics, inputs and a initial estimate of the state.

Subclassed by LuenbergerObserver, SlidingReducedOrderObserver

Public Functions

Observer(unsigned int type, SP::ControlSensor sensor, const SiconosVector &xHat0, const std::string &newId = "none")

Constructor with a TimeDiscretisation.

Parameters
  • type: the type of the Observer, which corresponds to the class type
  • sensor: the SP::Sensor to get the measurements
  • xHat0: the initial guess for the state
  • newId: the id of the Observer

Observer(unsigned int type, SP::ControlSensor sensor, const SiconosVector &xHat0, SP::DynamicalSystem ds, const std::string &newId = "none")

Constructor with a TimeDiscretisation.

Parameters
  • type: the type of the Observer, which corresponds to the class type.
  • sensor: the SP::Sensor to get the measurements
  • xHat0: the initial guess for the state
  • ds: the SP::DynamicalSystem used as a model for the real DynamicalSystem
  • newId: the id of the Observer

virtual ~Observer()

destructor

void display() const

display the data of the Observer on the standard output

SP::SiconosVector e()

get the error e

Return
a pointer to e

const std::string getId() const

get id of the Observer

Return
a string

virtual SP::NonSmoothDynamicalSystem getInternalNSDS() const

get the Model used in the Observer

Return
The Model used in the Observer

int getType() const

get the type of the Observer (ie class name)

Return
an integer

virtual void initialize(const NonSmoothDynamicalSystem &nsds, const Simulation &s)

initialize observer data.

Parameters
  • nsds: current nonsmooth dynamical system
  • s: current simulation setup

virtual void process() = 0

capture data when the ObserverEvent is processed

void setDS(SP::DynamicalSystem ds)

Set the DynamicalSystem used in the Observer.

Parameters
  • ds: the DynamicalSystem used in the Observer

void setId(const std::string &newId)

set id of the Observer

Parameters
  • newId: the new id.

virtual void setTimeDiscretisation(const TimeDiscretisation &td)

This is derived in child classes if they need to copy the TimeDiscretisation associated with this Sensor.

Parameters
  • td: the TimeDiscretisation for this Sensor

SP::SiconosVector xHat()

get the estimated state

Return
a pointer to xHat

Protected Functions

Observer()

default constructor

ACCEPT_SERIALIZATION(Observer)

serialization hooks

Protected Attributes

SP::DynamicalSystem _DS

the DynamicalSystem used in the Observer

SP::SiconosVector _e

The error \(e=\hat{y}-y\).

std::string _id

id of the Observer

SP::OneStepIntegrator _integrator

Integration for integration.

SP::NonSmoothDynamicalSystem _nsds

Model for integration.

Model for integration

SP::ControlSensor _sensor

the sensor that feed the observer

SP::TimeStepping _simulation

Simulation for integration.

SP::TimeDiscretisation _td

The TimeDiscretisation.

int _type

type of the Observer

SP::SiconosVector _xHat

estimated state

SP::SiconosVector _y

The measurements from the sensor.