29#include <shared_mutex>
36#include <RobotAPI/interface/core/RobotState.h>
37#include <RobotAPI/interface/units/PlatformUnitInterface.h>
78 virtual public RobotStateComponentInterface
96 const Ice::Current&)
override;
99 const Ice::Current& current)
override;
101 const Ice::Current&)
const override;
103 const Ice::Current&)
const override;
112 std::string
getRobotName(
const Ice::Current&)
const override;
119 float getScaling(
const Ice::Current&)
const override;
121 RobotInfoNodePtr
getRobotInfo(
const Ice::Current&)
const override;
125 const Ice::Current& = Ice::Current())
override;
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;
177 const Ice::Current&
c)
override;
182 const Ice::Current&
c = Ice::emptyCurrent)
override;
187 const Ice::Current&
c = Ice::emptyCurrent)
override;
192 const Ice::Current&
c = Ice::emptyCurrent)
override;
197 void readRobotInfo(
const std::string& robotFile);
200 void insertPose(IceUtil::Time
timestamp,
const Eigen::Matrix4f& globalPose);
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;
#define ARMARXCOMPONENT_IMPORT_EXPORT
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Component()
Protected default constructor. Used for virtual inheritance. Use createManagedIceObject() instead.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
The RobotStateComponent class.
void onInitComponent() override
Load and create a VirtualRobot::Robot instance from the RobotFileName property.
void reportJointMotorTemperatures(const NameValueMap &jointMotorTemperatures, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c=Ice::emptyCurrent) override
Does nothing.
void reportJointVelocities(const NameValueMap &jointVelocities, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c=Ice::emptyCurrent) override
Sends the joint velocities to the robot state observer.
void reportJointAngles(const NameValueMap &jointAngles, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c=Ice::emptyCurrent) override
Stores the reported joint angles in the joint history and publishes the new joint angles.
float getScaling(const Ice::Current &) const override
void onDisconnectComponent() override
Hook for subclass.
void reportJointTorques(const NameValueMap &jointTorques, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c=Ice::emptyCurrent) override
Does nothing.
std::vector< std::string > getArmarXPackages(const Ice::Current &) const override
void reportGlobalRobotPose(const TransformStamped &globalRobotPose, const Ice::Current &=Ice::Current()) override
std::string getRobotName(const Ice::Current &) const override
RobotStateConfig getRobotStateAtTimestamp(double timestamp, const Ice::Current &) const override
SharedRobotInterfacePrx getSynchronizedRobot(const Ice::Current &) const override
void reportControlModeChanged(const NameControlModeMap &jointModes, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c=Ice::emptyCurrent) override
Does nothing.
void reportJointCurrents(const NameValueMap &jointCurrents, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c=Ice::emptyCurrent) override
Does nothing.
std::string getRobotStateTopicName(const Ice::Current &) const override
void onConnectComponent() override
Setup RobotStateObjectFactories needed for creating RemoteRobot instances.
SharedRobotInterfacePrx getRobotSnapshot(const std::string &deprecated, const Ice::Current &) override
Creates a snapshot of the robot state at this moment in time.
void reportJointAccelerations(const NameValueMap &jointAccelerations, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c) override
Does nothing.
void reportJointStatuses(const NameStatusMap &jointStatuses, Ice::Long timestamp, bool aValueChanged, const Ice::Current &c=Ice::emptyCurrent) override
Does nothing.
PropertyDefinitionsPtr createPropertyDefinitions() override
Create an instance of RobotStatePropertyDefinitions.
RobotInfoNodePtr getRobotInfo(const Ice::Current &) const override
std::string getRobotNodeSetName(const Ice::Current &) const override
void setRobotStateObserver(RobotStateObserverPtr observer)
std::string getRobotFilename(const Ice::Current &) const override
NameValueMap getJointConfigAtTimestamp(double timestamp, const Ice::Current &) const override
void simulatorWasReset(const Ice::Current &=Ice::emptyCurrent) override
std::string getDefaultName() const override
Retrieve default name of component.
SharedRobotInterfacePrx getRobotSnapshotAtTimestamp(double time, const Ice::Current ¤t) override
RobotStatePropertyDefinitions(std::string prefix)
std::shared_ptr< class Robot > RobotPtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
::IceInternal::ProxyHandle<::IceProxy::armarx::SharedRobotInterface > SharedRobotInterfacePrx
IceInternal::Handle< SharedRobotServant > SharedRobotServantPtr
IceInternal::Handle< RobotStateObserver > RobotStateObserverPtr