commit 70c546172c92ef3dcd6336a16733fbd8ef53eefc
Author: Simon Schulz <sschulz@cit-ec.uni-bielefeld.de>
Date:   Mon Dec 7 12:53:41 2015 +0100

    fixed intent to make flier happy. thats your christmas present ;)

diff --git a/client/python/hlrc_client/Middleware.py b/client/python/hlrc_client/Middleware.py
index e56ca14..498e703 100644
--- a/client/python/hlrc_client/Middleware.py
+++ b/client/python/hlrc_client/Middleware.py
@@ -35,116 +35,116 @@ from RobotAnimation import *
 class Middleware:
     #######################################################################
     def __init__(self, scope, loglevel=logging.WARNING):
-	"""initialise
-	:param scope: base scope we want to listen on
-	"""
-	self.base_scope = scope
-
-	self.logger = logging.getLogger(__name__)
-
-	# create nice and actually usable formatter and add it to the handler
-	self.config_logger(loglevel)
-
-	#initialise defaults
-	self.default_emotion = RobotEmotion()
-	self.current_emotion = RobotEmotion()
-	self.gaze_target = RobotGaze()
-	self.mouth_target = RobotMouth()
-	self.robot_animation = RobotAnimation()
-
-	def __del__(self):
-	    """destructor
-	    """
-	    self.logger.debug("destructor of Middleware called")
-
-	    def config_logger(self, level):
-		formatter = logging.Formatter('%(asctime)s %(name)-30s %(levelname)-8s > %(message)s')
-		ch = logging.StreamHandler()
-		#ch.setLevel(level)
-		ch.setFormatter(formatter)
-		self.logger.setLevel(level)
-		self.logger.addHandler(ch)
-
-		#######################################################################
-		#abstract/virtual functions
-		def die_virtual(self, funcname):
-		    raise NotImplementedError(funcname + "() is virtual, must be overwritten")
-
-		def init_middleware(self):
-		    self.die_virtual(sys._getframe().f_code.co_name)
-
-		    def publish_default_emotion(self, emotion, blocking):
-			self.die_virtual(sys._getframe().f_code.co_name)
-
-			def publish_current_emotion(self, emotion, blocking):
-			    self.die_virtual(sys._getframe().f_code.co_name)
-
-			    def publish_gaze_target(self, gaze, blocking):
-				self.die_virtual(sys._getframe().f_code.co_name)
-
-				def publish_mouth_target(self, mouth, blocking):
-				    self.die_virtual(sys._getframe().f_code.co_name)
-
-				    def publish_head_animation(self, animation, blocking):
-					self.die_virtual(sys._getframe().f_code.co_name)
-
-					def publish_speech(self, text, blocking):
-					    self.die_virtual(sys._getframe().f_code.co_name)
-
-					    #######################################################################
-					    #finally some implemented functions
-					    def set_default_emotion(self, emotion, blocking):
-						"""set the default emotion
-						:param emotion: RobotEmotion to set
-						:param blocking: True if this call should block until execution finished on robot
-						"""
-						self.default_emotion = emotion
-						self.publish_default_emotion(emotion, blocking)
-
-						def set_current_emotion(self, emotion, blocking):
-						    """set a temporary emotion (duration: see emotion.time_ms)
-						    :param emotion: RobotEmotion to set temporarily
-						    :param blocking: True if this call should block until execution finished on robot
-						    """
-						    self.current_emotion = emotion
-						    self.publish_current_emotion(emotion, blocking)
-
-						    def set_head_animation(self, animation, blocking):
-							"""trigger a head animation
-							:param animation: RobotAnimation to set
-							:param blocking: True if this call should block until execution finished on robot
-							"""
-							self.animation = animation
-							self.publish_head_animation(animation, blocking)
-
-							def set_mouth_target(self, mouth, blocking):
-							    """set a mouth target
-							    :param mouth: RobotMouth to set
-							    :param blocking: True if this call should block until execution finished on robot
-							    """
-							    self.mouth_target = mouth
-							    self.publish_mouth_target(mouth, blocking)
-
-							    def set_speak(self, text, blocking):
-								"""trigger a tts speech output
-								:param text: text to synthesize and speak
-								:param blocking: True if this call should block until execution finished on robot
-								"""
-								self.publish_speech(text, blocking)
-
-								def set_gaze_target(self, gaze, blocking):
-								    """set a new gaze
-								    :param gaze: RobotGaze to set
-								    :param blocking: True if this call should block until execution finished on robot
-								    """
-								    self.gaze_target = gaze
-								    self.publish_gaze_target(gaze, blocking)
-
-								    #######################################################################
-								    #some get methods
-								    #def get_current_emotion(self):
-									#	return self.current_emotion
-									#
-									#def get_default_emotion(self):
-									    #	return self.default_emotion
-									    #
+        """initialise
+        :param scope: base scope we want to listen on
+        """
+        self.base_scope = scope
+
+        self.logger = logging.getLogger(__name__)
+
+        # create nice and actually usable formatter and add it to the handler
+        self.config_logger(loglevel)
+
+        #initialise defaults
+        self.default_emotion = RobotEmotion()
+        self.current_emotion = RobotEmotion()
+        self.gaze_target = RobotGaze()
+        self.mouth_target = RobotMouth()
+        self.robot_animation = RobotAnimation()
+
+    def __del__(self):
+        """destructor
+        """
+        self.logger.debug("destructor of Middleware called")
+
+    def config_logger(self, level):
+        formatter = logging.Formatter('%(asctime)s %(name)-30s %(levelname)-8s > %(message)s')
+        ch = logging.StreamHandler()
+        #ch.setLevel(level)
+        ch.setFormatter(formatter)
+        self.logger.setLevel(level)
+        self.logger.addHandler(ch)
+
+    #######################################################################
+    #abstract/virtual functions
+    def die_virtual(self, funcname):
+        raise NotImplementedError(funcname + "() is virtual, must be overwritten")
+
+    def init_middleware(self):
+        self.die_virtual(sys._getframe().f_code.co_name)
+
+    def publish_default_emotion(self, emotion, blocking):
+        self.die_virtual(sys._getframe().f_code.co_name)
+
+    def publish_current_emotion(self, emotion, blocking):
+        self.die_virtual(sys._getframe().f_code.co_name)
+
+    def publish_gaze_target(self, gaze, blocking):
+        self.die_virtual(sys._getframe().f_code.co_name)
+
+    def publish_mouth_target(self, mouth, blocking):
+        self.die_virtual(sys._getframe().f_code.co_name)
+
+    def publish_head_animation(self, animation, blocking):
+        self.die_virtual(sys._getframe().f_code.co_name)
+
+    def publish_speech(self, text, blocking):
+        self.die_virtual(sys._getframe().f_code.co_name)
+
+    #######################################################################
+    #finally some implemented functions
+    def set_default_emotion(self, emotion, blocking):
+        """set the default emotion
+        :param emotion: RobotEmotion to set
+        :param blocking: True if this call should block until execution finished on robot
+        """
+        self.default_emotion = emotion
+        self.publish_default_emotion(emotion, blocking)
+
+    def set_current_emotion(self, emotion, blocking):
+        """set a temporary emotion (duration: see emotion.time_ms)
+        :param emotion: RobotEmotion to set temporarily
+        :param blocking: True if this call should block until execution finished on robot
+        """
+        self.current_emotion = emotion
+        self.publish_current_emotion(emotion, blocking)
+
+    def set_head_animation(self, animation, blocking):
+        """trigger a head animation
+        :param animation: RobotAnimation to set
+        :param blocking: True if this call should block until execution finished on robot
+        """
+        self.animation = animation
+        self.publish_head_animation(animation, blocking)
+
+    def set_mouth_target(self, mouth, blocking):
+        """set a mouth target
+        :param mouth: RobotMouth to set
+        :param blocking: True if this call should block until execution finished on robot
+        """
+        self.mouth_target = mouth
+        self.publish_mouth_target(mouth, blocking)
+
+    def set_speak(self, text, blocking):
+        """trigger a tts speech output
+        :param text: text to synthesize and speak
+        :param blocking: True if this call should block until execution finished on robot
+        """
+        self.publish_speech(text, blocking)
+
+    def set_gaze_target(self, gaze, blocking):
+        """set a new gaze
+        :param gaze: RobotGaze to set
+        :param blocking: True if this call should block until execution finished on robot
+        """
+        self.gaze_target = gaze
+        self.publish_gaze_target(gaze, blocking)
+
+    #######################################################################
+    #some get methods
+    #def get_current_emotion(self):
+    #       return self.current_emotion
+    #
+    #def get_default_emotion(self):
+    #       return self.default_emotion
+    #
diff --git a/client/python/hlrc_client/MiddlewareROS.py b/client/python/hlrc_client/MiddlewareROS.py
index 3fe7acf..c21b455 100644
--- a/client/python/hlrc_client/MiddlewareROS.py
+++ b/client/python/hlrc_client/MiddlewareROS.py
@@ -28,8 +28,8 @@ Excellence Initiative.
 from Middleware import *
 import errno
 
-import roslib; 
-import rospy 
+import roslib;
+import rospy
 import actionlib
 from hlrc_server.msg import *
 
@@ -39,247 +39,247 @@ class MiddlewareROS(Middleware):
 
     #######################################################################
     def __init__(self, scope, loglevel=logging.WARNING):
