commit c5a47e565ac5e04974869388ae4a7968d18386fb
Author: Simon Schulz <sschulz@cit-ec.uni-bielefeld.de>
Date:   Tue Dec 1 16:55:12 2015 +0100

    rsb ignore switch

diff --git a/client/cpp/CMakeLists.txt b/client/cpp/CMakeLists.txt
index e28f456..910b04d 100644
--- a/client/cpp/CMakeLists.txt
+++ b/client/cpp/CMakeLists.txt
@@ -24,10 +24,15 @@ SET(PKGDIR     "${PREFIX}/lib/pkgconfig")
 SET(DATADIR    "${PREFIX}/share/hlrc_client")
 
 #######################################
-# check if we have RSB support:
-option(WITH_RSB "WITH_RSB" ON)
+#######################################
+#allow forced disable of RSB
+option(IGNORE_RSB "IGNORE_RSB" OFF)
 
-IF(WITH_RSB)
+#######################################
+# check if we have RSB support:
+IF (IGNORE_RSB)
+    MESSAGE(INFO "RSB disabled per command line flag IGNORE_RSB")
+ELSE (IGNORE_RSB)
 FIND_PACKAGE(RSB 0.11)
 IF (RSB_FOUND)
     #RSB
@@ -56,7 +61,8 @@ IF (RSB_FOUND)
     message(STATUS "RSB Support is ON")
     add_definitions(-DRSB_SUPPORT=1)
 ENDIF (RSB_FOUND)
-ENDIF(WITH_RSB)
+ENDIF(IGNORE_RSB)
+
 ################################################################
 # check for ROS support:
 find_package(catkin)
diff --git a/client/cpp/examples/random_gaze/main.cpp b/client/cpp/examples/random_gaze/main.cpp
index 9d3b905..7f25770 100644
--- a/client/cpp/examples/random_gaze/main.cpp
+++ b/client/cpp/examples/random_gaze/main.cpp
@@ -58,7 +58,7 @@ int main (int argc, char **argv){
 			gaze.vergence = 0.0;
 
             //absolute mode
-            gaze.type = RobotGaze::ABSOLUTE;
+            gaze.gaze_type = RobotGaze::ABSOLUTE;
             gaze.timestamp = RobotGaze::now();
 
             //robot_controller->set_current_emotion(RobotEmotion(RobotEmotion::ANGRY));
diff --git a/client/cpp/include/RobotGaze.h b/client/cpp/include/RobotGaze.h
index c320db5..0663b9e 100644
--- a/client/cpp/include/RobotGaze.h
+++ b/client/cpp/include/RobotGaze.h
@@ -38,7 +38,7 @@ public:
         vergence = 0.0;
         pan_offset = 0.0;
         tilt_offset = 0.0;
-        type = ABSOLUTE;
+        gaze_type = ABSOLUTE;
     }
 
     static double now(){
@@ -55,7 +55,7 @@ public:
 
     double timestamp;
 
-    int type;
+    int gaze_type;
 
     float pan, tilt, roll, vergence;
     float pan_offset, tilt_offset;
diff --git a/client/cpp/src/MiddlewareROS.cpp b/client/cpp/src/MiddlewareROS.cpp
index d6acfad..a677983 100644
--- a/client/cpp/src/MiddlewareROS.cpp
+++ b/client/cpp/src/MiddlewareROS.cpp
@@ -154,12 +154,9 @@ void MiddlewareROS::publish_gaze_target(RobotGaze target, bool blocking){
     goal.pan_offset = target.pan_offset;
 
     //timestamp:
-    //ts = t.sec + t.nsec/1000000000.0;
-    uint32_t sec  = (uint32_t) target.timestamp;
-    uint32_t nsec = (uint32_t)((target.timestamp - sec)*1000000000);
-    goal.timestamp = ros::Time(sec, nsec);
+    goal.timestamp = ros::Time(target.timestamp);
 
-    if (target.type == RobotGaze::ABSOLUTE){
+    if (target.gaze_type == RobotGaze::ABSOLUTE){
         goal.gaze_type = hlrc_server::gazetargetGoal::GAZETARGET_ABSOLUTE;
     }else{
         goal.gaze_type = hlrc_server::gazetargetGoal::GAZETARGET_RELATIVE;
diff --git a/client/python/hlrc_client/MiddlewareROS.py b/client/python/hlrc_client/MiddlewareROS.py
index 1194dee..908d703 100644
--- a/client/python/hlrc_client/MiddlewareROS.py
+++ b/client/python/hlrc_client/MiddlewareROS.py
@@ -170,7 +170,16 @@ class MiddlewareROS(Middleware):
 		goal.vergence = gaze.vergence
 		goal.pan_offset  = gaze.pan_offset
 		goal.tilt_offset = gaze.tilt_offset
-		
+
+		#type
+		if (gaze.gaze_type == RobotGaze.ABSOLUTE):
+			goal.gaze_type = gazetargetGoal.ABSOLUTE
+		else:
+			goal.gaze_type = gazetargetGoal.RELATIVE
+
+		goal.timestamp = rospy.Time.from_sec(timestamp)
+	
+	
 		#send the goal to the server
 		self.gazetarget_client.send_goal(goal)
 		
@@ -280,4 +289,4 @@ class MiddlewareROS(Middleware):
 			return emotionstateGoal.FEAR
 		else:
 			self.logger.error("invalid emotion type %d\n" % (value))
-			return  emotionstateGoal.NEUTRAL
\ No newline at end of file
+			return  emotionstateGoal.NEUTRAL
diff --git a/client/python/hlrc_client/RobotGaze.py b/client/python/hlrc_client/RobotGaze.py
index 3975b8d..256fc1b 100644
--- a/client/python/hlrc_client/RobotGaze.py
+++ b/client/python/hlrc_client/RobotGaze.py
@@ -26,6 +26,9 @@ Excellence Initiative.
 """
 
 class RobotGaze:
+	GAZETARGET_ABSOLUTE = 0
+	GAZETARGET_RELATIVE = 1
+
 	def __init__(self):
 		self.pan = 0.0
 		self.tilt = 0.0
@@ -33,7 +36,13 @@ class RobotGaze:
 		self.vergence = 0.0
 		self.pan_offset = 0.0
 		self.tilt_offset = 0.0
+		self.gaze_type = GAZETARGET_ABSOLUTE
+		self.timestamp = self.now()
 		
 	def __str__(self):
-		return "RobotGaze = { PTR={%6.2f %6.2f %6.2f} vergence=%6.2f PT_offset={%6.2f %6.2f} }"  \
-			% (self.pan, self.tilt,self.roll,self.vergence,self.pan_offset,self.tilt_offset)
+		if (self.gaze_type == GAZETARGET_ABSOLUTE):
+			type_s = "ABSOLUTE"
+		else:
+			type_s = "RELATIVE"
+		return "RobotGaze = { PTR={%6.2f %6.2f %6.2f} vergence=%6.2f PT_offset={%6.2f %6.2f} [%s]}"  \
+			% (self.pan, self.tilt,self.roll,self.vergence,self.pan_offset,self.tilt_offset,type_s)
