29 #include <shared_mutex>
36 #include <RobotAPI/interface/core/RobotState.h>
37 #include <RobotAPI/interface/units/PlatformUnitInterface.h>
78 virtual public RobotStateComponentInterface
81 std::string getDefaultName()
const override;
96 const Ice::Current&)
override;
99 const Ice::Current& current)
override;
100 NameValueMap getJointConfigAtTimestamp(
double timestamp,
101 const Ice::Current&)
const override;
102 RobotStateConfig getRobotStateAtTimestamp(
double timestamp,
103 const Ice::Current&)
const override;
106 std::string getRobotFilename(
const Ice::Current&)
const override;
109 std::vector<std::string> getArmarXPackages(
const Ice::Current&)
const override;
112 std::string getRobotName(
const Ice::Current&)
const override;
114 std::string getRobotStateTopicName(
const Ice::Current&)
const override;
117 std::string getRobotNodeSetName(
const Ice::Current&)
const override;
119 float getScaling(
const Ice::Current&)
const override;
121 RobotInfoNodePtr getRobotInfo(
const Ice::Current&)
const override;
124 void reportGlobalRobotPose(
const TransformStamped& globalRobotPose,
125 const Ice::Current& = Ice::Current())
override;
139 void onInitComponent()
override;
141 void onConnectComponent()
override;
142 void onDisconnectComponent()
override;
154 void reportControlModeChanged(
const NameControlModeMap& jointModes,
157 const Ice::Current&
c = Ice::emptyCurrent)
override;
162 const Ice::Current&
c = Ice::emptyCurrent)
override;
167 const Ice::Current&
c = Ice::emptyCurrent)
override;
172 const Ice::Current&
c = Ice::emptyCurrent)
override;
174 void reportJointAccelerations(
const NameValueMap& jointAccelerations,
177 const Ice::Current&
c)
override;
182 const Ice::Current&
c = Ice::emptyCurrent)
override;
184 void reportJointMotorTemperatures(
const NameValueMap& jointMotorTemperatures,
187 const Ice::Current&
c = Ice::emptyCurrent)
override;
189 void reportJointStatuses(
const NameStatusMap& jointStatuses,
192 const Ice::Current&
c = Ice::emptyCurrent)
override;
194 void simulatorWasReset(
const Ice::Current& = Ice::emptyCurrent)
override;
197 void readRobotInfo(
const std::string& robotFile);
202 template <
class ValueT>
210 std::optional<RobotStateConfig> interpolate(
IceUtil::Time time)
const;
212 std::optional<Timestamped<NameValueMap>> interpolateJoints(
IceUtil::Time time)
const;
214 std::optional<Timestamped<FramedPosePtr>> interpolatePose(
IceUtil::Time time)
const;
225 RobotStateListenerInterfacePrx robotStateListenerPrx;
228 std::string robotStateTopicName;
229 std::string robotFile;
230 std::string relativeRobotFile;
232 mutable std::shared_mutex jointHistoryMutex;
233 std::map<IceUtil::Time, NameValueMap> jointHistory;
234 size_t jointHistoryLength;
236 mutable std::shared_mutex poseHistoryMutex;
237 std::map<IceUtil::Time, FramedPosePtr> poseHistory;
238 size_t poseHistoryLength;
240 std::string robotNodeSetName;
242 float robotModelScaling;
244 RobotInfoNodePtr robotInfo;