Public Types | Public Member Functions | Static Public Member Functions | List of all members
corbo::PlantInterface Class Referenceabstract

Interface class for plants. More...

#include <plant_interface.h>

Inheritance diagram for corbo::PlantInterface:
Inheritance graph
[legend]

Public Types

using ControlVector = Eigen::VectorXd
 
using OutputVector = Eigen::VectorXd
 
using Ptr = std::shared_ptr< PlantInterface >
 
using StateVector = Eigen::VectorXd
 

Public Member Functions

virtual bool control (const ControlVector &u, const Duration &dt, const Time &t, SignalTargetInterface *signal_target=nullptr, const std::string &ns="")
 Send commands to plant. More...
 
virtual bool control (const TimeSeries::ConstPtr &u_sequence, const TimeSeries::ConstPtr &x_sequence, const Duration &dt, const Time &t, SignalTargetInterface *signal_target=nullptr, const std::string &ns="")=0
 Send commands to plant. More...
 
virtual void getAvailableSignals (SignalTargetInterface &signal_target, const std::string &ns="") const
 Retrieve available signals from the plant. More...
 
virtual int getInputDimension () const =0
 Return the plant input dimension (u) More...
 
virtual Ptr getInstance () const =0
 Return a newly created shared instance of the implemented class. More...
 
virtual int getOutputDimension () const =0
 Return the plant output dimension (y) More...
 
virtual bool initialize ()
 Initialize plant. More...
 
virtual bool output (OutputVector &output, const Time &t, SignalTargetInterface *signal_target=nullptr, const std::string &ns="")=0
 Retrieve current plant output (measurements) More...
 
virtual bool requiresFutureControls () const =0
 
virtual bool requiresFutureStates () const =0
 
virtual void reset ()
 
virtual bool setState (const Eigen::Ref< const Eigen::VectorXd > &state)
 Set/move plant to a desired state (if possible) More...
 
virtual void stop ()
 Stop plant (you might probably use this to set the plant into a safe setpoint) More...
 
virtual ~PlantInterface ()
 Virtual destructor. More...
 

Static Public Member Functions

static Factory< PlantInterface > & getFactory ()
 Get access to the associated factory. More...
 

Detailed Description

Interface class for plants.

This class specifies methods that are required to be implemented by specific plants in order to allow their general utilization in a variety of control tasks.

Remarks
This interface is provided with factory support (PlantFactoryPlantFactory).
See also
SimulatedPlant
Author
Christoph Rösmann (chris.nosp@m.toph.nosp@m..roes.nosp@m.mann.nosp@m.@tu-d.nosp@m.ortm.nosp@m.und.d.nosp@m.e)

Definition at line 54 of file plant_interface.h.

Member Typedef Documentation

◆ ControlVector

using corbo::PlantInterface::ControlVector = Eigen::VectorXd

Definition at line 58 of file plant_interface.h.

◆ OutputVector

using corbo::PlantInterface::OutputVector = Eigen::VectorXd

Definition at line 60 of file plant_interface.h.

◆ Ptr

using corbo::PlantInterface::Ptr = std::shared_ptr<PlantInterface>

Definition at line 57 of file plant_interface.h.

◆ StateVector

using corbo::PlantInterface::StateVector = Eigen::VectorXd

Definition at line 59 of file plant_interface.h.

Constructor & Destructor Documentation

◆ ~PlantInterface()

virtual corbo::PlantInterface::~PlantInterface ( )
inlinevirtual

Virtual destructor.

Definition at line 63 of file plant_interface.h.

Member Function Documentation

◆ control() [1/2]

bool corbo::PlantInterface::control ( const ControlVector u,
const Duration dt,
const Time t,
SignalTargetInterface signal_target = nullptr,
const std::string &  ns = "" 
)
virtual

Send commands to plant.

Parameters
[in]uControl command that is commanded to the plant [getInputDimension() x 1]
[in]dtSpecify the intended duration for the signal (usually only relevant for simulation)
[in]tCurrent time stamp (can be sim-time or system-time, but compatible to state and control references)
[in,out]signal_targetTarget for occuring signals [optional]
Returns
true if transmission of commands was successful, otherwise false.

Definition at line 29 of file plant_interface.cpp.

◆ control() [2/2]

