Interface class for tasks. More...
#include <task_interface.h>
Public Types | |
using | Ptr = std::shared_ptr< TaskInterface > |
Public Member Functions | |
virtual void | getAvailableSignals (const Environment &environment, SignalTargetInterface &signal_target, const std::string &ns="") const |
Retrieve available signals from the task. More... | |
virtual Ptr | getInstance () const =0 |
Return a newly created shared instance of the implemented class. More... | |
virtual void | performTask (Environment &environment, SignalTargetInterface *signal_target=nullptr, std::string *msg=nullptr, const std::string &ns="")=0 |
Perform task. More... | |
virtual void | reset ()=0 |
Reset task state. More... | |
virtual bool | verify (const Environment &environment, std::string *msg=nullptr) const =0 |
Check if the environment and other settings satisfy all requirements for the given task. More... | |
virtual | ~TaskInterface () |
Virtuel destructor. More... | |
Interface class for tasks.
Possible task implementations can be the closed-loop control of a plant, open-loop control, benchmarking, ...
Usually, tasks are called with an Environment to facilitate the initialization and verification of commonly used control architectures. An Environment contains a plant, observer and controller. But a particular task does not need to rely on an Environment only but can contain more objects or replace objects (e.g. multiple controllers, ...).
Definition at line 60 of file task_interface.h.
using corbo::TaskInterface::Ptr = std::shared_ptr<TaskInterface> |
Definition at line 63 of file task_interface.h.
|
inlinevirtual |
Virtuel destructor.
Definition at line 66 of file task_interface.h.
|
inlinevirtual |
Retrieve available signals from the task.
Register a-priori known signals at the signal target. Registration is optional. Note, during performTask() 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::ClosedLoopControlTask, corbo::OpenLoopControlTask, corbo::BenchmarkTaskIncreasingHorizonOpenLoop, and corbo::BenchmarkTaskVaryingInitialState.
Definition at line 103 of file task_interface.h.
|
pure virtual |
Return a newly created shared instance of the implemented class.
Implemented in corbo::ClosedLoopControlTask, corbo::OpenLoopControlTask, corbo::BenchmarkTaskIncreasingHorizonOpenLoop, and corbo::BenchmarkTaskVaryingInitialState.
|
pure virtual |
Perform task.
[in] | environment | Standard environment (plant, controller, observer) |
[in,out] | signal_target | Target for occuring signals [optional] |
Implemented in corbo::ClosedLoopControlTask, corbo::OpenLoopControlTask, corbo::BenchmarkTaskIncreasingHorizonOpenLoop, and corbo::BenchmarkTaskVaryingInitialState.
|
pure virtual |
Reset task state.
Implemented in corbo::ClosedLoopControlTask, corbo::OpenLoopControlTask, corbo::BenchmarkTaskIncreasingHorizonOpenLoop, and corbo::BenchmarkTaskVaryingInitialState.
|
pure virtual |
Check if the environment and other settings satisfy all requirements for the given task.
This function can be called in order to check if all components and models are appropriate, e.g. if all input and output dimensions are chosen adequately.
Note, Environment::verify() might be invoked in order to check if controller, plant and observer are specified correctly and if they have matching dimensions.
[in] | environment | Standard environment (plant, controller, observer) |
[out] | msg | The string contains issue messages and hints if available [optional] |
Implemented in corbo::ClosedLoopControlTask, corbo::OpenLoopControlTask, corbo::BenchmarkTaskIncreasingHorizonOpenLoop, and corbo::BenchmarkTaskVaryingInitialState.