From 4f17228f840f22cffc35ef865b22117d125e1f29 Mon Sep 17 00:00:00 2001
From: Mirko Waechter <mirko.waechter@kit.edu>
Date: Fri, 4 Dec 2015 16:25:14 +0100
Subject: [PATCH] minor ftobs tweak

---
 .../RobotAPI/components/units/ForceTorqueObserver.cpp | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/source/RobotAPI/components/units/ForceTorqueObserver.cpp b/source/RobotAPI/components/units/ForceTorqueObserver.cpp
index 2fa220da6..d2048901b 100644
--- a/source/RobotAPI/components/units/ForceTorqueObserver.cpp
+++ b/source/RobotAPI/components/units/ForceTorqueObserver.cpp
@@ -95,18 +95,19 @@ void ForceTorqueObserver::offerValue(std::string nodeName, const std::string& ty
 {
     FramedDirectionPtr vec = FramedDirectionPtr::dynamicCast(value);
 
-    if (!existsChannel(id->channelName))
-    {
-        offerChannel(id->channelName, type + " vectors on specific parts of the robot.");
-    }
+
 
     if (!existsDataField(id->channelName, id->datafieldName))
     {
+        if (!existsChannel(id->channelName))
+        {
+            offerChannel(id->channelName, type + " vectors on specific parts of the robot.");
+        }
         offerDataFieldWithDefault(id->channelName, id->datafieldName, Variant(value), "3D vector for " + type + " of " + nodeName);
     }
     else
     {
-        setDataField(id->channelName, id->datafieldName, Variant(value));
+        setDataFieldFlatCopy(id->channelName, id->datafieldName, new Variant(value));
     }
 
 
-- 
GitLab