virtual bool corbo::PlantInterface::control ( const TimeSeries::ConstPtr u_sequence,
const TimeSeries::ConstPtr x_sequence,
const Duration dt,
const Time t,
SignalTargetInterface signal_target = nullptr,
const std::string &  ns = "" 
)
pure virtual

Send commands to plant.

Parameters
[in]u_sequenceSequence of controls that are commanded to the plant
[in]x_sequenceSequence of states that are commanded to the plant
[in]dtSpecify the intended duration for the signal (usually only relevant for simulation)
[in]tCurrent time stamp (can be sim-time or system-time, but compatible to state and control references)
[in,out]signal_targetTarget for occuring signals [optional]
Returns
true if transmission of commands was successful, otherwise false.

Implemented in corbo::SimulatedPlant, and corbo::SimulatedPlantThreaded.

◆ getAvailableSignals()

virtual void corbo::PlantInterface::getAvailableSignals ( SignalTargetInterface signal_target,
const std::string &  ns = "" 
) const
inlinevirtual

Retrieve available signals from the plant.

Register a-priori known signals at the signal target. Registration is optional. Note, during control() or output() execution further signals might occur without registration (in case the they are not known in advance or the implementation lacks a proper registration).

Parameters
[in,out]signal_targetTarget for occuring signals [optional]

Reimplemented in corbo::SimulatedPlant.

Definition at line 135 of file plant_interface.h.

◆ getFactory()

static Factory<PlantInterface>& corbo::PlantInterface::getFactory ( )
inlinestatic

Get access to the associated factory.

Definition at line 69 of file plant_interface.h.

◆ getInputDimension()

virtual int corbo::PlantInterface::getInputDimension ( ) const
pure virtual

Return the plant input dimension (u)

Implemented in corbo::SimulatedPlant.

◆ getInstance()

virtual Ptr corbo::PlantInterface::getInstance ( ) const
pure virtual

Return a newly created shared instance of the implemented class.

Implemented in corbo::SimulatedPlant, and corbo::SimulatedPlantThreaded.

◆ getOutputDimension()

virtual int corbo::PlantInterface::getOutputDimension ( ) const
pure virtual

Return the plant output dimension (y)

Implemented in corbo::SimulatedPlant.

◆ initialize()

virtual bool corbo::PlantInterface::initialize ( )
inlinevirtual

Initialize plant.

Reimplemented in corbo::SimulatedPlantThreaded.

Definition at line 81 of file plant_interface.h.

◆ output()

virtual bool corbo::PlantInterface::output ( OutputVector output,
const Time t,
SignalTargetInterface signal_target = nullptr,
const std::string &  ns = "" 
)
pure virtual

Retrieve current plant output (measurements)

Parameters
[out]outputPlant output will be written to this vector [getOutputDimension() x 1]
[in]tCurrent time stamp (can be sim-time or system-time, but compatible to state and control references)
[in,out]signal_targetTarget for occuring signals [optional]
Returns
true if receiving of measurements was successful, otherwise false.

Implemented in corbo::SimulatedPlant, and corbo::SimulatedPlantThreaded.

◆ requiresFutureControls()

virtual bool corbo::PlantInterface::requiresFutureControls ( ) const
pure virtual

Implemented in corbo::SimulatedPlant.

◆ requiresFutureStates()

virtual bool corbo::PlantInterface::requiresFutureStates ( ) const
pure virtual

Implemented in corbo::SimulatedPlant.

◆ reset()

virtual void corbo::PlantInterface::reset ( )
inlinevirtual

Reimplemented in corbo::SimulatedPlant, and corbo::SimulatedPlantThreaded.

Definition at line 86 of file plant_interface.h.

◆ setState()

virtual bool corbo::PlantInterface::setState ( const Eigen::Ref< const Eigen::VectorXd > &  state)
inlinevirtual

Set/move plant to a desired state (if possible)

Parameters
[in]Desiredstate vector
Returns
true if successful, false otherwise

Reimplemented in corbo::SimulatedPlant, and corbo::SimulatedPlantThreaded.

Definition at line 142 of file plant_interface.h.

◆ stop()

virtual void corbo::PlantInterface::stop ( )
inlinevirtual

Stop plant (you might probably use this to set the plant into a safe setpoint)

Reimplemented in corbo::SimulatedPlantThreaded.

Definition at line 84 of file plant_interface.h.


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


control_box_rst
Author(s): Christoph Rösmann
autogenerated on Mon Feb 28 2022 22:08:03