From 5579813a7135a5f73ab8ebb4d7e1b882f06b8c0e Mon Sep 17 00:00:00 2001 From: Mirko Waechter <waechter@kit.edu> Date: Tue, 21 Apr 2015 04:03:33 +0200 Subject: [PATCH] robotstate component returns relative path. otherwise file not findable on other pc --- .../RobotAPI/components/robotstate/RobotStateComponent.cpp | 6 +++--- source/RobotAPI/components/robotstate/RobotStateComponent.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/RobotAPI/components/robotstate/RobotStateComponent.cpp b/source/RobotAPI/components/robotstate/RobotStateComponent.cpp index d4a171a3c..ed04fbe08 100644 --- a/source/RobotAPI/components/robotstate/RobotStateComponent.cpp +++ b/source/RobotAPI/components/robotstate/RobotStateComponent.cpp @@ -58,8 +58,8 @@ namespace armarx void RobotStateComponent::onInitComponent() { - robotFile = getProperty<std::string>("RobotFileName").getValue(); - if (!ArmarXDataPath::getAbsolutePath(robotFile,robotFile)) + relativeRobotFile = getProperty<std::string>("RobotFileName").getValue(); + if (!ArmarXDataPath::getAbsolutePath(relativeRobotFile,robotFile)) { throw UserException("Could not find robot file " + robotFile); } @@ -181,7 +181,7 @@ namespace armarx std::string RobotStateComponent::getRobotFilename(const Ice::Current&) const { - return robotFile; + return relativeRobotFile; } void RobotStateComponent::reportControlModeChanged(const NameControlModeMap& jointModes, bool aValueChanged,const Current& c){} diff --git a/source/RobotAPI/components/robotstate/RobotStateComponent.h b/source/RobotAPI/components/robotstate/RobotStateComponent.h index 80d9ec37b..ab2f9f220 100644 --- a/source/RobotAPI/components/robotstate/RobotStateComponent.h +++ b/source/RobotAPI/components/robotstate/RobotStateComponent.h @@ -139,6 +139,7 @@ namespace armarx SharedRobotServantPtr _sharedRobotServant; VirtualRobot::RobotPtr _synchronized; std::string robotFile; + std::string relativeRobotFile; RobotStateObserverPtr robotStateObs; -- GitLab