34 #include <RobotAPI/interface/core/RobotState.h>
35 #include <RobotAPI/interface/units/PlatformUnitInterface.h>
41 #include <shared_mutex>
82 virtual public RobotStateComponentInterface
86 std::string getDefaultName()
const override;
103 NameValueMap getJointConfigAtTimestamp(
double timestamp,
const Ice::Current&)
const override;
104 RobotStateConfig getRobotStateAtTimestamp(
double timestamp,
const Ice::Current&)
const override;
107 std::string getRobotFilename(
const Ice::Current&)
const override;
110 std::vector<std::string> getArmarXPackages(
const Ice::Current&)
const override;
113 std::string getRobotName(
const Ice::Current&)
const override;
115 std::string getRobotStateTopicName(
const Ice::Current&)
const override;
118 std::string getRobotNodeSetName(
const Ice::Current&)
const override;
120 float getScaling(
const Ice::Current&)
const override;
122 RobotInfoNodePtr getRobotInfo(
const Ice::Current&)
const override;
125 void reportGlobalRobotPose(
const TransformStamped& globalRobotPose,
const Ice::Current& = Ice::Current())
override;
140 void onInitComponent()
override;
142 void onConnectComponent()
override;
143 void onDisconnectComponent()
override;
155 void reportControlModeChanged(
const NameControlModeMap& jointModes,
Ice::Long timestamp,
bool aValueChanged,
const Ice::Current&
c = Ice::emptyCurrent)
override;
163 void reportJointAccelerations(
const NameValueMap& jointAccelerations,
Ice::Long timestamp,
bool aValueChanged,
const Ice::Current&
c)
override;
167 void reportJointMotorTemperatures(
const NameValueMap& jointMotorTemperatures,
Ice::Long timestamp,
bool aValueChanged,
const Ice::Current&
c = Ice::emptyCurrent)
override;
169 void reportJointStatuses(
const NameStatusMap& jointStatuses,
Ice::Long timestamp,
bool aValueChanged,
const Ice::Current&
c = Ice::emptyCurrent)
override;
171 void simulatorWasReset(
const Ice::Current& = Ice::emptyCurrent)
override;
174 void readRobotInfo(
const std::string& robotFile);
180 template <
class ValueT>
188 std::optional<RobotStateConfig> interpolate(
IceUtil::Time time)
const;
190 std::optional<Timestamped<NameValueMap>> interpolateJoints(
IceUtil::Time time)
const;
192 std::optional<Timestamped<FramedPosePtr>> interpolatePose(
IceUtil::Time time)
const;
204 RobotStateListenerInterfacePrx robotStateListenerPrx;
207 std::string robotStateTopicName;
208 std::string robotFile;
209 std::string relativeRobotFile;
211 mutable std::shared_mutex jointHistoryMutex;
212 std::map<IceUtil::Time, NameValueMap> jointHistory;
213 size_t jointHistoryLength;
215 mutable std::shared_mutex poseHistoryMutex;
216 std::map<IceUtil::Time, FramedPosePtr> poseHistory;
217 size_t poseHistoryLength;
219 std::string robotNodeSetName;
221 float robotModelScaling;
223 RobotInfoNodePtr robotInfo;