-	"""initialise
-	:param scope: base scope we want to listen on
-	"""
-	#init base settings
-	Middleware.__init__(self,scope,loglevel)
-	#call mw init
-	self.init_middleware()
-
-	def __del__(self):
-	    """destructor
-	    """
-	    self.logger.debug("destructor of MiddlewareROS called")
-
-	    #######################################################################
-	    def init_middleware(self):
-		"""initialise middleware
-		"""
-		self.logger.info("initialising ROS middleware connection on scope %s" % (self.base_scope))
-		
-		rospy.init_node('hlrc_client', anonymous=True)
-		
-		self.logger.info("creating action clients")
-		
-		self.logger.debug("creating speech action client")
-		self.speech_client = actionlib.SimpleActionClient(self.base_scope + "/set/speech", speechAction)
-		self.speech_client.wait_for_server()
-		
-		self.logger.debug("creating default emotion action client")
-		self.default_emotion_client = actionlib.SimpleActionClient(self.base_scope + "/set/defaultEmotion", emotionstateAction)
-		self.default_emotion_client.wait_for_server()
-		
-		self.logger.debug("creating current emotion action client")
-		self.current_emotion_client = actionlib.SimpleActionClient(self.base_scope + "/set/currentEmotion", emotionstateAction)
-		self.current_emotion_client.wait_for_server()
-		
-		self.logger.debug("creating animation action client")
-		self.animation_client = actionlib.SimpleActionClient(self.base_scope + "/set/animation", animationAction)
-		self.animation_client.wait_for_server()
-		
-		self.logger.debug("creating gazetarget action client")
-		self.gazetarget_client = actionlib.SimpleActionClient(self.base_scope + "/set/gaze", gazetargetAction)
-		self.gazetarget_client.wait_for_server()
-		
-		self.logger.debug("creating mouthtarget action client")
-		self.mouthtarget_client = actionlib.SimpleActionClient(self.base_scope + "/set/mouth", mouthtargetAction)
-		self.mouthtarget_client.wait_for_server()
-		
-		self.logger.info("MiddlewareROS initialised")
-		
-
-		#######################################################################
-		def publish_emotion(self, em_type, emotion, blocking):
-		    """publish an emotion via mw
-		    :param em_type: type of emotion (RobotEmotion::TYPE_DEFAULT or RobotEmotion::TYPE_CURRENT)
-		    :param emotion: emotion to set
-		    :param blocking: True if this call should block until execution finished on robot
-		    """
-		    self.logger.debug("calling the emotion rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
-
-		    #create a goal to send to the action server.
-		    goal = emotionstateGoal()
-		    goal.value    = self.convert_emotiontype_to_rosval(emotion.value)
-		    goal.duration =  int(emotion.time_ms)
-
-		    #which client do we use?
-		    if (em_type == RobotEmotion.TYPE_DEFAULT):
-			client = self.default_emotion_client
-			else:
-			    client = self.current_emotion_client
-
-			    #send the goal to the server
-			    client.send_goal(goal)
-
-			    #wait for the server to finish
-			    if (blocking):
-				timed_out = client.wait_for_result(rospy.Duration.from_sec(MiddlewareROS.ROS_ACTION_CALL_TIMEOUT))
-				if (timed_out):
-				    self.logger.error("%s timed out waiting for result" % (sys._getframe().f_code.co_name))
-
-				    def publish_default_emotion(self, emotion, blocking):
-					self.publish_emotion(RobotEmotion.TYPE_DEFAULT, emotion, blocking)
-
-					def publish_current_emotion(self, emotion, blocking):
-					    self.publish_emotion(RobotEmotion.TYPE_CURRENT, emotion, blocking)
-
-					    def publish_head_animation(self, animation, blocking):
-						"""publish an head animation via mw
-						:param animation: animation to set
-						:param blocking: True if this call should block until execution finished on robot
-						"""
-						self.logger.debug("calling the animation rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
-
-						#create a goal to send to the action server.
-						goal = animationGoal()
-						goal.target = self.convert_animationtype_to_rosval(animation.value)
-						goal.repetitions = animation.repetitions
-						goal.duration_each =  int(animation.time_ms)
-						goal.scale = animation.scale
-
-						#send the goal to the server
-						self.animation_client.send_goal(goal)
-
-						#wait for the server to finish
-						if (blocking):
-						    timed_out = self.animation_client.wait_for_result(rospy.Duration.from_sec(MiddlewareROS.ROS_ACTION_CALL_TIMEOUT))
-						    if (timed_out):
-							self.logger.error("%s timed out waiting for result" % (sys._getframe().f_code.co_name))
-
-							self.logger.debug("animation rpc done")
-
-							def publish_gaze_target(self, gaze, blocking):
-							    """publish a gaze target via mw
-							    :param gaze: gaze to set
-							    :param blocking: True if this call should block until execution finished on robot
-							    """
-							    self.logger.debug("calling the gaze rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
-
-							    #create a goal to send to the action server.
-							    goal = gazetargetGoal()
-							    goal.pan  = gaze.pan
-							    goal.tilt = gaze.tilt
-							    goal.roll = gaze.roll
-							    goal.vergence = gaze.vergence
-							    goal.pan_offset  = gaze.pan_offset
-							    goal.tilt_offset = gaze.tilt_offset
-
-							    #type
-							    if (gaze.gaze_type == RobotGaze.GAZETARGET_ABSOLUTE):
-								goal.gaze_type = gazetargetGoal.GAZETARGET_ABSOLUTE
-								else:
-								    goal.gaze_type = gazetargetGoal.GAZETARGET_RELATIVE
-
-								    goal.timestamp = rospy.Time.from_sec(gaze.timestamp)
-
-								    #send the goal to the server
-								    self.gazetarget_client.send_goal(goal)
-
-								    #wait for the server to finish
-								    if (blocking):
-									timed_out = self.gazetarget_client.wait_for_result(rospy.Duration.from_sec(MiddlewareROS.ROS_ACTION_CALL_TIMEOUT))
-									if (timed_out):
-									    self.logger.error("%s timed out waiting for result" % (sys._getframe().f_code.co_name))
-
-
-									    self.logger.debug("gaze rpc done")
-
-									    def publish_mouth_target(self, mouth, blocking):
-										"""publish a mouth target via mw
-										:param mouth: mouth value to set
-										:param blocking: True if this call should block until execution finished on robot
-										"""
-										self.logger.debug("calling the mouth rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
-
-										#create a goal to send to the action server.
-										goal = mouthtargetGoal()
-										goal.opening_left  = mouth.opening_left
-										goal.opening_center = mouth.opening_center
-										goal.opening_right = mouth.opening_right
-										goal.position_left = mouth.position_left
-										goal.position_center  = mouth.position_center
-										goal.position_right = mouth.position_right
-
-										#send the goal to the server
-										self.mouthtarget_client.send_goal(goal)
-
-										#wait for the server to finish
-										if (blocking):
-										    timed_out = self.mouthtarget_client.wait_for_result(rospy.Duration.from_sec(MiddlewareROS.ROS_ACTION_CALL_TIMEOUT))
-										    if (timed_out):
-											self.logger.error("%s timed out waiting for result" % (sys._getframe().f_code.co_name))
-
-											self.logger.debug("mouth rpc done")
-
-											def publish_speech(self, text_, blocking):
-											    """publish a tts request via mw
-											    :param text_: text to synthesize and speak
-											    :param blocking: True if this call should block until execution finished on robot
-											    """
-											    self.logger.debug("calling the speech rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
-
-											    #create a goal to send to the action server.
-											    goal = speechGoal(text=text_)
-
-											    #send the goal to the server
-											    self.speech_client.send_goal(goal)
-
-											    #wait for the server to finish
-											    if (blocking):
-												timed_out = self.speech_client.wait_for_result(rospy.Duration.from_sec(MiddlewareROS.ROS_ACTION_CALL_TIMEOUT))
-												if (timed_out):
-												    self.logger.error("%s timed out waiting for result" % (sys._getframe().f_code.co_name))
-
-												    self.logger.debug("speech rpc done")
-
-												    #######################################################################
-												    # some helpers
-												    def convert_animationtype_to_rosval(self, value):
-													"""convert RobotAnimation.value to ROS animation value
-													:param value: RobotAnimation.* id to convert to rsb id
-													"""
-													#NOTE: this convertion is important as the actual integer values of
-													#      thy python api and the protobuf might be different
-													if (value == RobotAnimation.IDLE):
-													    return animationGoal.IDLE
-													elif (value == RobotAnimation.HEAD_NOD):
-													    return animationGoal.HEAD_NOD
-													elif (value == RobotAnimation.HEAD_SHAKE):
-													    return animationGoal.HEAD_SHAKE
-													elif (value == RobotAnimation.EYEBLINK_L):
-													    return animationGoal.EYEBLINK_L
-													elif (value == RobotAnimation.EYEBLINK_R):
-													    return  animationGoal.EYEBLINK_R
-													elif (value == RobotAnimation.EYEBLINK_BOTH):
-													    return  animationGoal.EYEBLINK_BOTH
-													elif (value == RobotAnimation.EYEBROWS_RAISE):
-													    return  animationGoal.EYEBROWS_RAISE
-													elif (value == RobotAnimation.EYEBROWS_LOWER):
-													    return  animationGoal.EYEBROWS_LOWER
-													else:
-													    self.logger.error("invalid animation type %d\n" % (value))
-													    return  animationGoal.NEUTRAL
-
-													def convert_emotiontype_to_rosval(self, value):
-													    """convert RobotEmotion.value to ROS animation value
-													    :param value: RobotEmotion.* id to convert to ros id
-													    """
-													    #NOTE: this convertion is important as the actual integer values of
-													    #      thy python api and the protobuf might be different
-
-													    if (value == RobotEmotion.NEUTRAL):
-														return emotionstateGoal.NEUTRAL
-													    elif (value == RobotEmotion.HAPPY):
-														return emotionstateGoal.HAPPY
-													    elif (value == RobotEmotion.SAD):
-														return emotionstateGoal.SAD
-													    elif (value == RobotEmotion.ANGRY):
-														return emotionstateGoal.ANGRY
-													    elif (value == RobotEmotion.SURPRISED):
-														return  emotionstateGoal.SURPRISED
-													    elif (value == RobotEmotion.FEAR):
-														return emotionstateGoal.FEAR
-													    else:
-														self.logger.error("invalid emotion type %d\n" % (value))
-														return  emotionstateGoal.NEUTRAL
+        """initialise
+        :param scope: base scope we want to listen on
+        """
+        #init base settings
+        Middleware.__init__(self,scope,loglevel)
+        #call mw init
+        self.init_middleware()
+
+    def __del__(self):
+        """destructor
+        """
+        self.logger.debug("destructor of MiddlewareROS called")
+
+    #######################################################################
+    def init_middleware(self):
+        """initialise middleware
+        """
+        self.logger.info("initialising ROS middleware connection on scope %s" % (self.base_scope))
+
+        rospy.init_node('hlrc_client', anonymous=True)
+
+        self.logger.info("creating action clients")
+
+        self.logger.debug("creating speech action client")
+        self.speech_client = actionlib.SimpleActionClient(self.base_scope + "/set/speech", speechAction)
+        self.speech_client.wait_for_server()
+
+        self.logger.debug("creating default emotion action client")
+        self.default_emotion_client = actionlib.SimpleActionClient(self.base_scope + "/set/defaultEmotion", emotionstateAction)
+        self.default_emotion_client.wait_for_server()
+
+        self.logger.debug("creating current emotion action client")
+        self.current_emotion_client = actionlib.SimpleActionClient(self.base_scope + "/set/currentEmotion", emotionstateAction)
+        self.current_emotion_client.wait_for_server()
+
+        self.logger.debug("creating animation action client")
+        self.animation_client = actionlib.SimpleActionClient(self.base_scope + "/set/animation", animationAction)
+        self.animation_client.wait_for_server()
+
+        self.logger.debug("creating gazetarget action client")
+        self.gazetarget_client = actionlib.SimpleActionClient(self.base_scope + "/set/gaze", gazetargetAction)
+        self.gazetarget_client.wait_for_server()
+
+        self.logger.debug("creating mouthtarget action client")
+        self.mouthtarget_client = actionlib.SimpleActionClient(self.base_scope + "/set/mouth", mouthtargetAction)
+        self.mouthtarget_client.wait_for_server()
+
+        self.logger.info("MiddlewareROS initialised")
+
+
+    #######################################################################
+    def publish_emotion(self, em_type, emotion, blocking):
+        """publish an emotion via mw
+        :param em_type: type of emotion (RobotEmotion::TYPE_DEFAULT or RobotEmotion::TYPE_CURRENT)
+        :param emotion: emotion to set
+        :param blocking: True if this call should block until execution finished on robot
+        """
+        self.logger.debug("calling the emotion rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
+
+        #create a goal to send to the action server.
+        goal = emotionstateGoal()
+        goal.value    = self.convert_emotiontype_to_rosval(emotion.value)
+        goal.duration =  int(emotion.time_ms)
+
+        #which client do we use?
+        if (em_type == RobotEmotion.TYPE_DEFAULT):
+            client = self.default_emotion_client
+        else:
+            client = self.current_emotion_client
+
+        #send the goal to the server
+        client.send_goal(goal)
+
+        #wait for the server to finish
+        if (blocking):
+            timed_out = client.wait_for_result(rospy.Duration.from_sec(MiddlewareROS.ROS_ACTION_CALL_TIMEOUT))
+            if (timed_out):
+                self.logger.error("%s timed out waiting for result" % (sys._getframe().f_code.co_name))
+
+    def publish_default_emotion(self, emotion, blocking):
+        self.publish_emotion(RobotEmotion.TYPE_DEFAULT, emotion, blocking)
+
+    def publish_current_emotion(self, emotion, blocking):
+        self.publish_emotion(RobotEmotion.TYPE_CURRENT, emotion, blocking)
+
+    def publish_head_animation(self, animation, blocking):
+        """publish an head animation via mw
+        :param animation: animation to set
+        :param blocking: True if this call should block until execution finished on robot
+        """
+        self.logger.debug("calling the animation rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
+
+        #create a goal to send to the action server.
+        goal = animationGoal()
+        goal.target = self.convert_animationtype_to_rosval(animation.value)
+        goal.repetitions = animation.repetitions
+        goal.duration_each =  int(animation.time_ms)
+        goal.scale = animation.scale
+
+        #send the goal to the server
+        self.animation_client.send_goal(goal)
+
+        #wait for the server to finish
+        if (blocking):
+            timed_out = self.animation_client.wait_for_result(rospy.Duration.from_sec(MiddlewareROS.ROS_ACTION_CALL_TIMEOUT))
+            if (timed_out):
+                self.logger.error("%s timed out waiting for result" % (sys._getframe().f_code.co_name))
+
+        self.logger.debug("animation rpc done")
+
+    def publish_gaze_target(self, gaze, blocking):
+        """publish a gaze target via mw
+        :param gaze: gaze to set
+        :param blocking: True if this call should block until execution finished on robot
+        """
+        self.logger.debug("calling the gaze rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
+
+        #create a goal to send to the action server.
+        goal = gazetargetGoal()
+        goal.pan  = gaze.pan
+        goal.tilt = gaze.tilt
+        goal.roll = gaze.roll
+        goal.vergence = gaze.vergence
+        goal.pan_offset  = gaze.pan_offset
+        goal.tilt_offset = gaze.tilt_offset
+
+        #type
+        if (gaze.gaze_type == RobotGaze.GAZETARGET_ABSOLUTE):
+            goal.gaze_type = gazetargetGoal.GAZETARGET_ABSOLUTE
+        else:
+            goal.gaze_type = gazetargetGoal.GAZETARGET_RELATIVE
+
+        goal.timestamp = rospy.Time.from_sec(gaze.timestamp)
+
+        #send the goal to the server
+        self.gazetarget_client.send_goal(goal)
+
+        #wait for the server to finish
+        if (blocking):
+            timed_out = self.gazetarget_client.wait_for_result(rospy.Duration.from_sec(MiddlewareROS.ROS_ACTION_CALL_TIMEOUT))
+            if (timed_out):
+                self.logger.error("%s timed out waiting for result" % (sys._getframe().f_code.co_name))
+
+
+        self.logger.debug("gaze rpc done")
+
+    def publish_mouth_target(self, mouth, blocking):
+        """publish a mouth target via mw
+        :param mouth: mouth value to set
+        :param blocking: True if this call should block until execution finished on robot
+        """
+        self.logger.debug("calling the mouth rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
+
+        #create a goal to send to the action server.
+        goal = mouthtargetGoal()
+        goal.opening_left  = mouth.opening_left
+        goal.opening_center = mouth.opening_center
+        goal.opening_right = mouth.opening_right
+        goal.position_left = mouth.position_left
+        goal.position_center  = mouth.position_center
+        goal.position_right = mouth.position_right
+
+        #send the goal to the server
+        self.mouthtarget_client.send_goal(goal)
+
+        #wait for the server to finish
+        if (blocking):
+            timed_out = self.mouthtarget_client.wait_for_result(rospy.Duration.from_sec(MiddlewareROS.ROS_ACTION_CALL_TIMEOUT))
+            if (timed_out):
+                self.logger.error("%s timed out waiting for result" % (sys._getframe().f_code.co_name))
+
+        self.logger.debug("mouth rpc done")
+
+    def publish_speech(self, text_, blocking):
+        """publish a tts request via mw
+        :param text_: text to synthesize and speak
+        :param blocking: True if this call should block until execution finished on robot
+        """
+        self.logger.debug("calling the speech rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
+
+        #create a goal to send to the action server.
+        goal = speechGoal(text=text_)
+
+        #send the goal to the server
+        self.speech_client.send_goal(goal)
+
+        #wait for the server to finish
+        if (blocking):
+            timed_out = self.speech_client.wait_for_result(rospy.Duration.from_sec(MiddlewareROS.ROS_ACTION_CALL_TIMEOUT))
+            if (timed_out):
+                self.logger.error("%s timed out waiting for result" % (sys._getframe().f_code.co_name))
+
+        self.logger.debug("speech rpc done")
+
+    #######################################################################
+    # some helpers
+    def convert_animationtype_to_rosval(self, value):
+        """convert RobotAnimation.value to ROS animation value
+        :param value: RobotAnimation.* id to convert to rsb id
+        """
+        #NOTE: this convertion is important as the actual integer values of
+        #      thy python api and the protobuf might be different
+        if (value == RobotAnimation.IDLE):
+            return animationGoal.IDLE
+        elif (value == RobotAnimation.HEAD_NOD):
+            return animationGoal.HEAD_NOD
+        elif (value == RobotAnimation.HEAD_SHAKE):
+            return animationGoal.HEAD_SHAKE
+        elif (value == RobotAnimation.EYEBLINK_L):
+            return animationGoal.EYEBLINK_L
+        elif (value == RobotAnimation.EYEBLINK_R):
+            return  animationGoal.EYEBLINK_R
+        elif (value == RobotAnimation.EYEBLINK_BOTH):
+            return  animationGoal.EYEBLINK_BOTH
+        elif (value == RobotAnimation.EYEBROWS_RAISE):
+            return  animationGoal.EYEBROWS_RAISE
+        elif (value == RobotAnimation.EYEBROWS_LOWER):
+            return  animationGoal.EYEBROWS_LOWER
+        else:
+            self.logger.error("invalid animation type %d\n" % (value))
+            return  animationGoal.NEUTRAL
+
+    def convert_emotiontype_to_rosval(self, value):
+        """convert RobotEmotion.value to ROS animation value
+        :param value: RobotEmotion.* id to convert to ros id
+        """
+        #NOTE: this convertion is important as the actual integer values of
+        #      thy python api and the protobuf might be different
+
+        if (value == RobotEmotion.NEUTRAL):
+            return emotionstateGoal.NEUTRAL
+        elif (value == RobotEmotion.HAPPY):
+            return emotionstateGoal.HAPPY
+        elif (value == RobotEmotion.SAD):
+            return emotionstateGoal.SAD
+        elif (value == RobotEmotion.ANGRY):
+            return emotionstateGoal.ANGRY
+        elif (value == RobotEmotion.SURPRISED):
+            return  emotionstateGoal.SURPRISED
+        elif (value == RobotEmotion.FEAR):
+            return emotionstateGoal.FEAR
+        else:
+            self.logger.error("invalid emotion type %d\n" % (value))
+            return  emotionstateGoal.NEUTRAL
diff --git a/client/python/hlrc_client/MiddlewareRSB.py b/client/python/hlrc_client/MiddlewareRSB.py
index bb05045..d8d6c56 100644
--- a/client/python/hlrc_client/MiddlewareRSB.py
+++ b/client/python/hlrc_client/MiddlewareRSB.py
@@ -40,244 +40,244 @@ from rst.robot.MouthTarget_pb2  import MouthTarget
 class MiddlewareRSB(Middleware):
     #######################################################################
     def __init__(self, scope, loglevel=logging.WARNING):
-	"""initialise
-	:param scope: base scope we want to listen on
-	"""
-	#init base settings
-	Middleware.__init__(self,scope,loglevel)
-	#call mw init
-	self.init_middleware()
-
-	def __del__(self):
-	    """destructor
-	    """
-	    self.logger.debug("destructor of MiddlewareROS called")
-
-	    #######################################################################
-	    def init_middleware(self):
-		"""initialise middleware
-		"""
-		#mute rsb logging:
-		    logging.getLogger("rsb").setLevel(logging.ERROR)
-
-		    #initialise RSB stuff
-		    self.logger.info("initialising RSB middleware connection on scope %s, registering rst converters..." % (self.base_scope))
-
-		    self.emotionstate_converter = rsb.converter.ProtocolBufferConverter(messageClass = EmotionState)
-		    rsb.converter.registerGlobalConverter(self.emotionstate_converter)
-
-		    self.animation_converter = rsb.converter.ProtocolBufferConverter(messageClass = Animation)
-		    rsb.converter.registerGlobalConverter(self.animation_converter)
-
-		    self.gaze_converter = rsb.converter.ProtocolBufferConverter(messageClass = GazeTarget)
-		    rsb.converter.registerGlobalConverter(self.gaze_converter)
-
-		    self.mouth_converter = rsb.converter.ProtocolBufferConverter(messageClass = MouthTarget)
-		    rsb.converter.registerGlobalConverter(self.mouth_converter)
-
-		    try:
-			self.server = rsb.createRemoteServer(self.base_scope + '/set')
-			except ValueError:
-			    self.logger.error("ERROR: invalid scope given. server deactivated")
-			    self.server.deactivate()
-			    sys.exit(errno.EINVAL)
-
-			    #######################################################################
-			    def publish_emotion(self, em_type, emotion, blocking):
-				"""publish an emotion via mw
-				:param em_type: type of emotion (RobotEmotion::TYPE_DEFAULT or RobotEmotion::TYPE_CURRENT)
-				:param emotion: emotion to set
-				:param blocking: True if this call should block until execution finished on robot
-				"""
-
-				#create emotion & fill it with values:
-				    rsb_em = EmotionState()
-
-				    #set value
-				    rsb_em.value = self.convert_emotiontype_to_rsbval(emotion.value)
-
-				    #set duration
-				    rsb_em.duration = int(emotion.time_ms)
-
-				    with rsb.createRemoteServer(self.base_scope + '/set') as server:
-					self.logger.debug("calling the emotion rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
-
-					if (blocking):
-					    #blocking rpc call:
-						if (em_type == RobotEmotion.TYPE_DEFAULT):
-						    result = server.defaultEmotion(rsb_em)
-						    else:
-							result = server.currentEmotion(rsb_em)
-
-							self.logger.debug("server reply: '%s'" % result)
-							else:
-							    if (em_type == RobotEmotion.TYPE_DEFAULT):
-								future = server.defaultEmotion.async(rsb_em)
-								else:
-								    future = server.currentEmotion.async(rsb_em)
-
-								    #we could block here for a incoming result with a timeout in s
-								    #print '> server reply: "%s"' % future.get(timeout = 10);
-								    self.logger.debug("emotion rpc done")
-
-								    def publish_head_animation(self, animation, blocking):
-									"""publish an head animation via mw
-									:param animation: animation to set
-									:param blocking: True if this call should block until execution finished on robot
-									"""
-
-									self.logger.debug("calling the animation rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
-
-									#create animation & fill it with values:
-									    rsb_ani = Animation()
-
-									    #select ani
-									    rsb_ani.target = self.convert_animationtype_to_rsbval(animation.value)
-									    rsb_ani.repetitions = animation.repetitions
-									    rsb_ani.duration_each = animation.time_ms
-									    rsb_ani.scale       = animation.scale
-
-									    if (blocking):
-										#blocking:
-										    result = self.server.animation(rsb_ani)
-										    self.logger.debug("server reply: '%s'" % result)
-										    else:
-											future = self.server.animation.async(rsb_ani)
-											#we can block here for a incoming result with a timeout in s
-											#print '> server reply: "%s"' % future.get(timeout = 10);
-
-											self.logger.debug("animation rpc done")
-
-											def publish_default_emotion(self, emotion, blocking):
-											    self.publish_emotion(RobotEmotion.TYPE_DEFAULT, emotion, blocking)
-
-											    def publish_current_emotion(self, emotion, blocking):
-												self.publish_emotion(RobotEmotion.TYPE_CURRENT, emotion, blocking)
-
-												def publish_gaze_target(self, gaze, blocking):
-												    """publish a gaze target via mw
-												    :param gaze: gaze to set
-												    :param blocking: True if this call should block until execution finished on robot
-												    """
-												    self.logger.debug("calling the gaze rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
-
-												    #create gaze target & fill it with values:
-													rsb_gaze = GazeTarget()
-
-													#fill proto
-													rsb_gaze.pan  = gaze.pan
-													rsb_gaze.tilt = gaze.tilt
-													rsb_gaze.roll = gaze.roll
-													rsb_gaze.vergence = gaze.vergence
-													rsb_gaze.pan_offset  = gaze.pan_offset
-													rsb_gaze.tilt_offset = gaze.tilt_offset
-
-													if (blocking):
-													    #blocking:
-														result = self.server.gaze(rsb_gaze)
-														self.logger.debug("server reply: '%s'" % result)
-														else:
-														    future = self.server.gaze.async(rsb_gaze)
-														    #we can block here for a incoming result with a timeout in s
-														    #print '> server reply: "%s"' % future.get(timeout = 10);
-
-														    self.logger.debug("gaze rpc done")
-
-														    def publish_mouth_target(self, mouth, blocking):
-															"""publish a mouth target via mw
-															:param mouth: mouth value to set
-															:param blocking: True if this call should block until execution finished on robot
-															"""
-															self.logger.debug("calling the mouth rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
-
-															#create mouth state & fill it with values:
-															    rsb_mouth = MouthTarget()
-
-															    #fill proto
-															    rsb_mouth.opening_left   = mouth.opening_left
-															    rsb_mouth.opening_center = mouth.opening_center
-															    rsb_mouth.opening_right  = mouth.opening_right
-															    rsb_mouth.position_left  = mouth.position_left
-															    rsb_mouth.position_center = mouth.position_center
-															    rsb_mouth.position_right = mouth.position_right
-
-															    if (blocking):
-																#blocking:
-																    result = self.server.mouth(rsb_mouth)
-																    self.logger.debug("server reply: '%s'" % result)
-																    else:
-																	future = self.server.mouth.async(rsb_mouth)
-																	#we can block here for a incoming result with a timeout in s
-																	#print '> server reply: "%s"' % future.get(timeout = 10);
-
-																	self.logger.debug("mouth rpc done")
-
-																	def publish_speech(self, text, blocking):
-																	    """publish a tts request via mw
-																	    :param text: text to synthesize and speak
-																	    :param blocking: True if this call should block until execution finished on robot
-																	    """
-																	    self.logger.debug("calling the speech rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
-
-																	    if (blocking):
-																		#blocking:
-																		    result = self.server.speech(text)
-																		    self.logger.debug("server reply: '%s'" % result)
-																		    else:
-																			future = self.server.speech.async(text)
-																			#we can block here for a incoming result with a timeout in s
-																			#print '> server reply: "%s"' % future.get(timeout = 10);
-
-																			self.logger.debug("speech rpc done")
-
-																			#######################################################################
-																			# some helpers
-																			def convert_animationtype_to_rsbval(self, value):
-																			    """convert RobotAnimation.value to RSB animation value
-																			    :param value: RobotAnimation.* id to convert to rsb id
-																			    """
-																			    #NOTE: this convertion is important as the actual integer values of
-																			    #      thy python api and the protobuf might be different
-
-																			    if (value == RobotAnimation.IDLE):
-																				return Animation().IDLE
-																			    elif (value == RobotAnimation.HEAD_NOD):
-																				return Animation().HEAD_NOD
-																			    elif (value == RobotAnimation.HEAD_SHAKE):
-																				return Animation().HEAD_SHAKE
-																			    elif (value == RobotAnimation.EYEBLINK_L):
-																				return Animation().EYEBLINK_L
-																			    elif (value == RobotAnimation.EYEBLINK_R):
-																				return  Animation().EYEBLINK_R
-																			    elif (value == RobotAnimation.EYEBLINK_BOTH):
-																				return  Animation().EYEBLINK_BOTH
-																			    elif (value == RobotAnimation.EYEBROWS_RAISE):
-																				return  Animation().EYEBROWS_RAISE
-																			    elif (value == RobotAnimation.EYEBROWS_LOWER):
-																				return  Animation().EYEBROWS_LOWER
-																			    else:
-																				self.logger.error("invalid animation type %d\n" % (value))
-																				return  Animation().NEUTRAL
-
-																			    def convert_emotiontype_to_rsbval(self, value):
-																				"""convert RobotEmotion.value to RSB animation value
-																				:param value: RobotEmotion.* id to convert to rsb id
-																				"""
-																				#NOTE: this convertion is important as the actual integer values of
-																				#      thy python api and the protobuf might be different
-
-																				if (value == RobotEmotion.NEUTRAL):
-																				    return EmotionState().NEUTRAL
-																				elif (value == RobotEmotion.HAPPY):
-																				    return EmotionState().HAPPY
-																				elif (value == RobotEmotion.SAD):
-																				    return EmotionState().SAD
-																				elif (value == RobotEmotion.ANGRY):
-																				    return EmotionState().ANGRY
-																				elif (value == RobotEmotion.SURPRISED):
-																				    return  EmotionState().SURPRISED
-																				elif (value == RobotEmotion.FEAR):
-																				    return EmotionState().FEAR
-																				else:
-																				    self.logger.error("invalid emotion type %d\n" % (value))
-																				    return  EmotionState().NEUTRAL
+        """initialise
+        :param scope: base scope we want to listen on
+        """
+        #init base settings
+        Middleware.__init__(self,scope,loglevel)
+        #call mw init
+        self.init_middleware()
+
+    def __del__(self):
+        """destructor
+        """
+        self.logger.debug("destructor of MiddlewareROS called")
+
+    #######################################################################
+    def init_middleware(self):
+        """initialise middleware
+        """
+        #mute rsb logging:
+        logging.getLogger("rsb").setLevel(logging.ERROR)
+
+        #initialise RSB stuff
+        self.logger.info("initialising RSB middleware connection on scope %s, registering rst converters..." % (self.base_scope))
+
+        self.emotionstate_converter = rsb.converter.ProtocolBufferConverter(messageClass = EmotionState)
+        rsb.converter.registerGlobalConverter(self.emotionstate_converter)
+
+        self.animation_converter = rsb.converter.ProtocolBufferConverter(messageClass = Animation)
+        rsb.converter.registerGlobalConverter(self.animation_converter)
+
+        self.gaze_converter = rsb.converter.ProtocolBufferConverter(messageClass = GazeTarget)
+        rsb.converter.registerGlobalConverter(self.gaze_converter)
+
+        self.mouth_converter = rsb.converter.ProtocolBufferConverter(messageClass = MouthTarget)
+        rsb.converter.registerGlobalConverter(self.mouth_converter)
+
+        try:
+            self.server = rsb.createRemoteServer(self.base_scope + '/set')
+        except ValueError:
+            self.logger.error("ERROR: invalid scope given. server deactivated")
+            self.server.deactivate()
+            sys.exit(errno.EINVAL)
+
+    #######################################################################
+    def publish_emotion(self, em_type, emotion, blocking):
+        """publish an emotion via mw
+        :param em_type: type of emotion (RobotEmotion::TYPE_DEFAULT or RobotEmotion::TYPE_CURRENT)
+        :param emotion: emotion to set
+        :param blocking: True if this call should block until execution finished on robot
+        """
+
+        #create emotion & fill it with values:
+        rsb_em = EmotionState()
+
+        #set value
+        rsb_em.value = self.convert_emotiontype_to_rsbval(emotion.value)
+
+        #set duration
+        rsb_em.duration = int(emotion.time_ms)
+
+        with rsb.createRemoteServer(self.base_scope + '/set') as server:
+            self.logger.debug("calling the emotion rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
+
+            if (blocking):
+                #blocking rpc call:
+                if (em_type == RobotEmotion.TYPE_DEFAULT):
+                    result = server.defaultEmotion(rsb_em)
+                else:
+                    result = server.currentEmotion(rsb_em)
+
+                self.logger.debug("server reply: '%s'" % result)
+            else:
+                if (em_type == RobotEmotion.TYPE_DEFAULT):
+                    future = server.defaultEmotion.async(rsb_em)
+                else:
+                    future = server.currentEmotion.async(rsb_em)
+
+                #we could block here for a incoming result with a timeout in s
+                #print '> server reply: "%s"' % future.get(timeout = 10);
+            self.logger.debug("emotion rpc done")
+
+    def publish_head_animation(self, animation, blocking):
+        """publish an head animation via mw
+        :param animation: animation to set
+        :param blocking: True if this call should block until execution finished on robot
+        """
+
+        self.logger.debug("calling the animation rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
+
+        #create animation & fill it with values:
+        rsb_ani = Animation()
+
+        #select ani
+        rsb_ani.target = self.convert_animationtype_to_rsbval(animation.value)
+        rsb_ani.repetitions = animation.repetitions
+        rsb_ani.duration_each = animation.time_ms
+        rsb_ani.scale       = animation.scale
+
+        if (blocking):
+            #blocking:
+            result = self.server.animation(rsb_ani)
+            self.logger.debug("server reply: '%s'" % result)
+        else:
+            future = self.server.animation.async(rsb_ani)
+            #we can block here for a incoming result with a timeout in s
+            #print '> server reply: "%s"' % future.get(timeout = 10);
+
+        self.logger.debug("animation rpc done")
+
+    def publish_default_emotion(self, emotion, blocking):
+        self.publish_emotion(RobotEmotion.TYPE_DEFAULT, emotion, blocking)
+
+    def publish_current_emotion(self, emotion, blocking):
+        self.publish_emotion(RobotEmotion.TYPE_CURRENT, emotion, blocking)
+
+    def publish_gaze_target(self, gaze, blocking):
+        """publish a gaze target via mw
+        :param gaze: gaze to set
+        :param blocking: True if this call should block until execution finished on robot
+        """
+        self.logger.debug("calling the gaze rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
+
+        #create gaze target & fill it with values:
+        rsb_gaze = GazeTarget()
+
+        #fill proto
+        rsb_gaze.pan  = gaze.pan
+        rsb_gaze.tilt = gaze.tilt
+        rsb_gaze.roll = gaze.roll
+        rsb_gaze.vergence = gaze.vergence
+        rsb_gaze.pan_offset  = gaze.pan_offset
+        rsb_gaze.tilt_offset = gaze.tilt_offset
+
+        if (blocking):
+            #blocking:
+            result = self.server.gaze(rsb_gaze)
+            self.logger.debug("server reply: '%s'" % result)
+        else:
+            future = self.server.gaze.async(rsb_gaze)
+            #we can block here for a incoming result with a timeout in s
+            #print '> server reply: "%s"' % future.get(timeout = 10);
+
+        self.logger.debug("gaze rpc done")
+
+    def publish_mouth_target(self, mouth, blocking):
+        """publish a mouth target via mw
+        :param mouth: mouth value to set
+        :param blocking: True if this call should block until execution finished on robot
+        """
+        self.logger.debug("calling the mouth rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
+
+        #create mouth state & fill it with values:
+        rsb_mouth = MouthTarget()
+
+        #fill proto
+        rsb_mouth.opening_left   = mouth.opening_left
+        rsb_mouth.opening_center = mouth.opening_center
+        rsb_mouth.opening_right  = mouth.opening_right
+        rsb_mouth.position_left  = mouth.position_left
+        rsb_mouth.position_center = mouth.position_center
+        rsb_mouth.position_right = mouth.position_right
+
+        if (blocking):
+            #blocking:
+            result = self.server.mouth(rsb_mouth)
+            self.logger.debug("server reply: '%s'" % result)
+        else:
+            future = self.server.mouth.async(rsb_mouth)
+            #we can block here for a incoming result with a timeout in s
+            #print '> server reply: "%s"' % future.get(timeout = 10);
+
+        self.logger.debug("mouth rpc done")
+
+    def publish_speech(self, text, blocking):
+        """publish a tts request via mw
+        :param text: text to synthesize and speak
+        :param blocking: True if this call should block until execution finished on robot
+        """
+        self.logger.debug("calling the speech rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
+
+        if (blocking):
+            #blocking:
+            result = self.server.speech(text)
+            self.logger.debug("server reply: '%s'" % result)
+        else:
+            future = self.server.speech.async(text)
+            #we can block here for a incoming result with a timeout in s
+            #print '> server reply: "%s"' % future.get(timeout = 10);
+
+        self.logger.debug("speech rpc done")
+
+    #######################################################################
+    # some helpers
+    def convert_animationtype_to_rsbval(self, value):
+        """convert RobotAnimation.value to RSB animation value
+        :param value: RobotAnimation.* id to convert to rsb id
+        """
+        #NOTE: this convertion is important as the actual integer values of
+        #      thy python api and the protobuf might be different
+
+        if (value == RobotAnimation.IDLE):
+            return Animation().IDLE
+        elif (value == RobotAnimation.HEAD_NOD):
+            return Animation().HEAD_NOD
+        elif (value == RobotAnimation.HEAD_SHAKE):
+            return Animation().HEAD_SHAKE
+        elif (value == RobotAnimation.EYEBLINK_L):
+            return Animation().EYEBLINK_L
+        elif (value == RobotAnimation.EYEBLINK_R):
+            return  Animation().EYEBLINK_R
+        elif (value == RobotAnimation.EYEBLINK_BOTH):
+            return  Animation().EYEBLINK_BOTH
+        elif (value == RobotAnimation.EYEBROWS_RAISE):
+            return  Animation().EYEBROWS_RAISE
+        elif (value == RobotAnimation.EYEBROWS_LOWER):
+            return  Animation().EYEBROWS_LOWER
+        else:
+            self.logger.error("invalid animation type %d\n" % (value))
+            return  Animation().NEUTRAL
+
+    def convert_emotiontype_to_rsbval(self, value):
+        """convert RobotEmotion.value to RSB animation value
+        :param value: RobotEmotion.* id to convert to rsb id
+        """
+        #NOTE: this convertion is important as the actual integer values of
+        #      thy python api and the protobuf might be different
+
+        if (value == RobotEmotion.NEUTRAL):
+            return EmotionState().NEUTRAL
+        elif (value == RobotEmotion.HAPPY):
+            return EmotionState().HAPPY
+        elif (value == RobotEmotion.SAD):
+            return EmotionState().SAD
+        elif (value == RobotEmotion.ANGRY):
+            return EmotionState().ANGRY
+        elif (value == RobotEmotion.SURPRISED):
+            return  EmotionState().SURPRISED
+        elif (value == RobotEmotion.FEAR):
+            return EmotionState().FEAR
+        else:
+            self.logger.error("invalid emotion type %d\n" % (value))
+            return  EmotionState().NEUTRAL
diff --git a/client/python/hlrc_client/RobotAnimation.py b/client/python/hlrc_client/RobotAnimation.py
index 6385371..7e3ad6d 100644
--- a/client/python/hlrc_client/RobotAnimation.py
+++ b/client/python/hlrc_client/RobotAnimation.py
@@ -36,31 +36,29 @@ class RobotAnimation:
     EYEBROWS_LOWER  = 7
 
     def __init__(self, v = IDLE):
-	self.value = v
-	self.time_ms = 1000
-	self.repetitions = 1
-	self.scale = 1.0
-
-	def value_as_str(self):
-	    if (self.value == RobotAnimation.IDLE):
-		return "idle"
-	    elif (self.value == RobotAnimation.HEAD_NOD):
-		return "head nod"
-	    elif (self.value == RobotAnimation.HEAD_SHAKE):
-		return "head shake"
-	    elif (self.value == RobotAnimation.EYEBLINK_L):
-		return "eyeblink l"
-	    elif (self.value == RobotAnimation.EYEBLINK_R):
-		return "eyeblink r"
-	    elif (self.value == RobotAnimation.EYEBROWS_RAISE):
-		return "eyebrows raise"
-	    elif (self.value == RobotAnimation.EYEBROWS_LOWER):
-		return "eyebrows lower"
-	    else:
-		return "INVALID ANIMATION TYPE"
-
-	    def __str__(self):
-		return "RobotAnimation = { value='%s', time_ms=%d repetitions=%d scale=%6.2f }" % \
-	    (self.value_as_str(), self.time_ms, self.repetitions, self.scale)
+        self.value = v
+        self.time_ms = 1000
+        self.repetitions = 1
+        self.scale = 1.0
 
+    def value_as_str(self):
+        if (self.value == RobotAnimation.IDLE):
+            return "idle"
+        elif (self.value == RobotAnimation.HEAD_NOD):
+            return "head nod"
+        elif (self.value == RobotAnimation.HEAD_SHAKE):
+            return "head shake"
+        elif (self.value == RobotAnimation.EYEBLINK_L):
+            return "eyeblink l"
+        elif (self.value == RobotAnimation.EYEBLINK_R):
+            return "eyeblink r"
+        elif (self.value == RobotAnimation.EYEBROWS_RAISE):
+            return "eyebrows raise"
+        elif (self.value == RobotAnimation.EYEBROWS_LOWER):
+            return "eyebrows lower"
+        else:
+            return "INVALID ANIMATION TYPE"
 
+    def __str__(self):
+        return "RobotAnimation = { value='%s', time_ms=%d repetitions=%d scale=%6.2f }" % \
+                (self.value_as_str(), self.time_ms, self.repetitions, self.scale)
diff --git a/client/python/hlrc_client/RobotController.py b/client/python/hlrc_client/RobotController.py
index 55c709b..f4731aa 100644
--- a/client/python/hlrc_client/RobotController.py
+++ b/client/python/hlrc_client/RobotController.py
@@ -31,115 +31,115 @@ import errno
 
 class RobotController:
     def __init__(self, mw_name, scope, loglevel=logging.WARNING):
-	"""initialise
-	:param mw_name: which mw to use, currentyl ROS and RSB are supported
-	:param scope: base scope we want to listen on
-	:param  loglevel: optional log level
-	"""
-	self.logger = logging.getLogger(__name__)
-
-	# create nice and actually usable formatter and add it to the handler
-	self.config_logger(loglevel)
-
-	#store
-	self.scope = scope
-	self.mw = mw_name
-	self.loglevel = loglevel
-
-	self.middleware = None
-
-
-	if (self.mw.upper() == "RSB"):
-	    self.logger.info("creating new middleware connection via RSB")
-	    try:
-		from MiddlewareRSB import MiddlewareRSB
-		except ImportError, e:
-		    self.logger.error("failed to import RSB or the necessary data types: {}".format(e))
-		    sys.exit(errno.EINVAL)
-
-		    #import worked, safe to intantiate RSB mw now
-		    self.middleware = MiddlewareRSB(self.scope, self.loglevel)
-
-		    elif (self.mw.upper() == "ROS"):
-			self.logger.info("creating new middleware connection via ROS")
-			try:
-			    from MiddlewareROS import MiddlewareROS
-			    except ImportError, e:
-				self.logger.error("failed to import ROS or the necessary data types: {}".format(e))
-				sys.exit(errno.EINVAL)
-
-				#import worked, safe to intantiate RSB mw now
-				self.middleware = MiddlewareROS(self.scope, self.loglevel)
-				else:
-				    self.logger.error("invalid middleware requested (%s). supported: {ROS, RSB}\n\n" % (self.mw))
-				    sys.exit(errno.EINVAL)
-
-				    def __del__(self):
-					"""destructor
-					"""
-					self.logger.debug("destructor of RobotController called")
-
-					def config_logger(self, level):
-					    """initialise a nice logger formatting
-					    :param  level: log level
-					    """
-					    formatter = logging.Formatter('%(asctime)s %(name)-30s %(levelname)-8s > %(message)s')
-					    ch = logging.StreamHandler()
-					    #ch.setLevel(level)
-					    ch.setFormatter(formatter)
-					    self.logger.setLevel(level)
-					    self.logger.addHandler(ch)
-
-					    def set_current_emotion(self, robot_emotion, blocking = False):
-						"""set the current emotion
-						:param robot_emotion: a RobotEmotion object
-						:param blocking: should this call block during execution?
-						"""
-						self.logger.debug("set_current_emotion(%s) %s" % (robot_emotion, ("BLOCKING" if blocking else "NON_BLOCKING")))
-						self.middleware.set_current_emotion(robot_emotion, blocking)
-
-						def set_default_emotion(self, robot_emotion, blocking = False):
-						    """set the default emotion
-						    :param robot_emotion: a RobotEmotion object
-						    :param blocking: should this call block during execution?
-						    """
-						    self.logger.debug("set_default_emotion(%s) %s" % (robot_emotion, ("BLOCKING" if blocking else "NON_BLOCKING")))
-						    self.middleware.set_default_emotion(robot_emotion, blocking)
-
-						    def set_gaze_target(self, robot_gaze, blocking = False):
-							"""set a gaze target
-							:param robot_gaze: a RobotGaze object
-							:param blocking: should this call block during execution?
-							"""
-
-							self.logger.debug("set_gaze_target(%s) %s" % (robot_gaze, ("BLOCKING" if blocking else "NON_BLOCKING")))
-							self.middleware.set_gaze_target(robot_gaze, blocking)
-
-							def set_mouth_target(self, robot_mouth, blocking = False):
-							    """set a mouth target
-							    :param robot_mouth: a RobotMouth object
-							    :param blocking: should this call block during execution?
-							    """
-							    self.logger.debug("set_mouth_target(%s) %s" % (robot_mouth, ("BLOCKING" if blocking else "NON_BLOCKING")))
-							    self.middleware.set_mouth_target(robot_mouth, blocking)
-
-							    def set_head_animation(self, robot_animation, blocking = False):
-								"""set a head animation
-								:param robot_animation: a RobotAnimation object
-								:param blocking: should this call block during execution?
-								"""
-								self.logger.debug("set_head_animation(%s) %s" % (robot_animation, ("BLOCKING" if blocking else "NON_BLOCKING")))
-								self.middleware.set_head_animation(robot_animation, blocking)
-
-								def set_speak(self, text, blocking = False):
-								    """request the robot to say something using tts
-								    :param text: text to synthesize
-								    :param blocking: should this call block during execution?
-								    """
-								    self.logger.debug("set_speak(%s) %s" % (text, ("BLOCKING" if blocking else "NON_BLOCKING")))
-								    self.middleware.set_speak(text, blocking)
-
-								    #def get_gaze_target(self):
-									#	result = self.middleware.get_gaze_target()
-									#	self.logger.debug("get_gaze_target() returned %s" % (result))
-									#	return self.middleware.get_gaze_target()
+        """initialise
+        :param mw_name: which mw to use, currentyl ROS and RSB are supported
+        :param scope: base scope we want to listen on
+        :param  loglevel: optional log level
+        """
+        self.logger = logging.getLogger(__name__)
+
+        # create nice and actually usable formatter and add it to the handler
+        self.config_logger(loglevel)
+
+        #store
+        self.scope = scope
+        self.mw = mw_name
+        self.loglevel = loglevel
+
+        self.middleware = None
+
+
+        if (self.mw.upper() == "RSB"):
+            self.logger.info("creating new middleware connection via RSB")
+            try:
+                from MiddlewareRSB import MiddlewareRSB
+            except ImportError, e:
+                self.logger.error("failed to import RSB or the necessary data types: {}".format(e))
+                sys.exit(errno.EINVAL)
+
+            #import worked, safe to intantiate RSB mw now
+            self.middleware = MiddlewareRSB(self.scope, self.loglevel)
+
+        elif (self.mw.upper() == "ROS"):
+            self.logger.info("creating new middleware connection via ROS")
+            try:
+                from MiddlewareROS import MiddlewareROS
+            except ImportError, e:
+                self.logger.error("failed to import ROS or the necessary data types: {}".format(e))
+                sys.exit(errno.EINVAL)
+
+            #import worked, safe to intantiate RSB mw now
+            self.middleware = MiddlewareROS(self.scope, self.loglevel)
+        else:
+            self.logger.error("invalid middleware requested (%s). supported: {ROS, RSB}\n\n" % (self.mw))
+            sys.exit(errno.EINVAL)
+
+    def __del__(self):
+        """destructor
+        """
+        self.logger.debug("destructor of RobotController called")
+
+    def config_logger(self, level):
+        """initialise a nice logger formatting
+        :param  level: log level
+        """
+        formatter = logging.Formatter('%(asctime)s %(name)-30s %(levelname)-8s > %(message)s')
+        ch = logging.StreamHandler()
+        #ch.setLevel(level)
+        ch.setFormatter(formatter)
+        self.logger.setLevel(level)
+        self.logger.addHandler(ch)
+
+    def set_current_emotion(self, robot_emotion, blocking = False):
+        """set the current emotion
+        :param robot_emotion: a RobotEmotion object
+        :param blocking: should this call block during execution?
+        """
+        self.logger.debug("set_current_emotion(%s) %s" % (robot_emotion, ("BLOCKING" if blocking else "NON_BLOCKING")))
+        self.middleware.set_current_emotion(robot_emotion, blocking)
+
+    def set_default_emotion(self, robot_emotion, blocking = False):
+        """set the default emotion
+        :param robot_emotion: a RobotEmotion object
+        :param blocking: should this call block during execution?
+        """
+        self.logger.debug("set_default_emotion(%s) %s" % (robot_emotion, ("BLOCKING" if blocking else "NON_BLOCKING")))
+        self.middleware.set_default_emotion(robot_emotion, blocking)
+
+    def set_gaze_target(self, robot_gaze, blocking = False):
+        """set a gaze target
+        :param robot_gaze: a RobotGaze object
+        :param blocking: should this call block during execution?
+        """
+
+        self.logger.debug("set_gaze_target(%s) %s" % (robot_gaze, ("BLOCKING" if blocking else "NON_BLOCKING")))
+        self.middleware.set_gaze_target(robot_gaze, blocking)
+
+    def set_mouth_target(self, robot_mouth, blocking = False):
+        """set a mouth target
+        :param robot_mouth: a RobotMouth object
+        :param blocking: should this call block during execution?
+        """
+        self.logger.debug("set_mouth_target(%s) %s" % (robot_mouth, ("BLOCKING" if blocking else "NON_BLOCKING")))
+        self.middleware.set_mouth_target(robot_mouth, blocking)
+
+    def set_head_animation(self, robot_animation, blocking = False):
+        """set a head animation
+        :param robot_animation: a RobotAnimation object
+        :param blocking: should this call block during execution?
+        """
+        self.logger.debug("set_head_animation(%s) %s" % (robot_animation, ("BLOCKING" if blocking else "NON_BLOCKING")))
+        self.middleware.set_head_animation(robot_animation, blocking)
+
+    def set_speak(self, text, blocking = False):
+        """request the robot to say something using tts
+        :param text: text to synthesize
+        :param blocking: should this call block during execution?
+        """
+        self.logger.debug("set_speak(%s) %s" % (text, ("BLOCKING" if blocking else "NON_BLOCKING")))
+        self.middleware.set_speak(text, blocking)
+
+    #def get_gaze_target(self):
+    #       result = self.middleware.get_gaze_target()
+    #       self.logger.debug("get_gaze_target() returned %s" % (result))
+    #       return self.middleware.get_gaze_target()
diff --git a/client/python/hlrc_client/RobotEmotion.py b/client/python/hlrc_client/RobotEmotion.py
index 60e97a2..cae784f 100644
--- a/client/python/hlrc_client/RobotEmotion.py
+++ b/client/python/hlrc_client/RobotEmotion.py
@@ -37,25 +37,24 @@ class RobotEmotion:
     FEAR      = 5
 
     def __init__(self, emotion = NEUTRAL):
-	self.value = emotion
-	self.time_ms = 1000
-
-	def value_as_str(self):
-	    if (self.value == RobotEmotion.NEUTRAL):
-		return "neutral"
-	    elif (self.value == RobotEmotion.HAPPY):
-		return "happy"
-	    elif (self.value == RobotEmotion.SAD):
-		return "sad"
-	    elif (self.value == RobotEmotion.ANGRY):
-		return "angry"
-	    elif (self.value == RobotEmotion.SURPRISED):
-		return "surprised"
-	    elif (self.value == RobotEmotion.FEAR):
-		return "fear"
-	    else:
-		return "INVALID EMOTION TYPE"
-
-	    def __str__(self):
-		return "RobotEmotion = { value='%s', time_ms=%d }" % (self.value_as_str(), self.time_ms)
-
+        self.value = emotion
+        self.time_ms = 1000
+
+    def value_as_str(self):
+        if (self.value == RobotEmotion.NEUTRAL):
+            return "neutral"
+        elif (self.value == RobotEmotion.HAPPY):
+            return "happy"
+        elif (self.value == RobotEmotion.SAD):
+            return "sad"
+        elif (self.value == RobotEmotion.ANGRY):
+            return "angry"
+        elif (self.value == RobotEmotion.SURPRISED):
+            return "surprised"
+        elif (self.value == RobotEmotion.FEAR):
+            return "fear"
+        else:
+            return "INVALID EMOTION TYPE"
+
+    def __str__(self):
+        return "RobotEmotion = { value='%s', time_ms=%d }" % (self.value_as_str(), self.time_ms)
diff --git a/client/python/hlrc_client/RobotGaze.py b/client/python/hlrc_client/RobotGaze.py
index 1a65570..98eb03f 100644
--- a/client/python/hlrc_client/RobotGaze.py
+++ b/client/python/hlrc_client/RobotGaze.py
@@ -31,20 +31,19 @@ class RobotGaze:
     GAZETARGET_RELATIVE = 1
 
     def __init__(self):
-	self.pan = 0.0
-	self.tilt = 0.0
-	self.roll = 0.0
-	self.vergence = 0.0
-	self.pan_offset = 0.0
-	self.tilt_offset = 0.0
-	self.gaze_type = RobotGaze.GAZETARGET_ABSOLUTE
-	self.timestamp = time.time()
-
-	def __str__(self):
-	    if self.gaze_type == RobotGaze.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)
-
+        self.pan = 0.0
+        self.tilt = 0.0
+        self.roll = 0.0
+        self.vergence = 0.0
+        self.pan_offset = 0.0
+        self.tilt_offset = 0.0
+        self.gaze_type = RobotGaze.GAZETARGET_ABSOLUTE
+        self.timestamp = time.time()
+
+    def __str__(self):
+        if self.gaze_type == RobotGaze.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)
diff --git a/client/python/hlrc_client/RobotMouth.py b/client/python/hlrc_client/RobotMouth.py
index 24b3b08..10cf0c0 100644
--- a/client/python/hlrc_client/RobotMouth.py
+++ b/client/python/hlrc_client/RobotMouth.py
@@ -27,14 +27,14 @@ Excellence Initiative.
 
 class RobotMouth:
     def __init__(self):
-	self.opening_left   = 0.0
-	self.opening_center = 0.0
-	self.opening_right  = 0.0
-	self.position_left  = 0.0
-	self.position_center = 0.0
-	self.position_right = 0.0
+        self.opening_left   = 0.0
+        self.opening_center = 0.0
+        self.opening_right  = 0.0
+        self.position_left  = 0.0
+        self.position_center = 0.0
+        self.position_right = 0.0
 
-	def __str__(self):
-	    return "RobotMouth = { opening={%6.2f %6.2f %6.2f} offset={%6.2f %6.2f %6.2f} }" \
-	% (self.opening_left, self.opening_center, self.opening_right, \
-	self.position_left, self.position_center, self.position_right)
+    def __str__(self):
+        return "RobotMouth = { opening={%6.2f %6.2f %6.2f} offset={%6.2f %6.2f %6.2f} }" \
+                % (self.opening_left, self.opening_center, self.opening_right, \
+                        self.position_left, self.position_center, self.position_right)
diff --git a/client/python/hlrc_client/hlrc_test_gui.py b/client/python/hlrc_client/hlrc_test_gui.py
index 3ed5904..411d724 100755
--- a/client/python/hlrc_client/hlrc_test_gui.py
+++ b/client/python/hlrc_client/hlrc_test_gui.py
@@ -39,216 +39,216 @@ from PyQt4 import QtGui, QtCore
 from PyQt4.QtCore import SIGNAL
 
 class HLRCExample(QtGui.QWidget):
-    
+
     def __init__(self, scope, mw):
-	super(HLRCExample, self).__init__()
-	
-	self.scope = scope
-	self.mw = mw
-	self.initUI()
-	self.robot_controller = RobotController(self.mw, self.scope, logging.DEBUG)
-
-	def initUtteranceUI(self):
-	    groupBox = QtGui.QGroupBox("utterances")
-
-	    hello = QtGui.QPushButton("hello...")
-	    hello.clicked.connect(self.utterance_button_clicked)
-
-	    count = QtGui.QPushButton("12345...")
-	    count.clicked.connect(self.utterance_button_clicked)
-
-
-	    vbox = QtGui.QVBoxLayout()
-	    vbox.addWidget(hello)
-	    vbox.addWidget(count)
-	    vbox.addStretch(1)
-	    groupBox.setLayout(vbox)
-
-	    return groupBox
-
-	def initSpinbox(self, _min, _max, _init, double):
-	    if (double):
-		s = QtGui.QDoubleSpinBox()
-		else:
-		    s = QtGui.QSpinBox()
-
-		    s.setMinimum(_min)
-		    s.setMaximum(_max)
-		    s.setValue(_init)
-		    return s
-
-		def initPushButton(self, base_layout, text, action):
-		    button = QtGui.QPushButton(text)
-		    button.clicked.connect(action)
-		    base_layout.addWidget(button)
-
-		    def initEmotionUI(self):
-			vbox = QtGui.QVBoxLayout()
-			self.duration_spinbox = self.initSpinbox(100, 10000, 1000, 0)
-			vbox.addWidget(self.duration_spinbox)
-
-			#self.duration_spinbox = self.initSpinbox(50, 10000, 1000, 0)
-			self.initPushButton(vbox, "neutral",  self.emotion_button_clicked)
-			self.initPushButton(vbox, "surprise", self.emotion_button_clicked)
-			self.initPushButton(vbox, "angry",    self.emotion_button_clicked)
-			self.initPushButton(vbox, "happy",    self.emotion_button_clicked)
-			self.initPushButton(vbox, "sad",      self.emotion_button_clicked)
-			self.initPushButton(vbox, "fear",     self.emotion_button_clicked)
-			vbox.addStretch(1)
-
-			groupBox = QtGui.QGroupBox("emotion")
-			groupBox.setLayout(vbox)
-			return groupBox
-
-		    def initAnimationButton(self, base_layout, name):
-			b = QtGui.QPushButton(name)
-			b.clicked.connect(self.animation_button_clicked)
-			base_layout.addWidget(b)
-
-			def initAnimUI(self):
-			    groupBox = QtGui.QGroupBox("animations")
-
-			    #options
-			    options = QtGui.QHBoxLayout()
-			    vbox_r = QtGui.QVBoxLayout()
-			    vbox_r.addWidget(QtGui.QLabel("repetitions"))
-			    self.repetitions_spinbox = self.initSpinbox(1,10,1,0)
-			    vbox_r.addWidget(self.repetitions_spinbox)
-
-			    vbox_d = QtGui.QVBoxLayout()
-			    vbox_d.addWidget(QtGui.QLabel("duration/ms (each)"))
-			    self.duration_each_spinbox = self.initSpinbox(50,10000,1000,0)
-			    vbox_d.addWidget(self.duration_each_spinbox)
-
-			    vbox_s = QtGui.QVBoxLayout()
-			    vbox_s.addWidget(QtGui.QLabel("scale"))
-			    self.scale_spinbox = self.initSpinbox(0.1, 5.0, 1.0, 1)
-			    vbox_s.addWidget(self.scale_spinbox)
-
-
-			    options.addLayout(vbox_r)
-			    options.addLayout(vbox_d)
-			    options.addLayout(vbox_s)
-
-			    #buttons
-			    vbox = QtGui.QVBoxLayout()
-			    vbox.addLayout(options)
-			    self.initAnimationButton(vbox, "head shake")
-			    self.initAnimationButton(vbox, "head nod")
-			    self.initAnimationButton(vbox, "eyeblink left")
-			    self.initAnimationButton(vbox, "eyeblink right")
-			    self.initAnimationButton(vbox, "eyeblink both")
-			    self.initAnimationButton(vbox, "eyebrows raise")
-			    self.initAnimationButton(vbox, "eyebrows lower")
-			    vbox.addStretch(1)
-			    groupBox.setLayout(vbox)
-
-			    return groupBox
-
-			def initUI(self):
-			    vbox = QtGui.QVBoxLayout()
-
-			    hboxl = QtGui.QHBoxLayout()
-			    hboxl.addWidget(QtGui.QLabel("base scope: "))
-			    hboxl.addWidget(QtGui.QLabel(self.scope))
-			    vbox.addLayout(hboxl)
-
-			    hbox = QtGui.QHBoxLayout()
-			    vbox.addLayout(hbox)
-
-			    #emotion
-			    hbox.addWidget(self.initEmotionUI())
-
-			    #utterance:
-				hbox.addWidget(self.initUtteranceUI())
-
-				#animations:
-				    hbox.addWidget(self.initAnimUI())
-
-				    self.setLayout(vbox)
-				    #sld.valueChanged.connect(lcd.display)
-
-				    self.setGeometry(400, 100, 250, 150)
-				    self.setWindowTitle("HLRC Server test GUI - %s" % self.scope)
-				    self.show()
-
-				    def utterance_button_clicked(self):
-					button = self.sender().text()
-
-
-					if (button == "12345..."):
-					    self.robot_controller.set_speak("1 2 3 4 5 6 7 8 9 10", False)
-					    elif (button == "hello..."):
-						self.robot_controller.set_speak("Hello my name is flobi. How can i help you?", False)
-						else:
-						    self.robot_controller.set_speak("invalid button name", False)
-						    print "invalid button '%s'" % (button)
-
-						    def emotion_button_clicked(self):
-							button = self.sender().text()
-
-							re = RobotEmotion()
-							re.time_ms = self.duration_spinbox.value()
-
-							if (button == "angry"):
-							    re.value = RobotEmotion.ANGRY
-							    elif (button == "neutral"):
-								re.value = RobotEmotion.NEUTRAL
-								elif (button == "happy"):
-								    re.value = RobotEmotion.HAPPY
-								    elif (button == "sad"):
-									re.value = RobotEmotion.SAD
-									elif (button == "surprise"):
-									    re.value = RobotEmotion.SURPRISED
-									    elif (button == "fear"):
-										re.value = RobotEmotion.FEAR
-										else:
-										    print "invalid emotion id '%s'" % (button)
-										    return
-
-										self.robot_controller.set_current_emotion(re, False)
-
-										def animation_button_clicked(self):
-										    button = self.sender().text()
-
-										    ra = RobotAnimation()
-										    ra.time_ms =  self.duration_each_spinbox.value()
-										    ra.repetitions = self.repetitions_spinbox.value()
-										    ra.scale = self.scale_spinbox.value()
-
-										    if (button == "head nod"):
-											ra.value = RobotAnimation.HEAD_NOD
-											elif (button == "head shake"):
-											    ra.value = RobotAnimation.HEAD_SHAKE
-											    elif (button == "eyeblink left"):
-												ra.value = RobotAnimation.EYEBLINK_L
-												elif (button == "eyeblink right"):
-												    ra.value = RobotAnimation.EYEBLINK_R
-												    elif (button == "eyeblink both"):
-													ra.value = RobotAnimation.EYEBLINK_BOTH
-													elif (button == "eyebrows raise"):
-													    ra.value = RobotAnimation.EYEBROWS_RAISE
-													    elif (button == "eyebrows lower"):
-														ra.value = RobotAnimation.EYEBROWS_LOWER
-														else:
-														    print "invalid button '%s'" % (button)
-														    return
-
-														self.robot_controller.set_head_animation(ra, False)
-
-														def main():
-														    if (len(sys.argv) != 3):
-															print("usage:   hlrc_test_gui.py <middleware> <scope>\n\n")
-															print("example: hlrc_test_gui.py ROS /flobi\n\n")
-															sys.exit(errno.EINVAL)
-
-															scope = sys.argv[1]
-															mw    = sys.argv[2]
-
-															app = QtGui.QApplication(sys.argv)
-															ex = HLRCExample(mw, scope)
-															sys.exit(app.exec_())
-
-
-															if __name__ == '__main__':
-															    main()
+        super(HLRCExample, self).__init__()
+
+        self.scope = scope
+        self.mw = mw
+        self.initUI()
+        self.robot_controller = RobotController(self.mw, self.scope, logging.DEBUG)
+
+    def initUtteranceUI(self):
+        groupBox = QtGui.QGroupBox("utterances")
+
+        hello = QtGui.QPushButton("hello...")
+        hello.clicked.connect(self.utterance_button_clicked)
+
+        count = QtGui.QPushButton("12345...")
+        count.clicked.connect(self.utterance_button_clicked)
+
+
+        vbox = QtGui.QVBoxLayout()
+        vbox.addWidget(hello)
+        vbox.addWidget(count)
+        vbox.addStretch(1)
+        groupBox.setLayout(vbox)
+
+        return groupBox
+
+    def initSpinbox(self, _min, _max, _init, double):
+        if (double):
+            s = QtGui.QDoubleSpinBox()
+        else:
+            s = QtGui.QSpinBox()
+
+        s.setMinimum(_min)
+        s.setMaximum(_max)
+        s.setValue(_init)
+        return s
+
+    def initPushButton(self, base_layout, text, action):
+        button = QtGui.QPushButton(text)
+        button.clicked.connect(action)
+        base_layout.addWidget(button)
+
+    def initEmotionUI(self):
+        vbox = QtGui.QVBoxLayout()
+        self.duration_spinbox = self.initSpinbox(100, 10000, 1000, 0)
+        vbox.addWidget(self.duration_spinbox)
+
+        #self.duration_spinbox = self.initSpinbox(50, 10000, 1000, 0)
+        self.initPushButton(vbox, "neutral",  self.emotion_button_clicked)
+        self.initPushButton(vbox, "surprise", self.emotion_button_clicked)
+        self.initPushButton(vbox, "angry",    self.emotion_button_clicked)
+        self.initPushButton(vbox, "happy",    self.emotion_button_clicked)
+        self.initPushButton(vbox, "sad",      self.emotion_button_clicked)
+        self.initPushButton(vbox, "fear",     self.emotion_button_clicked)
+        vbox.addStretch(1)
+
+        groupBox = QtGui.QGroupBox("emotion")
+        groupBox.setLayout(vbox)
+        return groupBox
+
+    def initAnimationButton(self, base_layout, name):
+        b = QtGui.QPushButton(name)
+        b.clicked.connect(self.animation_button_clicked)
+        base_layout.addWidget(b)
+
+    def initAnimUI(self):
+        groupBox = QtGui.QGroupBox("animations")
+
+        #options
+        options = QtGui.QHBoxLayout()
+        vbox_r = QtGui.QVBoxLayout()
+        vbox_r.addWidget(QtGui.QLabel("repetitions"))
+        self.repetitions_spinbox = self.initSpinbox(1,10,1,0)
+        vbox_r.addWidget(self.repetitions_spinbox)
+
+        vbox_d = QtGui.QVBoxLayout()
+        vbox_d.addWidget(QtGui.QLabel("duration/ms (each)"))
+        self.duration_each_spinbox = self.initSpinbox(50,10000,1000,0)
+        vbox_d.addWidget(self.duration_each_spinbox)
+
+        vbox_s = QtGui.QVBoxLayout()
+        vbox_s.addWidget(QtGui.QLabel("scale"))
+        self.scale_spinbox = self.initSpinbox(0.1, 5.0, 1.0, 1)
+        vbox_s.addWidget(self.scale_spinbox)
+
+
+        options.addLayout(vbox_r)
+        options.addLayout(vbox_d)
+        options.addLayout(vbox_s)
+
+        #buttons
+        vbox = QtGui.QVBoxLayout()
+        vbox.addLayout(options)
+        self.initAnimationButton(vbox, "head shake")
+        self.initAnimationButton(vbox, "head nod")
+        self.initAnimationButton(vbox, "eyeblink left")
+        self.initAnimationButton(vbox, "eyeblink right")
+        self.initAnimationButton(vbox, "eyeblink both")
+        self.initAnimationButton(vbox, "eyebrows raise")
+        self.initAnimationButton(vbox, "eyebrows lower")
+        vbox.addStretch(1)
+        groupBox.setLayout(vbox)
+
+        return groupBox
+
+    def initUI(self):
+        vbox = QtGui.QVBoxLayout()
+
+        hboxl = QtGui.QHBoxLayout()
+        hboxl.addWidget(QtGui.QLabel("base scope: "))
+        hboxl.addWidget(QtGui.QLabel(self.scope))
+        vbox.addLayout(hboxl)
+
+        hbox = QtGui.QHBoxLayout()
+        vbox.addLayout(hbox)
+
+        #emotion
+        hbox.addWidget(self.initEmotionUI())
+
+        #utterance:
+        hbox.addWidget(self.initUtteranceUI())
+
+        #animations:
+        hbox.addWidget(self.initAnimUI())
+
+        self.setLayout(vbox)
+        #sld.valueChanged.connect(lcd.display)
+
+        self.setGeometry(400, 100, 250, 150)
+        self.setWindowTitle("HLRC Server test GUI - %s" % self.scope)
+        self.show()
+
+    def utterance_button_clicked(self):
+        button = self.sender().text()
+
+
+        if (button == "12345..."):
+            self.robot_controller.set_speak("1 2 3 4 5 6 7 8 9 10", False)
+        elif (button == "hello..."):
+            self.robot_controller.set_speak("Hello my name is flobi. How can i help you?", False)
+        else:
+            self.robot_controller.set_speak("invalid button name", False)
+            print "invalid button '%s'" % (button)
+
+    def emotion_button_clicked(self):
+        button = self.sender().text()
+
+        re = RobotEmotion()
+        re.time_ms = self.duration_spinbox.value()
+
+        if (button == "angry"):
+            re.value = RobotEmotion.ANGRY
+        elif (button == "neutral"):
+            re.value = RobotEmotion.NEUTRAL
+        elif (button == "happy"):
+            re.value = RobotEmotion.HAPPY
+        elif (button == "sad"):
+            re.value = RobotEmotion.SAD
+        elif (button == "surprise"):
+            re.value = RobotEmotion.SURPRISED
+        elif (button == "fear"):
+            re.value = RobotEmotion.FEAR
+        else:
+            print "invalid emotion id '%s'" % (button)
+            return
+
+        self.robot_controller.set_current_emotion(re, False)
+
+    def animation_button_clicked(self):
+        button = self.sender().text()
+
+        ra = RobotAnimation()
+        ra.time_ms =  self.duration_each_spinbox.value()
+        ra.repetitions = self.repetitions_spinbox.value()
+        ra.scale = self.scale_spinbox.value()
+
+        if (button == "head nod"):
+            ra.value = RobotAnimation.HEAD_NOD
+        elif (button == "head shake"):
+            ra.value = RobotAnimation.HEAD_SHAKE
+        elif (button == "eyeblink left"):
+            ra.value = RobotAnimation.EYEBLINK_L
+        elif (button == "eyeblink right"):
+            ra.value = RobotAnimation.EYEBLINK_R
+        elif (button == "eyeblink both"):
+            ra.value = RobotAnimation.EYEBLINK_BOTH
+        elif (button == "eyebrows raise"):
+            ra.value = RobotAnimation.EYEBROWS_RAISE
+        elif (button == "eyebrows lower"):
+            ra.value = RobotAnimation.EYEBROWS_LOWER
+        else:
+            print "invalid button '%s'" % (button)
+            return
+
+        self.robot_controller.set_head_animation(ra, False)
+
+def main():
+    if (len(sys.argv) != 3):
+        print("usage:   hlrc_test_gui.py <middleware> <scope>\n\n")
+        print("example: hlrc_test_gui.py ROS /flobi\n\n")
+        sys.exit(errno.EINVAL)
+
+    scope = sys.argv[1]
+    mw    = sys.argv[2]
+
+    app = QtGui.QApplication(sys.argv)
+    ex = HLRCExample(mw, scope)
+    sys.exit(app.exec_())
+
+
+if __name__ == '__main__':
+    main()
diff --git a/client/python/test.py b/client/python/test.py
index 94098b0..bf9d730 100644
--- a/client/python/test.py
+++ b/client/python/test.py
@@ -45,18 +45,17 @@ if __name__ == "__main__":
     g = RobotGaze()
     g.gaze_type = RobotGaze.GAZETARGET_ABSOLUTE
 
-    m = RobotMouth()
+        m = RobotMouth()
     m.position_center = 10.0
-    m.opening_center = 15.0
-    r.set_mouth_target(m)
+        m.opening_center = 15.0
+        r.set_mouth_target(m)
 
     while(True):
-	g.timestamp = time.time()
-	g.pan = g.pan + 5.0;
-	if (g.pan > 20.0):
-	    g.pan = -20.0
-	    r.set_gaze_target(g)
-	    time.sleep(1)
-	    #e = RobotAnimation()
-	    #print e
-
+        g.timestamp = time.time()
+        g.pan = g.pan + 5.0;
+        if (g.pan > 20.0):
+            g.pan = -20.0
+        r.set_gaze_target(g)
+        time.sleep(1)
+    #e = RobotAnimation()
+    #print e
