Interface class for plants. More...
#include <plant_interface.h>
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... | |
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.
Definition at line 76 of file plant_interface.h.
using corbo::PlantInterface::ControlVector = Eigen::VectorXd |
Definition at line 102 of file plant_interface.h.
using corbo::PlantInterface::OutputVector = Eigen::VectorXd |
Definition at line 104 of file plant_interface.h.
using corbo::PlantInterface::Ptr = std::shared_ptr<PlantInterface> |
Definition at line 101 of file plant_interface.h.
using corbo::PlantInterface::StateVector = Eigen::VectorXd |
Definition at line 103 of file plant_interface.h.
|
inlinevirtual |
Virtual destructor.
Definition at line 107 of file plant_interface.h.
|
virtual |
Send commands to plant.
[in] | u | Control command that is commanded to the plant [getInputDimension() x 1] |
[in] | dt | Specify the intended duration for the signal (usually only relevant for simulation) |
[in] | t | Current time stamp (can be sim-time or system-time, but compatible to state and control references) |
[in,out] | signal_target | Target for occuring signals [optional] |
Definition at line 51 of file plant_interface.cpp.
|
pure virtual |
Send commands to plant.
[in] | u_sequence | Sequence of controls that are commanded to the plant |
[in] | x_sequence | Sequence of states that are commanded to the plant |
[in] | dt | Specify the intended duration for the signal (usually only relevant for simulation) |
[in] | t | Current time stamp (can be sim-time or system-time, but compatible to state and control references) |
[in,out] | signal_target | Target for occuring signals [optional] |
Implemented in corbo::SimulatedPlant, and corbo::SimulatedPlantThreaded.
|
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).
[in,out] | signal_target | Target for occuring signals [optional] |
Reimplemented in corbo::SimulatedPlant.
Definition at line 179 of file plant_interface.h.
|
inlinestatic |
Get access to the associated factory.
Definition at line 113 of file plant_interface.h.
|
pure virtual |
Return the plant input dimension (u)
Implemented in corbo::SimulatedPlant.
|
pure virtual |
Return a newly created shared instance of the implemented class.
Implemented in corbo::SimulatedPlant, and corbo::SimulatedPlantThreaded.
|
pure virtual |
Return the plant output dimension (y)
Implemented in corbo::SimulatedPlant.
|
inlinevirtual |
Initialize plant.
Reimplemented in corbo::SimulatedPlantThreaded.
Definition at line 125 of file plant_interface.h.
|
pure virtual |
Retrieve current plant output (measurements)
[out] | output | Plant output will be written to this vector [getOutputDimension() x 1] |
[in] | t | Current time stamp (can be sim-time or system-time, but compatible to state and control references) |
[in,out] | signal_target | Target for occuring signals [optional] |
Implemented in corbo::SimulatedPlant, and corbo::SimulatedPlantThreaded.
|
pure virtual |
Implemented in corbo::SimulatedPlant.
|
pure virtual |
Implemented in corbo::SimulatedPlant.
|
inlinevirtual |
Reimplemented in corbo::SimulatedPlant, and corbo::SimulatedPlantThreaded.
Definition at line 130 of file plant_interface.h.
|
inlinevirtual |
Set/move plant to a desired state (if possible)
[in] | Desired | state vector |
Reimplemented in corbo::SimulatedPlant, and corbo::SimulatedPlantThreaded.
Definition at line 186 of file plant_interface.h.
|
inlinevirtual |
Stop plant (you might probably use this to set the plant into a safe setpoint)
Reimplemented in corbo::SimulatedPlantThreaded.
Definition at line 128 of file plant_interface.h.