From 8ba53c24bad896f4fa4150873c66a9efe228f229 Mon Sep 17 00:00:00 2001
From: Markus Grotz <markus.grotz@kit.edu>
Date: Wed, 11 Nov 2015 15:48:37 +0100
Subject: [PATCH] added HeadIKUnitListener

---
 source/RobotAPI/components/units/HeadIKUnit.cpp | 7 +++++++
 source/RobotAPI/components/units/HeadIKUnit.h   | 2 ++
 source/RobotAPI/interface/units/HeadIKUnit.ice  | 8 ++++++++
 3 files changed, 17 insertions(+)

diff --git a/source/RobotAPI/components/units/HeadIKUnit.cpp b/source/RobotAPI/components/units/HeadIKUnit.cpp
index 653a3fd7a..8e699f85c 100644
--- a/source/RobotAPI/components/units/HeadIKUnit.cpp
+++ b/source/RobotAPI/components/units/HeadIKUnit.cpp
@@ -28,6 +28,8 @@ namespace armarx
         usingProxy("RobotStateComponent");
         usingTopic(getProperty<std::string>("RobotStateTopicName").getValue());
 
+
+
         cycleTime = getProperty<int>("CycleTime").getValue();
         offeringTopic("DebugDrawerUpdates");
     }
@@ -46,6 +48,9 @@ namespace armarx
         localRobot = RemoteRobot::createLocalClone(robotStateComponentPrx);
 
 
+        headIKUnitListener = getTopic<armarx::HeadIKUnitListenerPrx>(getProperty<std::string>("HeadIKUnitTopicName").getValue());
+
+
         //std::string robotModelFile;
         //ArmarXDataPath::getAbsolutePath("Armar3/robotmodel/ArmarIII.xml", robotModelFile);
         //localRobot = VirtualRobot::RobotIO::loadRobot(robotModelFile.c_str(), VirtualRobot::RobotIO::eStructure);
@@ -126,6 +131,8 @@ namespace armarx
         ARMARX_DEBUG << "new Head target set: " << *globalTarget;
 
         newTargetSet = true;
+
+        headIKUnitListener->reportHeadTargetChanged();
     }
 
 
diff --git a/source/RobotAPI/components/units/HeadIKUnit.h b/source/RobotAPI/components/units/HeadIKUnit.h
index c9f137bb7..01535904d 100644
--- a/source/RobotAPI/components/units/HeadIKUnit.h
+++ b/source/RobotAPI/components/units/HeadIKUnit.h
@@ -110,6 +110,8 @@ namespace armarx
         std::string robotNodeSetName;
         FramedPositionPtr targetPosition;
         bool newTargetSet;
+
+        armarx::HeadIKUnitListenerPrx headIKUnitListener;
     };
 
 }
diff --git a/source/RobotAPI/interface/units/HeadIKUnit.ice b/source/RobotAPI/interface/units/HeadIKUnit.ice
index fec56ec4a..a5ac1b1a7 100644
--- a/source/RobotAPI/interface/units/HeadIKUnit.ice
+++ b/source/RobotAPI/interface/units/HeadIKUnit.ice
@@ -50,6 +50,14 @@ module armarx
 		* @param targetPosition in x, y, and z.
 		**/
         void setHeadTarget(string robotNodeSetName, FramedPositionBase targetPosition);
+
+    };
+
+
+
+    interface HeadIKUnitListener
+    {
+        void reportHeadTargetChanged();
     };
 
 };
-- 
GitLab