commit 04cf2b6f7442f4f2523a0d52079833a473e07800
Author: Sebastian Meyer zu Borgsen <semeyerz@techfak.uni-bielefeld.de>
Date:   Thu Jan 7 15:39:43 2016 +0100

    fixed robotimestamp

diff --git a/client/python/hlrc_client/MiddlewareROS.py b/client/python/hlrc_client/MiddlewareROS.py
index 0133e57..18beddb 100644
--- a/client/python/hlrc_client/MiddlewareROS.py
+++ b/client/python/hlrc_client/MiddlewareROS.py
@@ -179,7 +179,7 @@ class MiddlewareROS(Middleware):
         else:
             goal.gaze_type = gazetargetGoal.GAZETARGET_RELATIVE
 
-        goal.gaze_timestamp = rospy.Time.from_sec(gaze.timestamp)
+        goal.gaze_timestamp = rospy.Time.from_sec(gaze.gaze_timestamp.to_seconds())
 
         #send the goal to the server
         if (blocking):
diff --git a/client/python/hlrc_client/RobotGaze.py b/client/python/hlrc_client/RobotGaze.py
index 9b14208..fed929b 100644
--- a/client/python/hlrc_client/RobotGaze.py
+++ b/client/python/hlrc_client/RobotGaze.py
@@ -38,7 +38,7 @@ class RobotGaze:
         self.pan_offset = 0.0
         self.tilt_offset = 0.0
         self.gaze_type = RobotGaze.GAZETARGET_ABSOLUTE
-        self.timestamp = time.time()
+        self.gaze_timestamp = time.time()
 
     def __str__(self):
         if self.gaze_type == RobotGaze.GAZETARGET_ABSOLUTE:
@@ -46,4 +46,4 @@ class RobotGaze:
         else:
             type_s = "RELATIVE"
         return "RobotGaze = { PTR={%6.2f %6.2f %6.2f} vergence=%6.2f PT_offset={%6.2f %6.2f} [%s, ts=%s]}" \
-                % (self.pan, self.tilt, self.roll, self.vergence, self.pan_offset, self.tilt_offset, type_s, self.timestamp)
+                % (self.pan, self.tilt, self.roll, self.vergence, self.pan_offset, self.tilt_offset, type_s, self.gaze_timestamp)
diff --git a/client/python/hlrc_client/RobotTimestamp.py b/client/python/hlrc_client/RobotTimestamp.py
index 875369e..57d9e15 100644
--- a/client/python/hlrc_client/RobotTimestamp.py
+++ b/client/python/hlrc_client/RobotTimestamp.py
@@ -25,6 +25,7 @@ Forschungsgemeinschaft (DFG) in the context of the German
 Excellence Initiative.
 """
 import time
+import sys
 
 class RobotTimestamp:
     def __init__(self):
@@ -32,13 +33,20 @@ class RobotTimestamp:
         self.secs  = int(seconds)
         self.nsecs = int((seconds - self.secs) * 1000000000)
 
+
     @classmethod
     def from_sec_nsec(cls, _sec, _nsec):
         cls.sec  = _sec
         cls.nsec = _nsec
 
+    @classmethod
+    def from_system_time(cls):
+        seconds = time.time()
+        cls.secs = int(seconds)
+        cls.nsecs = int((seconds - self.secs) * 1000000000)
+
     def to_seconds(self):
-        return self.secs + ((float(self.nsec)) / 1000000000)
+        return self.secs + ((float(self.nsecs)) / 1000000000)
 
     def __str__(self):
         return "%f" % self.to_seconds()
diff --git a/client/python/hlrc_client/hlrc_test_relative_gaze.py b/client/python/hlrc_client/hlrc_test_relative_gaze.py
index 7aded43..8277532 100644
--- a/client/python/hlrc_client/hlrc_test_relative_gaze.py
+++ b/client/python/hlrc_client/hlrc_test_relative_gaze.py
@@ -54,6 +54,10 @@ def main():
    
     while(r.is_running()):
         g.gaze_timestamp = RobotTimestamp()
+        #add some delazy to make it realistic
+        time.sleep(1.0 / 50.0)
+
+        print(g)
         g.pan = random.uniform(-20, 20)
 
         for t in range(50):
diff --git a/client/python/tools/dump_relative_gazetargets.py b/client/python/tools/dump_relative_gazetargets.py
index 6ee819f..fcef570 100644
--- a/client/python/tools/dump_relative_gazetargets.py
+++ b/client/python/tools/dump_relative_gazetargets.py
@@ -80,15 +80,15 @@ def incoming_target_position_flobi(msg):
     id = ids[0]
     #print("> incoming target for joint %d" % (id))
     if (id == 0x01):
-        target_neck_pan = msg.target_position[0]
+        target_neck_pan = - 180.0/math.pi * msg.target_position[0]
     elif (id == 0x02):
-        target_neck_tilt = msg.target_position[0]
+        target_neck_tilt =  180.0/math.pi *  msg.target_position[0]
     elif (id == 0x04):
-        target_eyes_tilt = msg.target_position[0]
+        target_eyes_tilt =  180.0/math.pi * msg.target_position[0]
     elif (id == 0x05):
-        target_eye_l_pan = msg.target_position[0]
+        target_eye_l_pan =  180.0/math.pi * msg.target_position[0]
     elif (id == 0x06):
-        target_eye_r_pan = msg.target_position[0]
+        target_eye_r_pan =  180.0/math.pi * msg.target_position[0]
 
 def incoming_humotion_gaze_target(msg):
     print("> incoming gaze @%f" % (msg.gaze_timestamp.to_sec()))
diff --git a/client/python/tools/plot_relative_gazetargets.sh b/client/python/tools/plot_relative_gazetargets.sh
index 5a939eb..212bb44 100644
--- a/client/python/tools/plot_relative_gazetargets.sh
+++ b/client/python/tools/plot_relative_gazetargets.sh
@@ -2,8 +2,8 @@ FILE=/tmp/l
 #1449653129.190272 -8.841537 0.023177 1449651904.760381 -19.532999 0.000000 -19.532999 0.000000 0.000000 -0.000000 0.007721 -8.910353 -8.911380 #DUMP
 offset=`cat /tmp/l|head -1|cut -d " " -f 1`
 gnuplot -persist <<- EOF
-        plot "${FILE}" using (\$1-${offset}):2 w l t "pan_now", \
-	 "${FILE}" using (\$1-${offset}):3 w l t "tilt_now",\
+        plot "${FILE}" using (\$1-${offset}):2 w d t "pan_now" , \
+	 "${FILE}" using (\$1-${offset}):3 w d t "tilt_now" ,\
 	 "${FILE}" using (\$4-${offset}):5 t "target rel pan",\
          "${FILE}" using (\$1-${offset}):5 t "target rel pan [INCOMING TS]",\
 	 "${FILE}" using (\$4-${offset}):6 t "target rel tilt",\
