From 5cb6a9018fd85a827f3a3c0c6a058ece3f533f69 Mon Sep 17 00:00:00 2001 From: Nikolaus Vahrenkamp <vahrenkamp@kit.edu> Date: Mon, 20 Oct 2014 22:31:48 +0200 Subject: [PATCH] Add method to retrieve the config robot xml filename --- source/RobotAPI/interface/robotstate/RobotState.ice | 6 ++++++ .../RobotAPI/libraries/robotstate/RobotStateComponent.cpp | 7 ++++++- source/RobotAPI/libraries/robotstate/RobotStateComponent.h | 6 +++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/source/RobotAPI/interface/robotstate/RobotState.ice b/source/RobotAPI/interface/robotstate/RobotState.ice index e254732b9..d58c6fdd6 100644 --- a/source/RobotAPI/interface/robotstate/RobotState.ice +++ b/source/RobotAPI/interface/robotstate/RobotState.ice @@ -120,10 +120,16 @@ module armarx * @return proxy to the shared robot which constantly updates all joint values */ SharedRobotInterface* getSynchronizedRobot(); + /** * @return proxy to a copy of the shared robot with non updating joint values */ SharedRobotInterface* getRobotSnapshot(string time); + + /** + * @return the robot xml filename as specified in the configuration + */ + string getRobotFilename(); }; }; diff --git a/source/RobotAPI/libraries/robotstate/RobotStateComponent.cpp b/source/RobotAPI/libraries/robotstate/RobotStateComponent.cpp index cc50f66c1..d5c81c859 100644 --- a/source/RobotAPI/libraries/robotstate/RobotStateComponent.cpp +++ b/source/RobotAPI/libraries/robotstate/RobotStateComponent.cpp @@ -151,7 +151,12 @@ namespace armarx // ARMARX_VERBOSE_S << "duration: " << (IceUtil::Time::now() - start).toMilliSeconds() << " ms"; } - + std::string RobotStateComponent::getRobotFilename(const Ice::Current&) + { + std::string robotFile = getProperty<std::string>("RobotFileName").getValue(); + return robotFile; + } + void RobotStateComponent::reportControlModeChanged(const NameControlModeMap& jointModes, bool aValueChanged,const Current& c){} void RobotStateComponent::reportJointVelocities(const NameValueMap& jointVelocities, bool aValueChanged,const Current& c){} void RobotStateComponent::reportJointTorques(const NameValueMap& jointTorques, bool aValueChanged,const Current& c){} diff --git a/source/RobotAPI/libraries/robotstate/RobotStateComponent.h b/source/RobotAPI/libraries/robotstate/RobotStateComponent.h index d4dafacca..8b1bc656a 100644 --- a/source/RobotAPI/libraries/robotstate/RobotStateComponent.h +++ b/source/RobotAPI/libraries/robotstate/RobotStateComponent.h @@ -91,7 +91,11 @@ namespace armarx * \return clone of the internal synchronized robot */ virtual SharedRobotInterfacePrx getRobotSnapshot(const std::string & time, const Ice::Current&); - + + /** + * \return the robot xml filename as specified in the configuration + */ + virtual std::string getRobotFilename(const Ice::Current&); /** * Create an instance of RobotStatePropertyDefinitions. -- GitLab