Standard environment for control tasks. More...
#include <environment.h>
Public Types | |
using | Ptr = std::shared_ptr< Environment > |
Public Member Functions | |
Environment () | |
Default constructor. More... | |
Environment (ControllerInterface::Ptr controller, ObserverInterface::Ptr observer, PlantInterface::Ptr plant) | |
Construct environment with a controller, observer and plant. More... | |
const ControllerInterface::Ptr & | getController () const |
Read access to the underlying controller. More... | |
ControllerInterface::Ptr | getControllerPtr () |
Write access to the underlying controller. More... | |
const ObserverInterface::Ptr & | getObserver () const |
Read access to the underlying observer. More... | |
ObserverInterface::Ptr | getObserverPtr () |
Write access to the underlying observer. More... | |
const PlantInterface::Ptr & | getPlant () const |
Read access to the underlying plant. More... | |
PlantInterface::Ptr | getPlantPtr () |
Write access to the underlying plant. More... | |
bool | hasController () const |
Check if a controller has been specified. More... | |
bool | hasObserver () const |
Check if an observer has been specified. More... | |
bool | hasPlant () const |
Check if a plant has been specified. More... | |
void | reset () |
Reset environment. More... | |
void | setController (ControllerInterface::Ptr controller) |
Set controller. More... | |
void | setObserver (ObserverInterface::Ptr observer) |
Set observer. More... | |
void | setPlant (PlantInterface::Ptr plant) |
Set plant. More... | |
bool | verify (std::string *msg=nullptr) const |
Check if the environment satisfies all requirements (dimensions, ...) More... | |
Private Attributes | |
ControllerInterface::Ptr | _controller |
ObserverInterface::Ptr | _observer |
PlantInterface::Ptr | _plant |
Standard environment for control tasks.
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.
Definition at line 71 of file environment.h.
using corbo::Environment::Ptr = std::shared_ptr<Environment> |
Definition at line 96 of file environment.h.
|
inline |
Default constructor.
Definition at line 99 of file environment.h.
corbo::Environment::Environment | ( | ControllerInterface::Ptr | controller, |
ObserverInterface::Ptr | observer, | ||
PlantInterface::Ptr | plant | ||
) |
Construct environment with a controller, observer and plant.
Definition at line 55 of file environment.cpp.
|
inline |
Read access to the underlying controller.
Definition at line 111 of file environment.h.
|
inline |
Write access to the underlying controller.
Definition at line 113 of file environment.h.
|
inline |
Read access to the underlying observer.
Definition at line 115 of file environment.h.
|
inline |
Write access to the underlying observer.
Definition at line 117 of file environment.h.
|
inline |
Read access to the underlying plant.
Definition at line 119 of file environment.h.
|
inline |
Write access to the underlying plant.
Definition at line 121 of file environment.h.
|
inline |
Check if a controller has been specified.
Definition at line 104 of file environment.h.
|
inline |
Check if an observer has been specified.
Definition at line 106 of file environment.h.
|
inline |
Check if a plant has been specified.
Definition at line 108 of file environment.h.
void corbo::Environment::reset | ( | ) |
Reset environment.
Definition at line 178 of file environment.cpp.
void corbo::Environment::setController | ( | ControllerInterface::Ptr | controller | ) |
Set controller.
Definition at line 62 of file environment.cpp.
void corbo::Environment::setObserver | ( | ObserverInterface::Ptr | observer | ) |
Set observer.
Definition at line 64 of file environment.cpp.
void corbo::Environment::setPlant | ( | PlantInterface::Ptr | plant | ) |
Set plant.
Definition at line 66 of file environment.cpp.
bool corbo::Environment::verify | ( | std::string * | msg = nullptr | ) | const |
Check if the environment satisfies all requirements (dimensions, ...)
This function can be called in order to check if all components and models are specified and if all input and output dimensions are chosen adequately.
[out] | msg | The string contains issue messages and hints if available [optional] |
Definition at line 68 of file environment.cpp.
|
private |
Definition at line 145 of file environment.h.
|
private |
Definition at line 146 of file environment.h.
|
private |
Definition at line 147 of file environment.h.