|
The ControlDevice class represents a logical unit accepting commands via its JointControllers. More...
#include <RobotAPI/components/units/RobotUnit/Devices/ControlDevice.h>
Public Member Functions | |
ControlDevice (const std::string &name) | |
Create a ControlDevice with the given name. More... | |
const std::vector< std::string > & | getControlModes () const |
JointController * | getJointController (const std::string &mode) |
const JointController * | getJointController (const std::string &mode) const |
JointController * | getJointController (std::size_t i) |
const JointController * | getJointController (std::size_t i) const |
std::vector< const JointController * > | getJointControllers () const |
std::map< std::string, std::string > | getJointControllerToTargetTypeNameMap () const |
JointController * | getJointEmergencyStopController () |
JointController * | getJointStopMovementController () |
RobotUnitModule::Devices * | getOwner () const |
bool | hasJointController (const std::string &mode) const |
JointController * | rtGetActiveJointController () |
const std::vector< JointController * > & | rtGetJointControllers () |
JointController * | rtGetJointEmergencyStopController () |
JointController * | rtGetJointStopMovementController () |
void | rtRun (const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration) |
runs the active Joint Controller and write the target values into the control device More... | |
virtual void | rtSetActiveJointController (JointController *jointCtrl) |
Activates the given JointController for this device. More... | |
virtual void | rtWriteTargetValues (const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration) |
This is a hook for implementations to write the setpoints to a bus. More... | |
Public Member Functions inherited from DeviceBase | |
DeviceBase (const std::string &name) | |
Create a Device with the given name. More... | |
const std::string & | getDeviceName () const |
const std::set< std::string > & | getTags () const |
virtual bool | hasError () |
bool | hasTag (const std::string &tag) const |
const char * | rtGetDeviceName () const |
virtual | ~DeviceBase ()=default |
Static Public Attributes | |
static const ControlDevicePtr | NullPtr {nullptr} |
A static const nullptr in case a const ref to a nullptr needs to be returned. More... | |
Protected Member Functions | |
void | addJointController (JointController *jointCtrl) |
adds the Joint controller to this ControlDevice More... | |
ControlTargetBase::ControlDeviceAccessToken | getControlTargetAccessToken () const |
Protected Member Functions inherited from DeviceBase | |
void | addDeviceTag (const std::string &tag) |
adds the given tag to the Device More... | |
Friends | |
class | RobotUnitModule::Devices |
The ControlDevice class represents a logical unit accepting commands via its JointControllers.
It holds a set of JointControllers with different Controll modes. It always has a JointController with mode ControlModes::EmergencyStop which is used in case of an error. It always has a JointController with mode ControlModes::StopMovement which is used when the controled device should stop any movement.
It holds a set of tags. These tags are used by different components to create default controllers, check for abilities or present output to the user.
Definition at line 63 of file ControlDevice.h.
|
inline |
Create a ControlDevice with the given name.
Definition at line 70 of file ControlDevice.h.
|
protected |
adds the Joint controller to this ControlDevice
std::logic_error | if the JointController was already added to a ControlDevice |
std::invalid_argument | if a JointController with the same control mode was already added to this device |
Definition at line 93 of file ControlDevice.cpp.
|
inline |
Definition at line 217 of file ControlDevice.h.
|
inlineprotected |
Definition at line 133 of file ControlDevice.h.
|
inline |
Definition at line 187 of file ControlDevice.h.
|
inline |
Definition at line 193 of file ControlDevice.h.
|
inline |
Definition at line 199 of file ControlDevice.h.
|
inline |
Definition at line 205 of file ControlDevice.h.
|
inline |
Definition at line 181 of file ControlDevice.h.
std::map< std::string, std::string > getJointControllerToTargetTypeNameMap | ( | ) | const |
Definition at line 157 of file ControlDevice.cpp.
JointController * getJointEmergencyStopController | ( | ) |
Definition at line 32 of file ControlDevice.cpp.
JointController * getJointStopMovementController | ( | ) |
Definition at line 44 of file ControlDevice.cpp.
RobotUnitModule::Devices * getOwner | ( | ) | const |
Definition at line 151 of file ControlDevice.cpp.
|
inline |
Definition at line 211 of file ControlDevice.h.
|
inline |
Definition at line 169 of file ControlDevice.h.
|
inline |
Definition at line 175 of file ControlDevice.h.
|
inline |
Definition at line 157 of file ControlDevice.h.
|
inline |
Definition at line 163 of file ControlDevice.h.
void rtRun | ( | const IceUtil::Time & | sensorValuesTimestamp, |
const IceUtil::Time & | timeSinceLastIteration | ||
) |
runs the active Joint Controller and write the target values into the control device
sensorValuesTimestamp | |
timeSinceLastIteration |
Definition at line 83 of file ControlDevice.cpp.
|
virtual |
Activates the given JointController for this device.
std::logic_error | if the Joint controller does not belong to this ControlDevice |
Reimplemented in JointSimulationDevice.
Definition at line 56 of file ControlDevice.cpp.
|
inlinevirtual |
This is a hook for implementations to write the setpoints to a bus.
sensorValuesTimestamp | The timestamp of the current SensorValues |
timeSinceLastIteration | The time delta between the last two updates of SensorValues |
Definition at line 115 of file ControlDevice.h.
|
friend |
Definition at line 139 of file ControlDevice.h.
|
static |
A static const nullptr in case a const ref to a nullptr needs to be returned.
Definition at line 67 of file ControlDevice.h.