commit 0c8d22a524bacd2a0469cce769fa47d6c6f05a27
Author: sschulz <sschulz@techfak.uni-bielefeld.de>
Date:   Fri Feb 19 14:54:11 2016 +0100

    stylecheck based cleanup

diff --git a/src/server/middleware_ros.cpp b/src/server/middleware_ros.cpp
index 426a3ec..0e06295 100644
--- a/src/server/middleware_ros.cpp
+++ b/src/server/middleware_ros.cpp
@@ -25,64 +25,68 @@
 * Excellence Initiative.
 */
 
-#include "server/middleware_ros.h"
-
 #include <boost/algorithm/string/classification.hpp>
-using namespace std;
-using namespace boost;
-using namespace humotion;
-using namespace humotion::server;
+
+#include <string>
+
+#include "humotion/server/middleware_ros.h"
+
+using humotion::server::MiddlewareROS;
 
 //! constructor
-MiddlewareROS::MiddlewareROS(string scope, Controller *c)
-    : Middleware(scope, c){
+MiddlewareROS::MiddlewareROS(std::string scope, Controller *c)
+    : Middleware(scope, c) {
 
     printf("> using ROS middleware\n");
 
-    //start ros core?
-    if (ros::isInitialized()){
-        //oh another process is doing ros comm, fine, we do not need to call it
+    // start ros core?
+    if (ros::isInitialized()) {
+        // oh another process is doing ros comm, fine, we do not need to call it
         tick_necessary = false;
-    }else{
-        //we have to take care of ros
-        printf("> no active ros middleware, calling ros::init() and we will call tick() periodically!\n");
-        string node_name = "humotion_server__"+ scope;
+    } else {
+        // we have to take care of ros
+        printf("> no active ros middleware, calling ros::init() "
+               "and we will call tick() periodically!\n");
+        std::string node_name = "humotion_server__"+ scope;
         node_name.erase(std::remove(node_name.begin(), node_name.end(), '/'), node_name.end());
-        printf("> registering on ROS as node %s\n",node_name.c_str());
+        printf("> registering on ROS as node %s\n", node_name.c_str());
         ros::M_string no_remapping;
         ros::init(no_remapping, node_name);
         tick_necessary = true;
     }
 
-    //create node handle
+    // create node handle
     ros::NodeHandle n;
 
-    //set up subscribers:
-    mouth_target_subscriber = n.subscribe(scope + "/humotion/mouth/target", 150, &MiddlewareROS::incoming_mouth_target , this, ros::TransportHints().unreliable());
-    gaze_target_subscriber  = n.subscribe(scope + "/humotion/gaze/target",  150, &MiddlewareROS::incoming_gaze_target, this, ros::TransportHints().unreliable());
-
+    // set up subscribers
+    mouth_target_subscriber = n.subscribe(scope + "/humotion/mouth/target", 150,
+                                          &MiddlewareROS::incoming_mouth_target ,
+                                          this, ros::TransportHints().unreliable());
+    gaze_target_subscriber  = n.subscribe(scope + "/humotion/gaze/target",  150,
+                                          &MiddlewareROS::incoming_gaze_target,
+                                          this, ros::TransportHints().unreliable());
 }
 
 //! destructor
-MiddlewareROS::~MiddlewareROS(){
+MiddlewareROS::~MiddlewareROS() {
 }
 
 //! connection ok?
 //! \return true if conn is alive
-bool MiddlewareROS::ok(){
+bool MiddlewareROS::ok() {
     return ros::ok();
 }
 
 //! do a single tick
-void MiddlewareROS::tick(){
-    if (tick_necessary){
+void MiddlewareROS::tick() {
+    if (tick_necessary) {
         ros::spinOnce();
     }
 }
 
 //! callback to handle incoming mouth  target
-void MiddlewareROS::incoming_mouth_target(const humotion::mouth::ConstPtr& msg){
-    //printf("> incoming mouth_target\n");
+void MiddlewareROS::incoming_mouth_target(const humotion::mouth::ConstPtr& msg) {
+    // printf("> incoming mouth_target\n");
     MouthState mouth_state;
 
     mouth_state.position_left   = msg->position.left;
@@ -98,9 +102,11 @@ void MiddlewareROS::incoming_mouth_target(const humotion::mouth::ConstPtr& msg){
 
 
 //! callback to handle incoming gaze  target
-void MiddlewareROS::incoming_gaze_target(const humotion::gaze::ConstPtr& msg){
+void MiddlewareROS::incoming_gaze_target(const humotion::gaze::ConstPtr& msg) {
     GazeState gaze_state;
-    //printf("> incoming gaze_target [P:%3.1f, T:%3.1f, R:%3.1f] %d = %s\n", msg->pan, msg->tilt, msg->roll, msg->type, msg->type==humotion::gaze::GAZETYPE_ABSOLUTE?"ABSOLUTE":"RELATIVE");
+    // printf("> incoming gaze_target [P:%3.1f, T:%3.1f, R:%3.1f] %d = %s\n",
+    //          msg->pan, msg->tilt, msg->roll, msg->type,
+    //          msg->type==humotion::gaze::GAZETYPE_ABSOLUTE?"ABSOLUTE":"RELATIVE");
 
     gaze_state.pan  = msg->pan;
     gaze_state.tilt = msg->tilt;
@@ -120,15 +126,14 @@ void MiddlewareROS::incoming_gaze_target(const humotion::gaze::ConstPtr& msg){
     gaze_state.eyeblink_request_left = msg->eyeblink_request_left;
     gaze_state.eyeblink_request_right = msg->eyeblink_request_right;
 
-    if (msg->gaze_type == humotion::gaze::GAZETYPE_ABSOLUTE){
+    if (msg->gaze_type == humotion::gaze::GAZETYPE_ABSOLUTE) {
         gaze_state.gaze_type = GazeState::GAZETYPE_ABSOLUTE;
-    }else{
+    } else {
         gaze_state.gaze_type = GazeState::GAZETYPE_RELATIVE;
     }
 
     gaze_state.timestamp.set(msg->gaze_timestamp.sec, msg->gaze_timestamp.nsec);
 
     controller->set_gaze_target(gaze_state);
-
 }
 
