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 49 of file environment.h.
using corbo::Environment::Ptr = std::shared_ptr<Environment> |
Definition at line 52 of file environment.h.
|
inline |
Default constructor.
Definition at line 55 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 33 of file environment.cpp.
|
inline |
Read access to the underlying controller.
Definition at line 67 of file environment.h.
|
inline |
Write access to the underlying controller.
Definition at line 69 of file environment.h.
|
inline |
Read access to the underlying observer.
Definition at line 71 of file environment.h.
|
inline |
Write access to the underlying observer.
Definition at line 73 of file environment.h.
|
inline |
Read access to the underlying plant.
Definition at line 75 of file environment.h.
|
inline |
Write access to the underlying plant.
Definition at line 77 of file environment.h.
|
inline |
Check if a controller has been specified.
Definition at line 60 of file environment.h.
|
inline |
Check if an observer has been specified.
Definition at line 62 of file environment.h.
|
inline |
Check if a plant has been specified.
Definition at line 64 of file environment.h.
void corbo::Environment::reset | ( | ) |
Reset environment.
Definition at line 156 of file environment.cpp.
void corbo::Environment::setController | ( | ControllerInterface::Ptr | controller | ) |
Set controller.
Definition at line 40 of file environment.cpp.
void corbo::Environment::setObserver | ( | ObserverInterface::Ptr | observer | ) |
Set observer.
Definition at line 42 of file environment.cpp.
void corbo::Environment::setPlant | ( | PlantInterface::Ptr | plant | ) |
Set plant.
Definition at line 44 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 46 of file environment.cpp.
|
private |
Definition at line 101 of file environment.h.
|
private |
Definition at line 102 of file environment.h.
|
private |
Definition at line 103 of file environment.h.