31 #include <ArmarXCore/interface/observers/VariantBase.h>
35 #include <RobotAPI/interface/observers/KinematicUnitObserverInterface.h>
36 #include <RobotAPI/interface/units/KinematicUnitInterface.h>
49 defineRequiredProperty<std::string>(
51 "Robot node set name as defined in robot xml file, e.g. 'LeftArm'");
52 defineRequiredProperty<std::string>(
"RobotFileName",
53 "Robot file name, e.g. robot_model.xml");
54 defineOptionalProperty<std::string>(
"RobotFileNameProject",
56 "Project in which the robot filename is located "
57 "(if robot is loaded from an external project)");
58 defineOptionalProperty<std::string>(
59 "TopicPrefix",
"",
"Prefix for the sensor value topic name.");
78 virtual public KinematicUnitObserverInterface
82 void onInitObserver()
override;
83 void onConnectObserver()
override;
87 void reportControlModeChanged(
const NameControlModeMap& jointModes,
90 const Ice::Current&
c = Ice::emptyCurrent)
override;
94 const Ice::Current&
c = Ice::emptyCurrent)
override;
98 const Ice::Current&
c = Ice::emptyCurrent)
override;
102 const Ice::Current&
c = Ice::emptyCurrent)
override;
103 void reportJointAccelerations(
const NameValueMap& jointAccelerations,
106 const Ice::Current&
c)
override;
110 const Ice::Current&
c = Ice::emptyCurrent)
override;
111 void reportJointMotorTemperatures(
const NameValueMap& jointMotorTemperatures,
114 const Ice::Current&
c = Ice::emptyCurrent)
override;
115 void reportJointStatuses(
const NameStatusMap& jointStatuses,
118 const Ice::Current&
c = Ice::emptyCurrent)
override;
123 return "KinematicUnitObserver";
139 case ePositionControl:
140 return "PositionControl";
142 case eVelocityControl:
143 return "VelocityControl";
146 return "TorqueControl";
148 case ePositionVelocityControl:
149 return "PositionVelocityControl";
160 if (mode ==
"Disabled")
165 if (mode ==
"PositionControl")
167 return ePositionControl;
170 if (mode ==
"VelocityControl")
172 return eVelocityControl;
175 if (mode ==
"TorqueControl")
177 return eTorqueControl;
180 if (mode ==
"PositionVelocityControl")
182 return ePositionVelocityControl;
189 void nameValueMapToDataFields(
const std::string& channelName,
197 std::string robotNodeSetName;
198 std::set<std::string> robotNodes;
222 const std::string& jointName)
const
224 if (kinematicUnitObserverName.empty())
226 throw LocalException(
"kinematicUnitObserverName must not be empty!");
229 if (jointName.empty())
231 throw LocalException(
"jointName must not be empty!");
238 std::string _channelName;