28 #include <ArmarXCore/interface/observers/VariantBase.h>
29 #include <RobotAPI/interface/units/KinematicUnitInterface.h>
30 #include <RobotAPI/interface/observers/KinematicUnitObserverInterface.h>
49 defineRequiredProperty<std::string>(
"RobotNodeSetName",
"Robot node set name as defined in robot xml file, e.g. 'LeftArm'");
50 defineRequiredProperty<std::string>(
"RobotFileName",
"Robot file name, e.g. robot_model.xml");
51 defineOptionalProperty<std::string>(
"RobotFileNameProject",
"",
"Project in which the robot filename is located (if robot is loaded from an external project)");
52 defineOptionalProperty<std::string>(
"TopicPrefix",
"",
"Prefix for the sensor value topic name.");
72 virtual public KinematicUnitObserverInterface
76 void onInitObserver()
override;
77 void onConnectObserver()
override;
81 void reportControlModeChanged(
const NameControlModeMap& jointModes,
Ice::Long timestamp,
bool aValueChanged,
const Ice::Current&
c = Ice::emptyCurrent)
override;
85 void reportJointAccelerations(
const NameValueMap& jointAccelerations,
Ice::Long timestamp,
bool aValueChanged,
const Ice::Current&
c)
override;
87 void reportJointMotorTemperatures(
const NameValueMap& jointMotorTemperatures,
Ice::Long timestamp,
bool aValueChanged,
const Ice::Current&
c = Ice::emptyCurrent)
override;
88 void reportJointStatuses(
const NameStatusMap& jointStatuses,
Ice::Long timestamp,
bool aValueChanged,
const Ice::Current&
c = Ice::emptyCurrent)
override;
92 return "KinematicUnitObserver";
107 case ePositionControl:
108 return "PositionControl";
110 case eVelocityControl:
111 return "VelocityControl";
114 return "TorqueControl";
116 case ePositionVelocityControl:
117 return "PositionVelocityControl";
127 if (mode ==
"Disabled")
132 if (mode ==
"PositionControl")
134 return ePositionControl;
137 if (mode ==
"VelocityControl")
139 return eVelocityControl;
142 if (mode ==
"TorqueControl")
144 return eTorqueControl;
147 if (mode ==
"PositionVelocityControl")
149 return ePositionVelocityControl;
156 void nameValueMapToDataFields(
const std::string& channelName,
const NameValueMap& nameValueMap,
Ice::Long timestamp,
bool aValueChanged);
160 std::string robotNodeSetName;
161 std::set<std::string> robotNodes;
187 if (kinematicUnitObserverName.empty())
189 throw LocalException(
"kinematicUnitObserverName must not be empty!");
192 if (jointName.empty())
194 throw LocalException(
"jointName must not be empty!");
201 std::string _channelName;