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");
43 defineOptionalProperty<std::string>(
44 "DiagnosticsUnitName",
"DiagnosticsUnit",
"Name of the diagnostics unit.");
46 defineOptionalProperty<std::string>(
47 "PlatformUnitName",
"PlatformUnit",
"The name of the created platform unit");
49 auto& types = defineOptionalProperty<NJointHolonomicPlatformVelocityControllerTypes>(
50 "PlatformUnitVelocityControllerType",
52 "Which controller to use for velocity control of the platform");
53 for (
const auto& [type, name] :
56 types.map(name, type);
59 defineOptionalProperty<float>(
60 "PlatformUnitMaximumPositionAcceleration",
62 "The maximum allowed acceleration for the position of the platform");
63 defineOptionalProperty<float>(
64 "PlatformUnitMaximumOrientationAcceleration",
66 "The maximum allowed acceleration for the orientation of the platform");
68 defineOptionalProperty<std::string>(
69 "ForceTorqueUnitName",
71 "The name of the created force troque unit (empty = default)");
72 defineOptionalProperty<std::string>(
73 "ForceTorqueTopicName",
75 "Name of the topic on which the force torque sensor values are provided");
77 defineOptionalProperty<std::string>(
78 "InertialMeasurementUnitName",
79 "InertialMeasurementUnit",
80 "The name of the created inertial measurement unit (empty = default)");
81 defineOptionalProperty<std::string>(
82 "IMUTopicName",
"IMUValues",
"Name of the IMU Topic.");
84 defineOptionalProperty<bool>(
"CreateTCPControlUnit",
86 "If true the TCPControl SubUnit is created and added");
87 defineOptionalProperty<std::string>(
88 "TCPControlUnitName",
"TCPControlUnit",
"Name of the TCPControlUnit.");
90 defineOptionalProperty<bool>(
91 "CreateTrajectoryPlayer",
93 "If true the TrajectoryPlayer SubUnit is created and added");
94 defineOptionalProperty<std::string>(
95 "TrajectoryControllerUnitName",
97 "Name of the TrajectoryControllerUnit. The respective component outside of the "
98 "RobotUnit is TrajectoryPlayer");
100 defineOptionalProperty<std::string>(
101 "EmergencyStopMasterName",
102 "EmergencyStopMaster",
103 "The name used to register as an EmergencyStopMaster");
104 defineOptionalProperty<std::string>(
105 "EmergencyStopTopic",
107 "The name of the topic over which changes of the emergencyStopState are sent.");
140 void _preOnInitRobotUnit();
142 void _icePropertiesInitialized();
144 void _preFinishRunning();
146 void _postOnExitRobotUnit();
155 Ice::ObjectProxySeq
getUnits(
const Ice::Current&)
const override;
161 Ice::ObjectPrx
getUnit(
const std::string& staticIceId,
const Ice::Current&)
const override;
167 KinematicUnitInterfacePrx
getKinematicUnit(
const Ice::Current&)
const override;
177 InertialMeasurementUnitInterfacePrx
183 PlatformUnitInterfacePrx
getPlatformUnit(
const Ice::Current&)
const override;
188 TCPControlUnitInterfacePrx
getTCPControlUnit(
const Ice::Current&)
const override;
211 typename T::PointerType
getUnit()
const;
290 const std::string& positionControlMode = ControlModes::Position1DoF,
291 const std::string& velocityControlMode = ControlModes::Velocity1DoF,
292 const std::string& torqueControlMode = ControlModes::Torque1DoF,
293 const std::string& pwmControlMode = ControlModes::PWM1DoF);
305 std::vector<ManagedIceObjectPtr> units;
308 std::vector<RobotUnitSubUnitPtr> subUnits;
311 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.
virtual void initializeDiagnosticsUnit()
Initialize the diagnostics unit.
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