Go to the documentation of this file.
26 #include <RobotAPI/interface/units/RobotUnit/RobotUnitInterface.h>
28 #include "../Units/RobotUnitSubUnit.h"
38 defineOptionalProperty<std::string>(
39 "KinematicUnitName",
"KinematicUnit",
"The name of the created kinematic unit");
40 defineOptionalProperty<std::string>(
41 "KinematicUnitNameTopicPrefix",
"",
"Prefix for the kinematic sensor values topic");
44 defineOptionalProperty<std::string>(
45 "PlatformUnitName",
"PlatformUnit",
"The name of the created platform unit");
47 auto& types = defineOptionalProperty<NJointHolonomicPlatformVelocityControllerTypes>(
48 "PlatformUnitVelocityControllerType",
50 "Which controller to use for velocity control of the platform");
51 for (
const auto& [type, name] :
54 types.map(name, type);
57 defineOptionalProperty<float>(
58 "PlatformUnitMaximumPositionAcceleration",
60 "The maximum allowed acceleration for the position of the platform");
61 defineOptionalProperty<float>(
62 "PlatformUnitMaximumOrientationAcceleration",
64 "The maximum allowed acceleration for the orientation of the platform");
66 defineOptionalProperty<std::string>(
67 "ForceTorqueUnitName",
69 "The name of the created force troque unit (empty = default)");
70 defineOptionalProperty<std::string>(
71 "ForceTorqueTopicName",
73 "Name of the topic on which the force torque sensor values are provided");
75 defineOptionalProperty<std::string>(
76 "InertialMeasurementUnitName",
77 "InertialMeasurementUnit",
78 "The name of the created inertial measurement unit (empty = default)");
79 defineOptionalProperty<std::string>(
80 "IMUTopicName",
"IMUValues",
"Name of the IMU Topic.");
82 defineOptionalProperty<bool>(
"CreateTCPControlUnit",
84 "If true the TCPControl SubUnit is created and added");
85 defineOptionalProperty<std::string>(
86 "TCPControlUnitName",
"TCPControlUnit",
"Name of the TCPControlUnit.");
88 defineOptionalProperty<bool>(
89 "CreateTrajectoryPlayer",
91 "If true the TrajectoryPlayer SubUnit is created and added");
92 defineOptionalProperty<std::string>(
93 "TrajectoryControllerUnitName",
95 "Name of the TrajectoryControllerUnit. The respective component outside of the "
96 "RobotUnit is TrajectoryPlayer");
98 defineOptionalProperty<std::string>(
99 "EmergencyStopMasterName",
100 "EmergencyStopMaster",
101 "The name used to register as an EmergencyStopMaster");
102 defineOptionalProperty<std::string>(
103 "EmergencyStopTopic",
105 "The name of the topic over which changes of the emergencyStopState are sent.");
138 void _preOnInitRobotUnit();
140 void _icePropertiesInitialized();
142 void _preFinishRunning();
144 void _postOnExitRobotUnit();
153 Ice::ObjectProxySeq
getUnits(
const Ice::Current&)
const override;
159 Ice::ObjectPrx
getUnit(
const std::string& staticIceId,
const Ice::Current&)
const override;
165 KinematicUnitInterfacePrx
getKinematicUnit(
const Ice::Current&)
const override;
175 InertialMeasurementUnitInterfacePrx
181 PlatformUnitInterfacePrx
getPlatformUnit(
const Ice::Current&)
const override;
186 TCPControlUnitInterfacePrx
getTCPControlUnit(
const Ice::Current&)
const override;
209 typename T::PointerType
getUnit()
const;
286 const std::string& positionControlMode = ControlModes::Position1DoF,
287 const std::string& velocityControlMode = ControlModes::Velocity1DoF,
288 const std::string& torqueControlMode = ControlModes::Torque1DoF,
289 const std::string& pwmControlMode = ControlModes::PWM1DoF);
301 std::vector<ManagedIceObjectPtr> units;
304 std::vector<RobotUnitSubUnitPtr> subUnits;
307 EmergencyStopMasterInterfacePtr emergencyStopMaster;
virtual void initializePlatformUnit()
Initializes the PlatformUnit.
virtual void initializeDefaultUnits()
Calls all init hooks for all managed Units.
virtual void initializeForceTorqueUnit()
Initializes the ForceTorqueUnit.
void addUnit(ManagedIceObjectPtr unit)
Registers a unit for management (the Unit is added and removed to the ArmarXManager and updated with ...
This Module manages all Units of a RobotUnit.
const simox::meta::EnumNames< NJointHolonomicPlatformVelocityControllerTypes > NJointHolonomicPlatformVelocityControllerTypesNames
ManagedIceObjectPtr createKinematicSubUnit(const Ice::PropertiesPtr &properties, const std::string &positionControlMode=ControlModes::Position1DoF, const std::string &velocityControlMode=ControlModes::Velocity1DoF, const std::string &torqueControlMode=ControlModes::Torque1DoF, const std::string &pwmControlMode=ControlModes::PWM1DoF)
Create the KinematicUnit (this function should be called in initializeKinematicUnit)
Ice::ObjectProxySeq getUnits(const Ice::Current &) const override
Returns proxies to all units.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
UnitsPropertyDefinitions(std::string prefix)
virtual void initializeInertialMeasurementUnit()
Initializes the InertialMeasurementUnit.
KinematicUnitInterfacePtr getKinematicUnit() const
Returns a pointer to the KinematicUnit.
InertialMeasurementUnitInterfacePtr getInertialMeasurementUnit() const
Returns a pointer to the InertialMeasurementUnit.
virtual void initializeTcpControllerUnit()
Initializes the TcpControllerUnit.
T::PointerType getUnit() const
Returns a pointer to the Unit for the given type (or null if there is none)
ForceTorqueUnitInterfacePtr getForceTorqueUnit() const
Returns a pointer to the ForceTorqueUnit.
virtual void initializeKinematicUnit()
Initializes the KinematicUnit.
static Units & Instance()
Returns the singleton instance of this class.
TrajectoryPlayerInterfacePtr getTrajectoryPlayer() const
Returns a pointer to the TrajectoryPlayer.
This class allows minimal access to private members of Units in a sane fashion for Publisher.
TCPControlUnitInterfacePtr getTCPControlUnit() const
Returns a pointer to the TCPControlUnit.
PlatformUnitInterfacePtr getPlatformUnit() const
Returns a pointer to the PlatformUnit.
const EmergencyStopMasterInterfacePtr & getEmergencyStopMaster() const
Returns a pointer to the EmergencyStopMaster.
T::ProxyType getUnitPrx() const
Returns a proxy to the Unit for the given type (or null if there is none)
virtual void initializeTrajectoryControllerUnit()
Initializes the TrajectoryControllerUnit.
virtual void initializeLocalizationUnit()
Initializes the TcpControllerUnit.
Base class for all RobotUnitModules.
std::shared_ptr< class Robot > RobotPtr