31#include <ArmarXCore/interface/observers/VariantBase.h>
35#include <RobotAPI/interface/observers/KinematicUnitObserverInterface.h>
36#include <RobotAPI/interface/units/KinematicUnitInterface.h>
51 "Robot node set name as defined in robot xml file, e.g. 'LeftArm'");
53 "Robot file name, e.g. robot_model.xml");
56 "Project in which the robot filename is located "
57 "(if robot is loaded from an external project)");
59 "TopicPrefix",
"",
"Prefix for the sensor value topic name.");
78 virtual public KinematicUnitObserverInterface
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;
106 const Ice::Current&
c)
override;
110 const Ice::Current&
c = Ice::emptyCurrent)
override;
114 const Ice::Current&
c = Ice::emptyCurrent)
override;
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,
190 const NameValueMap& nameValueMap,
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;
#define ARMARX_CREATE_CHECK(OFFERER, NEWCHECK)
#define ARMARXCORE_IMPORT_EXPORT
DataFieldIdentifier provide the basis to identify data field within a distributed ArmarX scenario.
DataFieldIdentifier getDatafield(const std::string &kinematicUnitObserverName, const std::string &jointName) const
Function to create a Channel Representation for a KinematicUnitObserver.
KinematicUnitDatafieldCreator(const std::string &channelName)
KinematicUnitObserverPropertyDefinitions(std::string prefix)
Observer monitoring kinematic sensor and actor values.
static ControlMode StringToControlMode(const std::string &mode)
void reportJointMotorTemperatures(const NameValueMap &jointMotorTemperatures, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c=Ice::emptyCurrent) override
void onConnectObserver() override
Framework hook.
void reportJointVelocities(const NameValueMap &jointVelocities, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c=Ice::emptyCurrent) override
void reportJointAngles(const NameValueMap &jointAngles, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c=Ice::emptyCurrent) override
void reportJointTorques(const NameValueMap &jointTorques, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c=Ice::emptyCurrent) override
void reportControlModeChanged(const NameControlModeMap &jointModes, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c=Ice::emptyCurrent) override
void reportJointCurrents(const NameValueMap &jointCurrents, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c=Ice::emptyCurrent) override
void reportJointAccelerations(const NameValueMap &jointAccelerations, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c) override
void reportJointStatuses(const NameStatusMap &jointStatuses, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c=Ice::emptyCurrent) override
std::mutex initializedChannelsMutex
void onInitObserver() override
Framework hook.
static std::string ControlModeToString(ControlMode mode)
std::set< std::string > initializedChannels
std::string getDefaultName() const override
Retrieve default name of component.
ObserverPropertyDefinitions(std::string prefix)
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
PropertyDefinition< PropertyType > & defineRequiredProperty(const std::string &name, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
const KinematicUnitDatafieldCreator jointVelocities("jointVelocities")
const KinematicUnitDatafieldCreator jointTemperatures("jointTemperatures")
const KinematicUnitDatafieldCreator jointCurrents("jointCurrents")
const KinematicUnitDatafieldCreator jointAngles("jointAngles")
const KinematicUnitDatafieldCreator jointTorques("jointTorques")
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.