diff --git a/source/RobotAPI/components/units/TCPControlUnit.cpp b/source/RobotAPI/components/units/TCPControlUnit.cpp index 8ddedde1f105cd85d190fe028c57bded83d8b8ad..19330a17f31479644927199b8da4cac5c8b9b0a9 100644 --- a/source/RobotAPI/components/units/TCPControlUnit.cpp +++ b/source/RobotAPI/components/units/TCPControlUnit.cpp @@ -87,7 +87,7 @@ namespace armarx { auto nodesets = localReportRobot->getRobotNodeSets(); - for (RobotNodeSetPtr& set : nodesets) + for (RobotNodeSetPtr & set : nodesets) { if (set->getTCP()) { @@ -103,7 +103,7 @@ namespace armarx boost::is_any_of(","), boost::token_compress_on); - for (auto& name : nodesetNames) + for (auto & name : nodesetNames) { auto node = localReportRobot->getRobotNode(name); @@ -288,6 +288,12 @@ namespace armarx } + bool TCPControlUnit::isRequested(const Ice::Current& c) + { + // no lock needed to read a single bool value. + return requested; + } + void TCPControlUnit::periodicExec() { diff --git a/source/RobotAPI/components/units/TCPControlUnit.h b/source/RobotAPI/components/units/TCPControlUnit.h index 31ddf540cc143fb5ad18dd90d268ccbf242481af..efb111ea2271f83edb524471f36a520aefa31f51 100644 --- a/source/RobotAPI/components/units/TCPControlUnit.h +++ b/source/RobotAPI/components/units/TCPControlUnit.h @@ -146,6 +146,8 @@ namespace armarx */ void release(const Ice::Current& c = Ice::Current()); + bool isRequested(const Ice::Current& c = Ice::Current()); + protected: void onInitComponent(); diff --git a/source/RobotAPI/interface/units/TCPControlUnit.ice b/source/RobotAPI/interface/units/TCPControlUnit.ice index 33117e380a73d620f0ba9755b5709881bc8d1993..238ba497895277ba00390c66db75ef038d49770d 100644 --- a/source/RobotAPI/interface/units/TCPControlUnit.ice +++ b/source/RobotAPI/interface/units/TCPControlUnit.ice @@ -53,6 +53,11 @@ module armarx **/ void setTCPVelocity(string robotNodeSetName, string tcpNodeName, FramedDirectionBase translationVelocity, FramedDirectionBase orientationVelocityRPY); + /** + * @brief returns if the TCPControlUnit is requested. + * @return Request status. + */ + bool isRequested(); }; /**