From 85fef88888b0b4291a73a49173be5778085a95d5 Mon Sep 17 00:00:00 2001 From: Nikolaus Vahrenkamp <vahrenkamp@kit.edu> Date: Wed, 19 Aug 2015 16:20:54 +0200 Subject: [PATCH] made RobotState topic name generic --- source/RobotAPI/components/units/HeadIKUnit.cpp | 2 +- source/RobotAPI/components/units/HeadIKUnit.h | 1 + source/RobotAPI/components/units/TCPControlUnit.cpp | 2 +- source/RobotAPI/components/units/TCPControlUnit.h | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/RobotAPI/components/units/HeadIKUnit.cpp b/source/RobotAPI/components/units/HeadIKUnit.cpp index f5910ce24..acba6b5da 100644 --- a/source/RobotAPI/components/units/HeadIKUnit.cpp +++ b/source/RobotAPI/components/units/HeadIKUnit.cpp @@ -26,7 +26,7 @@ namespace armarx usingProxy(getProperty<std::string>("KinematicUnitName").getValue()); usingProxy("RobotStateComponent"); - usingTopic("RobotState"); + usingTopic(getProperty<std::string>("RobotStateTopicName").getValue()); cycleTime = getProperty<int>("CycleTime").getValue(); offeringTopic("DebugDrawerUpdates"); diff --git a/source/RobotAPI/components/units/HeadIKUnit.h b/source/RobotAPI/components/units/HeadIKUnit.h index 0805fd780..4147362a5 100644 --- a/source/RobotAPI/components/units/HeadIKUnit.h +++ b/source/RobotAPI/components/units/HeadIKUnit.h @@ -47,6 +47,7 @@ namespace armarx ComponentPropertyDefinitions(prefix) { defineRequiredProperty<std::string>("KinematicUnitName","Name of the KinematicUnit Proxy"); + defineOptionalProperty<std::string>("RobotStateTopicName","RobotState","Name of the RobotComponent State topic."); defineOptionalProperty<int>("CycleTime", 30, "Cycle time of the tcp control in ms"); } }; diff --git a/source/RobotAPI/components/units/TCPControlUnit.cpp b/source/RobotAPI/components/units/TCPControlUnit.cpp index 43242f839..846a9ce54 100644 --- a/source/RobotAPI/components/units/TCPControlUnit.cpp +++ b/source/RobotAPI/components/units/TCPControlUnit.cpp @@ -57,7 +57,7 @@ namespace armarx usingProxy("RobotStateComponent"); usingProxy("DebugObserver"); offeringTopic(topicName); - usingTopic("RobotState"); + usingTopic(getProperty<std::string>("RobotStateTopicName").getValue()); cycleTime = getProperty<int>("CycleTime").getValue(); maxJointVelocity = getProperty<float>("MaxJointVelocity").getValue(); diff --git a/source/RobotAPI/components/units/TCPControlUnit.h b/source/RobotAPI/components/units/TCPControlUnit.h index 6b585979d..616dadbed 100644 --- a/source/RobotAPI/components/units/TCPControlUnit.h +++ b/source/RobotAPI/components/units/TCPControlUnit.h @@ -46,6 +46,7 @@ namespace armarx ComponentPropertyDefinitions(prefix) { defineRequiredProperty<std::string>("KinematicUnitName","Name of the KinematicUnit Proxy"); + defineOptionalProperty<std::string>("RobotStateTopicName","RobotState","Name of the RobotComponent State topic."); defineOptionalProperty<float>("MaxJointVelocity",30.f/180*3.141, "Maximal joint velocity in rad/sec"); defineRequiredProperty<std::string>("RobotFileName", "Robot file name, e.g. robot_model.xml"); defineOptionalProperty<int>("CycleTime", 30, "Cycle time of the tcp control in ms"); -- GitLab