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/motion_generator.cpp b/src/server/motion_generator.cpp
index f1b3040..595252b 100644
--- a/src/server/motion_generator.cpp
+++ b/src/server/motion_generator.cpp
@@ -25,24 +25,21 @@
 * Excellence Initiative.
 */
 
-#include "server/motion_generator.h"
-#include "boost/date_time/posix_time/posix_time.hpp"
+#include <boost/date_time/posix_time/posix_time.hpp>
+#include "humotion/server/motion_generator.h"
 
-using namespace std;
-using namespace humotion;
-using namespace humotion::server;
-using namespace boost;
+using humotion::server::MotionGenerator;
 
 //! constructor
-MotionGenerator::MotionGenerator(JointInterface *j){
+MotionGenerator::MotionGenerator(JointInterface *j) {
     joint_interface = j;
-    last_mouth_target_update = posix_time::ptime(posix_time::min_date_time);
-    last_gaze_target_update  = posix_time::ptime(posix_time::min_date_time);
+    last_mouth_target_update = boost::posix_time::ptime(boost::posix_time::min_date_time);
+    last_gaze_target_update  = boost::posix_time::ptime(boost::posix_time::min_date_time);
 }
 
 
 //! destructor
-MotionGenerator::~MotionGenerator(){
+MotionGenerator::~MotionGenerator() {
 }
 
 //! fetch the latest position and velocity and return the timestamp of that dataset
@@ -61,14 +58,14 @@ humotion::Timestamp MotionGenerator::get_timestamped_state(int joint_id,
 //! fetch the latest (=current) speed of a joint
 //! \param joint_id
 //! \return float value of joint speed
-float MotionGenerator::get_current_speed(int joint_id){
+float MotionGenerator::get_current_speed(int joint_id) {
     return joint_interface->get_ts_speed(joint_id).get_newest_value();
 }
 
 //! fetch the latest (=current) position of a joint
 //! \param joint_id
 //! \return float value of joint position
-float MotionGenerator::get_current_position(int joint_id){
+float MotionGenerator::get_current_position(int joint_id) {
     /*Timestamp tsl = joint_interface->get_ts_position(joint_id).get_last_timestamp();
     Timestamp now = Timestamp::now();
     Timestamp diff=now-tsl;
@@ -79,63 +76,66 @@ float MotionGenerator::get_current_position(int joint_id){
 
 //! update gaze target:
 //! \param GazeState with target values for the overall gaze
-void MotionGenerator::set_gaze_target(GazeState new_gaze_target){
-    //store value for next iteration
+void MotionGenerator::set_gaze_target(GazeState new_gaze_target) {
+    // store value for next iteration
     requested_gaze_state        = new_gaze_target;
 
-    //keep track if the gaze targets are comming in regulary
-    last_gaze_target_update = get_system_time();
+    // keep track if the gaze targets are comming in regulary
+    last_gaze_target_update = boost::get_system_time();
 }
 
 //! update mouth state:
 //! \param MouthState with target values for the mouth joints
-void MotionGenerator::set_mouth_target(MouthState s){
-    //store value
+void MotionGenerator::set_mouth_target(MouthState s) {
+    // store value
     requested_mouth_target = s;
 
-    //keep track if the mouth targets are comming in regulary
-    last_mouth_target_update = get_system_time();
+    // keep track if the mouth targets are comming in regulary
+    last_mouth_target_update = boost::get_system_time();
 }
 
 
 //! was there incoming gaze data the last second?
 //! \return true if there was data incoming in the last second, false otherwise
-bool MotionGenerator::gaze_target_input_active(){
-    if (last_gaze_target_update  + posix_time::milliseconds(1000) > get_system_time() ){
-        //incoming data -> if gaze is disabled, enable it!
+bool MotionGenerator::gaze_target_input_active() {
+    if (last_gaze_target_update  + boost::posix_time::milliseconds(1000)
+            > boost::get_system_time() ) {
+        // incoming data -> if gaze is disabled, enable it!
         joint_interface->enable_gaze_joints();
         return true;
-    }else{
-        //no incoming data, disable!
-        joint_interface->disable_gaze_joints();
-        return false;
     }
+
+    // else: no incoming data, disable!
+    joint_interface->disable_gaze_joints();
+    return false;
 }
 
 //! was there incoming mouth data the last second?
 //! \return true if there was data incoming in the last second, false otherwise
-bool MotionGenerator::mouth_target_input_active(){
-    if (last_mouth_target_update + posix_time::milliseconds(1000) > get_system_time() ){
-        //incoming data -> if mouth is disabled, enable it!
+bool MotionGenerator::mouth_target_input_active() {
+    if (last_mouth_target_update + boost::posix_time::milliseconds(1000)
+            > boost::get_system_time() ) {
+        // incoming data -> if mouth is disabled, enable it!
         joint_interface->enable_mouth_joints();
         return true;
-    }else{
-        //no incoming data, disable!
-        joint_interface->disable_mouth_joints();
-        return false;
     }
+
+    // else: no incoming data, disable!
+    joint_interface->disable_mouth_joints();
+    return false;
 }
 
 //! limit target to min/max bounds:
-float MotionGenerator::limit_target(int joint_id, float val){
+float MotionGenerator::limit_target(int joint_id, float val) {
     assert(joint_id < JointInterface::JOINT_ID_ENUM_SIZE);
 
-    //fetch min/max for joint:
+    // fetch min/max for joint:
     float min = joint_interface->get_joint_min(joint_id);
     float max = joint_interface->get_joint_max(joint_id);
 
-    if (max < min){
-        printf("> ERROR: how can min (%4.2f) be bigger than max (%4.2f)?? FIX THIS! EXITING NOW\n",min,max);
+    if (max < min) {
+        printf("> ERROR: how can min (%4.2f) be bigger than max (%4.2f)?? EXITING NOW\n", min, max);
+        printf("> HINT : did you initialize the joints' min/max positions properly?\n");
         exit(0);
     }
 
