File control/src/Sensor/LinearSensor.hpp

Go to the source code of this file

A generic linear sensor, to capture the output y defined as y = Cx + Du.

class LinearSensor : public ControlSensor
#include <LinearSensor.hpp>

Common linear Sensor to get output of the system.

A generic linear sensor, to capture the output y defined as y = Cx + Du

Public Functions

LinearSensor(SP::DynamicalSystem ds)

Constructor for the SensorFactory.

Parameters
  • ds: the SP::DynamicalSystem it observes

LinearSensor(SP::DynamicalSystem ds, SP::SimpleMatrix C, SP::SimpleMatrix D = SP::SimpleMatrix())

Constructor with the full set of data.

Parameters
  • ds: the SP::DynamicalSystem it observes.
  • C: a SP::SiconosMatrix.
  • D: a SP::SiconosMatrix (optional).

virtual ~LinearSensor()

Destructor.

void capture()

capture data when the SensorEvent is processed ( for example set data[SensorEvent]=…

)

virtual void initialize(const NonSmoothDynamicalSystem &nsds)

initialize sensor data

Parameters
  • nsds: current nonsmooth dynamical system

void setC(const SimpleMatrix &C)

Set the C matrix.

Parameters
  • C: a SimpleMatrix

void setCPtr(SP::SimpleMatrix C)

Set the C matrix.

Parameters
  • C: a SP::SimpleMatrix

void setD(const SimpleMatrix &D)

Set the D matrix.

Parameters
  • D: a SimpleMatrix

void setDPtr(SP::SimpleMatrix D)

Set the D matrix.

Parameters
  • D: a SP::SimpleMatrix

Private Functions

LinearSensor()

Default constructor.

ACCEPT_SERIALIZATION(LinearSensor)

serialization hooks

Private Members

SP::SiconosMatrix _data

A matrix for output.

SP::SimpleMatrix _dataPlot

A matrix for saving all values.

unsigned int _k

counter

SP::SimpleMatrix _matC

Canonical matrices.

SP::SimpleMatrix _matD
unsigned int _nSteps

Number of time steps.