Index: trunk/lib/FlairSensorActuator/src/AfroBldc.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/AfroBldc.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/AfroBldc.cpp	(revision 15)
@@ -30,17 +30,16 @@
 using namespace flair::gui;
 
-namespace flair { namespace actuator {
+namespace flair {
+namespace actuator {
 
-AfroBldc::AfroBldc(const IODevice* parent,Layout* layout,string name,uint8_t motors_count,I2cPort* i2cport) : Bldc(parent,layout,name,motors_count) {
-    pimpl_=new AfroBldc_impl(this,layout,i2cport);
+AfroBldc::AfroBldc(const IODevice *parent, Layout *layout, string name,
+                   uint8_t motors_count, I2cPort *i2cport)
+    : Bldc(parent, layout, name, motors_count) {
+  pimpl_ = new AfroBldc_impl(this, layout, i2cport);
 }
 
-AfroBldc::~AfroBldc() {
-    delete pimpl_;
-}
+AfroBldc::~AfroBldc() { delete pimpl_; }
 
-void AfroBldc::SetMotors(float* values) {
-    pimpl_->SetMotors(values);
-}
+void AfroBldc::SetMotors(float *values) { pimpl_->SetMotors(values); }
 
 } // end namespace actuator
Index: trunk/lib/FlairSensorActuator/src/AfroBldc.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/AfroBldc.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/AfroBldc.h	(revision 15)
@@ -16,84 +16,79 @@
 #include "Bldc.h"
 
-namespace flair
-{
-    namespace core
-    {
-        class FrameworkManager;
-        class I2cPort;
-    }
-    namespace sensor
-    {
-        class BatteryMonitor;
-    }
+namespace flair {
+namespace core {
+class FrameworkManager;
+class I2cPort;
+}
+namespace sensor {
+class BatteryMonitor;
+}
 }
 
 class AfroBldc_impl;
 
-namespace flair
-{
-namespace actuator
-{
-    /*! \class AfroBldc
-    *
-    * \brief Class for Mikrokopter's blctrlv2
-    *
-    * blctrlv2 drivers can also monitor the battery level. See GetBatteryMonitor().
-    */
-    class AfroBldc : public Bldc
-    {
-        friend class ::AfroBldc_impl;
+namespace flair {
+namespace actuator {
+/*! \class AfroBldc
+*
+* \brief Class for Mikrokopter's blctrlv2
+*
+* blctrlv2 drivers can also monitor the battery level. See GetBatteryMonitor().
+*/
+class AfroBldc : public Bldc {
+  friend class ::AfroBldc_impl;
 
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a AfroBldc.
-            *
-            * \param parent parent
-            * \param layout layout
-            * \param name name
-            * \param motors_count number of motors
-            * \param i2cport I2cPort
-            */
-            AfroBldc(const core::IODevice* parent,gui::Layout* layout,std::string name,uint8_t motors_count,core::I2cPort* i2cport);
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a AfroBldc.
+  *
+  * \param parent parent
+  * \param layout layout
+  * \param name name
+  * \param motors_count number of motors
+  * \param i2cport I2cPort
+  */
+  AfroBldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
+           uint8_t motors_count, core::I2cPort *i2cport);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~AfroBldc();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~AfroBldc();
 
-            /*!
-            * \brief Has speed measurement
-            *
-            * Reimplemented from Bldc. \n
-            *
-            * \return true if it has speed measurement
-            */
-            bool HasSpeedMeasurement(void) const{return false;};
+  /*!
+  * \brief Has speed measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has speed measurement
+  */
+  bool HasSpeedMeasurement(void) const { return false; };
 
-            /*!
-            * \brief Has current measurement
-            *
-            * Reimplemented from Bldc. \n
-            *
-            * \return true if it has current measurement
-            */
-            bool HasCurrentMeasurement(void) const{return false;};
+  /*!
+  * \brief Has current measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has current measurement
+  */
+  bool HasCurrentMeasurement(void) const { return false; };
 
-        private:
-            /*!
-            * \brief Set motors values
-            *
-            * Reimplemented from Bldc. \n
-            * Values size must be the same as MotorsCount()
-            *
-            * \param values motor values
-            */
-            void SetMotors(float* values);
+private:
+  /*!
+  * \brief Set motors values
+  *
+  * Reimplemented from Bldc. \n
+  * Values size must be the same as MotorsCount()
+  *
+  * \param values motor values
+  */
+  void SetMotors(float *values);
 
-            class AfroBldc_impl* pimpl_;
-    };
+  class AfroBldc_impl *pimpl_;
+};
 } // end namespace actuator
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/AfroBldc_impl.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/AfroBldc_impl.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/AfroBldc_impl.cpp	(revision 15)
@@ -34,40 +34,39 @@
 using namespace flair::actuator;
 
-AfroBldc_impl::AfroBldc_impl(AfroBldc* self,Layout *layout,I2cPort* i2cport) {
-    this->self=self;
-    this->i2cport=i2cport;
-    nb_mot=self->MotorsCount();
+AfroBldc_impl::AfroBldc_impl(AfroBldc *self, Layout *layout, I2cPort *i2cport) {
+  this->self = self;
+  this->i2cport = i2cport;
+  nb_mot = self->MotorsCount();
 }
 
-AfroBldc_impl::~AfroBldc_impl() {
+AfroBldc_impl::~AfroBldc_impl() {}
 
+void AfroBldc_impl::SetMotors(float *value) {
+  uint16_t tosend_value[nb_mot];
+
+  for (int i = 0; i < nb_mot; i++)
+    tosend_value[i] = (uint16_t)(MAX_VALUE * value[i]);
+
+  i2cport->GetMutex();
+
+  for (int i = 0; i < nb_mot; i++) {
+    i2cport->SetSlave(BASE_ADDRESS + i);
+    WriteValue(tosend_value[i]);
+  }
+  i2cport->ReleaseMutex();
 }
 
-void AfroBldc_impl::SetMotors(float* value) {
-    uint16_t tosend_value[nb_mot];
+// I2cPort mutex must be taken before calling this function
+void AfroBldc_impl::WriteValue(uint16_t value) {
+  uint8_t tx[2];
+  ssize_t written;
 
-    for(int i=0; i<nb_mot; i++) tosend_value[i]=(uint16_t)(MAX_VALUE*value[i]);
-
-    i2cport->GetMutex();
-
-    for(int i=0; i<nb_mot; i++) {
-        i2cport->SetSlave(BASE_ADDRESS+i);
-        WriteValue(tosend_value[i]);
-    }
-    i2cport->ReleaseMutex();
+  tx[0] = (uint8_t)(value >> 3); // msb
+  tx[1] = (value & 0x07);        // lsb
+  written = i2cport->Write(tx, 2);
+  if (written < 0) {
+    self->Err("rt_dev_write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(tx)) {
+    self->Err("rt_dev_write error %i/%i\n", written, sizeof(tx));
+  }
 }
-
-//I2cPort mutex must be taken before calling this function
-void AfroBldc_impl::WriteValue(uint16_t value) {
-    uint8_t tx[2];
-    ssize_t written;
-
-    tx[0]=(uint8_t)(value>>3);//msb
-    tx[1]=(value&0x07);//lsb
-    written =i2cport->Write(tx, 2);
-    if(written<0) {
-        self->Err("rt_dev_write error (%s)\n",strerror(-written));
-    } else if (written != sizeof(tx)) {
-        self->Err("rt_dev_write error %i/%i\n",written,sizeof(tx));
-    }
-}
Index: trunk/lib/FlairSensorActuator/src/BatteryMonitor.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/BatteryMonitor.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/BatteryMonitor.cpp	(revision 15)
@@ -16,5 +16,4 @@
 /*********************************************************************/
 
-
 #include "BatteryMonitor.h"
 #include <Layout.h>
@@ -26,33 +25,32 @@
 using namespace flair::gui;
 
-namespace flair { namespace sensor {
+namespace flair {
+namespace sensor {
 
-BatteryMonitor::BatteryMonitor(const gui::LayoutPosition* position,string name) : GroupBox(position,name) {
-    battery=new Label(this->NewRow(),"battery");
-    battery_thresh=new DoubleSpinBox(this->LastRowLastCol(),"threshold"," V",0,24,.1,1);
+BatteryMonitor::BatteryMonitor(const gui::LayoutPosition *position, string name)
+    : GroupBox(position, name) {
+  battery = new Label(this->NewRow(), "battery");
+  battery_thresh = new DoubleSpinBox(this->LastRowLastCol(), "threshold", " V",
+                                     0, 24, .1, 1);
 }
 
-BatteryMonitor::~BatteryMonitor() {
+BatteryMonitor::~BatteryMonitor() {}
 
-}
-
-float BatteryMonitor::GetVoltage(void) const {
-    return batteryvalue;
-}
+float BatteryMonitor::GetVoltage(void) const { return batteryvalue; }
 
 bool BatteryMonitor::IsBatteryLow(void) const {
-    if(batteryvalue<battery_thresh->Value())
-        return true;
-    else
-        return false;
+  if (batteryvalue < battery_thresh->Value())
+    return true;
+  else
+    return false;
 }
 
 void BatteryMonitor::SetBatteryValue(float value) {
-    batteryvalue=value;
-    if(value>0) {
-        battery->SetText("battery: %.1fV",value);
-    } else {
-        battery->SetText("battery: unreadable");
-    }
+  batteryvalue = value;
+  if (value > 0) {
+    battery->SetText("battery: %.1fV", value);
+  } else {
+    battery->SetText("battery: unreadable");
+  }
 }
 
Index: trunk/lib/FlairSensorActuator/src/BatteryMonitor.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/BatteryMonitor.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/BatteryMonitor.h	(revision 15)
@@ -16,72 +16,67 @@
 #include <GroupBox.h>
 
-namespace flair
-{
-    namespace gui
-    {
-        class LayoutPosition;
-        class Label;
-        class DoubleSpinBox;
-    }
+namespace flair {
+namespace gui {
+class LayoutPosition;
+class Label;
+class DoubleSpinBox;
+}
 }
 
-namespace flair
-{
-namespace sensor
-{
+namespace flair {
+namespace sensor {
 
-    /*! \class BatteryMonitor
-    *
-    * \brief Base class for battery monitor
-    */
+/*! \class BatteryMonitor
+*
+* \brief Base class for battery monitor
+*/
 
-    class BatteryMonitor : public gui::GroupBox
-    {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a BatteryMonitor at given position.
-            *
-            * \param position position
-            * \param name name
-            */
-            BatteryMonitor(const gui::LayoutPosition* position,std::string name);
+class BatteryMonitor : public gui::GroupBox {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a BatteryMonitor at given position.
+  *
+  * \param position position
+  * \param name name
+  */
+  BatteryMonitor(const gui::LayoutPosition *position, std::string name);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~BatteryMonitor();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~BatteryMonitor();
 
-            /*!
-            * \brief Is batteru low?
-            *
-            * \return true if battery is below threshold
-            *
-            */
-            bool IsBatteryLow(void) const;
+  /*!
+  * \brief Is batteru low?
+  *
+  * \return true if battery is below threshold
+  *
+  */
+  bool IsBatteryLow(void) const;
 
-            /*!
-            * \brief Set battery value
-            *
-            * \param battery value
-            *
-            */
-            void SetBatteryValue(float value);
+  /*!
+  * \brief Set battery value
+  *
+  * \param battery value
+  *
+  */
+  void SetBatteryValue(float value);
 
-            /*!
-            * \brief Get battery voltage
-            *
-            * \return battery voltage
-            *
-            */
-            float GetVoltage(void) const;
+  /*!
+  * \brief Get battery voltage
+  *
+  * \return battery voltage
+  *
+  */
+  float GetVoltage(void) const;
 
-        private:
-            float batteryvalue;
-            gui::DoubleSpinBox *battery_thresh;
-            gui::Label *battery;
-    };
+private:
+  float batteryvalue;
+  gui::DoubleSpinBox *battery_thresh;
+  gui::Label *battery;
+};
 } // end namespace sensor
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/BlCtrlV2.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/BlCtrlV2.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/BlCtrlV2.cpp	(revision 15)
@@ -31,28 +31,20 @@
 using namespace flair::gui;
 
-namespace flair
-{
-namespace actuator
-{
+namespace flair {
+namespace actuator {
 
-BlCtrlV2::BlCtrlV2(const IODevice* parent,Layout* layout,string name,uint8_t motors_count,I2cPort* i2cport) : Bldc(parent,layout,name,motors_count)
-{
-    pimpl_=new BlCtrlV2_impl(this,layout,i2cport);
+BlCtrlV2::BlCtrlV2(const IODevice *parent, Layout *layout, string name,
+                   uint8_t motors_count, I2cPort *i2cport)
+    : Bldc(parent, layout, name, motors_count) {
+  pimpl_ = new BlCtrlV2_impl(this, layout, i2cport);
 }
 
-BlCtrlV2::~BlCtrlV2()
-{
-    delete pimpl_;
+BlCtrlV2::~BlCtrlV2() { delete pimpl_; }
+
+BatteryMonitor *BlCtrlV2::GetBatteryMonitor(void) const {
+  return pimpl_->battery;
 }
 
-BatteryMonitor* BlCtrlV2::GetBatteryMonitor(void) const
-{
-    return pimpl_->battery;
-}
-
-void BlCtrlV2::SetMotors(float* values)
-{
-    pimpl_->SetMotors(values);
-}
+void BlCtrlV2::SetMotors(float *values) { pimpl_->SetMotors(values); }
 
 } // end namespace actuator
Index: trunk/lib/FlairSensorActuator/src/BlCtrlV2.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/BlCtrlV2.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/BlCtrlV2.h	(revision 15)
@@ -16,91 +16,86 @@
 #include "Bldc.h"
 
-namespace flair
-{
-    namespace core
-    {
-        class FrameworkManager;
-        class I2cPort;
-    }
-    namespace sensor
-    {
-        class BatteryMonitor;
-    }
+namespace flair {
+namespace core {
+class FrameworkManager;
+class I2cPort;
+}
+namespace sensor {
+class BatteryMonitor;
+}
 }
 
 class BlCtrlV2_impl;
 
-namespace flair
-{
-namespace actuator
-{
-    /*! \class BlCtrlV2
-    *
-    * \brief Class for Mikrokopter's blctrlv2
-    *
-    * blctrlv2 drivers can also monitor the battery level. See GetBatteryMonitor().
-    */
-    class BlCtrlV2 : public Bldc
-    {
-        friend class ::BlCtrlV2_impl;
+namespace flair {
+namespace actuator {
+/*! \class BlCtrlV2
+*
+* \brief Class for Mikrokopter's blctrlv2
+*
+* blctrlv2 drivers can also monitor the battery level. See GetBatteryMonitor().
+*/
+class BlCtrlV2 : public Bldc {
+  friend class ::BlCtrlV2_impl;
 
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a BlCtrlV2.
-            *
-            * \param parent parent
-            * \param layout layout
-            * \param name name
-            * \param motors_count number of motors
-            * \param i2cport I2cPort
-            */
-            BlCtrlV2(const core::IODevice* parent,gui::Layout* layout,std::string name,uint8_t motors_count,core::I2cPort* i2cport);
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a BlCtrlV2.
+  *
+  * \param parent parent
+  * \param layout layout
+  * \param name name
+  * \param motors_count number of motors
+  * \param i2cport I2cPort
+  */
+  BlCtrlV2(const core::IODevice *parent, gui::Layout *layout, std::string name,
+           uint8_t motors_count, core::I2cPort *i2cport);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~BlCtrlV2();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~BlCtrlV2();
 
-            /*!
-            * \brief Get battery monitor
-            *
-            * \return BatteryMonitor
-            */
-            sensor::BatteryMonitor* GetBatteryMonitor(void) const;
+  /*!
+  * \brief Get battery monitor
+  *
+  * \return BatteryMonitor
+  */
+  sensor::BatteryMonitor *GetBatteryMonitor(void) const;
 
-            /*!
-            * \brief Has speed measurement
-            *
-            * Reimplemented from Bldc. \n
-            *
-            * \return true if it has speed measurement
-            */
-            bool HasSpeedMeasurement(void) const{return true;};
+  /*!
+  * \brief Has speed measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has speed measurement
+  */
+  bool HasSpeedMeasurement(void) const { return true; };
 
-            /*!
-            * \brief Has current measurement
-            *
-            * Reimplemented from Bldc. \n
-            *
-            * \return true if it has current measurement
-            */
-            bool HasCurrentMeasurement(void) const{return true;};
+  /*!
+  * \brief Has current measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has current measurement
+  */
+  bool HasCurrentMeasurement(void) const { return true; };
 
-        private:
-            /*!
-            * \brief Set motors values
-            *
-            * Reimplemented from Bldc. \n
-            * Values size must be the same as MotorsCount()
-            *
-            * \param values motor values
-            */
-            void SetMotors(float* values);
+private:
+  /*!
+  * \brief Set motors values
+  *
+  * Reimplemented from Bldc. \n
+  * Values size must be the same as MotorsCount()
+  *
+  * \param values motor values
+  */
+  void SetMotors(float *values);
 
-            class BlCtrlV2_impl* pimpl_;
-    };
+  class BlCtrlV2_impl *pimpl_;
+};
 } // end namespace actuator
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/BlCtrlV2_impl.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/BlCtrlV2_impl.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/BlCtrlV2_impl.cpp	(revision 15)
@@ -35,171 +35,176 @@
 using namespace flair::actuator;
 
-BlCtrlV2_impl::BlCtrlV2_impl(BlCtrlV2* self,Layout *layout,I2cPort* i2cport) {
-    this->self=self;
-	this->i2cport=i2cport;
-	last_voltage_time=0;
-
-    DetectMotors();
-    //if(nb_mot!=self->MotorsCount()) self->Err("motors count different from multiplex count\n");
-
-    //BatteryMonitor
-    battery=new BatteryMonitor(layout->NewRow(),"battery");
-
-    //user interface
-    GroupBox *setupgroupbox=new GroupBox(layout->NewRow(),"Motors");
-    poles=new SpinBox(setupgroupbox->NewRow(),"nb poles:",0,255,1,14);
-}
-
-BlCtrlV2_impl::~BlCtrlV2_impl() {
-
-}
-
-void BlCtrlV2_impl::SetMotors(float* value) {
-    uint16_t tosend_value[nb_mot];
-    //stocke dans une variable pour garder le moins longtemps l'i2c (pour ne pas bloquer sur le mutex de l'output)
-    float speeds[nb_mot];
-    float currents[nb_mot];
-
-    for(int i=0;i<nb_mot;i++) tosend_value[i]=(uint16_t)(MAX_VALUE*value[i]);
-
-    i2cport->GetMutex();
-
-    for(int i=0;i<nb_mot;i++) {
-        i2cport->SetSlave(BASE_ADDRESS+i);
-        WriteValue(tosend_value[i]);
+BlCtrlV2_impl::BlCtrlV2_impl(BlCtrlV2 *self, Layout *layout, I2cPort *i2cport) {
+  this->self = self;
+  this->i2cport = i2cport;
+  last_voltage_time = 0;
+
+  DetectMotors();
+  // if(nb_mot!=self->MotorsCount()) self->Err("motors count different from
+  // multiplex count\n");
+
+  // BatteryMonitor
+  battery = new BatteryMonitor(layout->NewRow(), "battery");
+
+  // user interface
+  GroupBox *setupgroupbox = new GroupBox(layout->NewRow(), "Motors");
+  poles = new SpinBox(setupgroupbox->NewRow(), "nb poles:", 0, 255, 1, 14);
+}
+
+BlCtrlV2_impl::~BlCtrlV2_impl() {}
+
+void BlCtrlV2_impl::SetMotors(float *value) {
+  uint16_t tosend_value[nb_mot];
+  // stocke dans une variable pour garder le moins longtemps l'i2c (pour ne pas
+  // bloquer sur le mutex de l'output)
+  float speeds[nb_mot];
+  float currents[nb_mot];
+
+  for (int i = 0; i < nb_mot; i++)
+    tosend_value[i] = (uint16_t)(MAX_VALUE * value[i]);
+
+  i2cport->GetMutex();
+
+  for (int i = 0; i < nb_mot; i++) {
+    i2cport->SetSlave(BASE_ADDRESS + i);
+    WriteValue(tosend_value[i]);
+  }
+
+  for (int i = 0; i < nb_mot; i++) {
+    i2cport->SetSlave(BASE_ADDRESS + i);
+
+    if (i == 0 && GetTime() > (last_voltage_time + 5 * (Time)1000000000)) {
+      // toute les 5 secondes sur moteur 0
+      float voltage;
+      GetCurrentSpeedAndVoltage(currents[i], speeds[i], voltage);
+      battery->SetBatteryValue(voltage);
+      last_voltage_time = GetTime();
+    } else {
+      GetCurrentAndSpeed(currents[i], speeds[i]);
     }
-
-    for(int i=0;i<nb_mot;i++) {
-        i2cport->SetSlave(BASE_ADDRESS+i);
-
-        if(i==0 && GetTime()>(last_voltage_time+5*(Time)1000000000)) {
-            //toute les 5 secondes sur moteur 0
-            float voltage;
-            GetCurrentSpeedAndVoltage(currents[i],speeds[i],voltage);
-            battery->SetBatteryValue(voltage);
-            last_voltage_time=GetTime();
-        } else {
-            GetCurrentAndSpeed(currents[i],speeds[i]);
-        }
+  }
+  // printf("%f %f %f %f\n",speeds[0],speeds[1],speeds[2],speeds[3]);
+  /*
+      if(GetTime()>(last_voltage_time+5*(Time)1000000000))//toute les 5 secondes
+      {
+          i2cport->SetSlave(BASE_ADDRESS);
+          battery->SetBatteryValue(ReadVoltage());
+          last_voltage_time=GetTime();
+      }
+  */
+  i2cport->ReleaseMutex();
+
+  // on prend une fois pour toute le mutex et on fait des accès directs
+  cvmatrix *output = self->output;
+  output->GetMutex();
+  for (int i = 0; i < nb_mot; i++)
+    output->SetValueNoMutex(i, 0, speeds[i]);
+  for (int i = 0; i < nb_mot; i++)
+    output->SetValueNoMutex(i, 1, currents[i]);
+  output->ReleaseMutex();
+}
+
+// I2cPort mutex must be taken before calling this function
+void BlCtrlV2_impl::WriteValue(uint16_t value) {
+  uint8_t tx[2];
+  ssize_t written;
+
+  tx[0] = (uint8_t)(value >> 3); // msb
+  tx[1] = (value & 0x07);
+  ; //+16+8; //pour recuperer la vitesse en premier
+  written = i2cport->Write(tx, 2);
+  if (written < 0) {
+    self->Err("rt_dev_write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(tx)) {
+    self->Err("rt_dev_write error %i/%i\n", written, sizeof(tx));
+  }
+}
+
+// I2cPort mutex must be taken before calling this function
+void BlCtrlV2_impl::GetCurrentAndSpeed(float &current, float &speed) {
+  ssize_t read;
+  uint8_t value[4];
+  read = i2cport->Read(value, sizeof(value));
+
+  if (read < 0) {
+    self->Err("rt_dev_read error (%s)\n", strerror(-read));
+    speed = -1;
+    current = -1;
+  } else if (read != sizeof(value)) {
+    self->Err("rt_dev_read error %i/%i\n", read, sizeof(value));
+    speed = -1;
+    current = -1;
+  } else {
+    current = value[0] / 10.;
+    speed = value[3] * 780. / poles->Value();
+  }
+}
+
+// I2cPort mutex must be taken before calling this function
+void BlCtrlV2_impl::GetCurrentSpeedAndVoltage(float &current, float &speed,
+                                              float &voltage) {
+  ssize_t read;
+  uint8_t value[6];
+  read = i2cport->Read(value, sizeof(value));
+
+  if (read < 0) {
+    self->Err("rt_dev_read error (%s)\n", strerror(-read));
+    speed = -1;
+    voltage = -1;
+    current = -1;
+  } else if (read != sizeof(value)) {
+    self->Err("rt_dev_read error %i/%i\n", read, sizeof(value));
+    speed = -1;
+    voltage = -1;
+    current = -1;
+  } else {
+    current = value[0] / 10.;
+    voltage = value[5] / 10.;
+    speed = value[3] * 780. / poles->Value();
+  }
+}
+
+void BlCtrlV2_impl::DetectMotors(void) {
+  int nb = 0;
+  ssize_t read, nb_write;
+  uint8_t value[3];
+  uint8_t tx[2];
+
+  i2cport->GetMutex();
+
+  for (int i = 0; i < MAX_MOTORS; i++) {
+    // printf("test %i\n",i);
+    i2cport->SetSlave(BASE_ADDRESS + i);
+    tx[0] = 0;
+    tx[1] = 16 + 8; // 16+8 pour recuperer la vitesse
+
+    nb_write = i2cport->Write(tx, 2);
+
+    if (nb_write != sizeof(tx)) {
+      continue;
     }
-//printf("%f %f %f %f\n",speeds[0],speeds[1],speeds[2],speeds[3]);
-/*
-    if(GetTime()>(last_voltage_time+5*(Time)1000000000))//toute les 5 secondes
-    {
-        i2cport->SetSlave(BASE_ADDRESS);
-        battery->SetBatteryValue(ReadVoltage());
-        last_voltage_time=GetTime();
+    nb++;
+  }
+
+  for (int i = 0; i < MAX_MOTORS; i++) {
+    i2cport->SetSlave(BASE_ADDRESS + i);
+    read = i2cport->Read(value, 3);
+
+    if (read != sizeof(value)) {
+      continue;
     }
-*/
-    i2cport->ReleaseMutex();
-
-    //on prend une fois pour toute le mutex et on fait des accès directs
-    cvmatrix* output=self->output;
-    output->GetMutex();
-    for(int i=0;i<nb_mot;i++) output->SetValueNoMutex(i,0,speeds[i]);
-    for(int i=0;i<nb_mot;i++) output->SetValueNoMutex(i,1,currents[i]);
-    output->ReleaseMutex();
-}
-
-//I2cPort mutex must be taken before calling this function
-void BlCtrlV2_impl::WriteValue(uint16_t value) {
-    uint8_t tx[2];
-    ssize_t written;
-
-    tx[0]=(uint8_t)(value>>3);//msb
-    tx[1]=(value&0x07);;//+16+8; //pour recuperer la vitesse en premier
-    written =i2cport->Write(tx, 2);
-    if(written<0) {
-        self->Err("rt_dev_write error (%s)\n",strerror(-written));
-    } else if (written != sizeof(tx)) {
-        self->Err("rt_dev_write error %i/%i\n",written,sizeof(tx));
-    }
-}
-
-//I2cPort mutex must be taken before calling this function
-void BlCtrlV2_impl::GetCurrentAndSpeed(float &current,float &speed) {
-    ssize_t read;
-    uint8_t value[4];
-    read = i2cport->Read(value, sizeof(value));
-
-    if(read<0) {
-        self->Err("rt_dev_read error (%s)\n",strerror(-read));
-        speed=-1;
-        current=-1;
-    } else if (read != sizeof(value)) {
-        self->Err("rt_dev_read error %i/%i\n",read,sizeof(value));
-        speed=-1;
-        current=-1;
-    } else {
-        current=value[0]/10.;
-        speed= value[3]*780./poles->Value();
-    }
-}
-
-//I2cPort mutex must be taken before calling this function
-void BlCtrlV2_impl::GetCurrentSpeedAndVoltage(float &current,float &speed,float &voltage) {
-    ssize_t read;
-    uint8_t value[6];
-    read = i2cport->Read(value, sizeof(value));
-
-    if(read<0) {
-        self->Err("rt_dev_read error (%s)\n",strerror(-read));
-        speed=-1;
-        voltage=-1;
-        current=-1;
-    } else if (read != sizeof(value)) {
-        self->Err("rt_dev_read error %i/%i\n",read,sizeof(value));
-        speed=-1;
-        voltage=-1;
-        current=-1;
-    } else {
-        current=value[0]/10.;
-        voltage=value[5]/10.;
-        speed= value[3]*780./poles->Value();
-    }
-}
-
-void BlCtrlV2_impl::DetectMotors(void) {
-    int nb=0;
-    ssize_t read,nb_write;
-    uint8_t value[3];
-    uint8_t tx[2];
-
-    i2cport->GetMutex();
-
-    for(int i=0;i<MAX_MOTORS;i++) {
-        //printf("test %i\n",i);
-        i2cport->SetSlave(BASE_ADDRESS+i);
-        tx[0]=0;
-        tx[1]=16+8;//16+8 pour recuperer la vitesse
-
-        nb_write = i2cport->Write(tx, 2);
-
-        if (nb_write != sizeof(tx)) {
-            continue;
-        }
-        nb++;
-    }
-
-    for(int i=0;i<MAX_MOTORS;i++) {
-        i2cport->SetSlave(BASE_ADDRESS+i);
-        read = i2cport->Read(value, 3);
-
-        if (read != sizeof(value)) {
-            continue;
-        }
-    }
-
-    i2cport->ReleaseMutex();
-
-    Printf("BlCtrlV2: Dectected motors: %i\n",nb);
-    if(nb==4) {
-        Printf("BlCtrlV2: Configuration X4\n");
-    } else if(nb==8) {
-        Printf("BlCtrlV2: Configuration X8\n");
-    } else {
-        //self->Err("Error, configuration not supported (%i/%i)\n",nb,MAX_MOTORS);
-    }
-
-    nb_mot=nb;
-}
+  }
+
+  i2cport->ReleaseMutex();
+
+  Printf("BlCtrlV2: Dectected motors: %i\n", nb);
+  if (nb == 4) {
+    Printf("BlCtrlV2: Configuration X4\n");
+  } else if (nb == 8) {
+    Printf("BlCtrlV2: Configuration X8\n");
+  } else {
+    // self->Err("Error, configuration not supported (%i/%i)\n",nb,MAX_MOTORS);
+  }
+
+  nb_mot = nb;
+}
Index: trunk/lib/FlairSensorActuator/src/BlCtrlV2_x4_speed.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/BlCtrlV2_x4_speed.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/BlCtrlV2_x4_speed.cpp	(revision 15)
@@ -38,506 +38,453 @@
 using namespace flair::gui;
 
-namespace flair
-{
-namespace actuator
-{
-BlCtrlV2_x4_speed::BlCtrlV2_x4_speed(FrameworkManager* parent,string name,I2cPort* i2cport,uint8_t base_address,uint8_t priority) : Thread(parent,name,priority),IODevice(parent,name)
-{
-    this->i2cport=i2cport;
-	slave_address=base_address;
-	tested_motor=-1;
-	enabled=false;
-	int_av_g=0;
-	int_av_d=0;
-	int_ar_g=0;
-	int_ar_d=0;
-
-	//flight time
-	FILE *file;
-    file=fopen("/etc/flight_time","r");
-    if (file == NULL)
-    {
-        Printf("fichier d'info de vol vide\n");
-        time_sec=0;
+namespace flair {
+namespace actuator {
+BlCtrlV2_x4_speed::BlCtrlV2_x4_speed(FrameworkManager *parent, string name,
+                                     I2cPort *i2cport, uint8_t base_address,
+                                     uint8_t priority)
+    : Thread(parent, name, priority), IODevice(parent, name) {
+  this->i2cport = i2cport;
+  slave_address = base_address;
+  tested_motor = -1;
+  enabled = false;
+  int_av_g = 0;
+  int_av_d = 0;
+  int_ar_g = 0;
+  int_ar_d = 0;
+
+  // flight time
+  FILE *file;
+  file = fopen("/etc/flight_time", "r");
+  if (file == NULL) {
+    Printf("fichier d'info de vol vide\n");
+    time_sec = 0;
+  } else {
+    char ligne[32];
+    fgets(ligne, 32, file);
+    time_sec = atoi(ligne);
+    Printf("temps de vol total: %is = %imin = %ih\n", time_sec, time_sec / 60,
+           time_sec / 3600);
+    fclose(file);
+  }
+
+  // station sol
+  main_tab = new Tab(parent->GetTabWidget(), name);
+  tab = new TabWidget(main_tab->NewRow(), name);
+  Tab *sensor_tab = new Tab(tab, "Reglages");
+  reglages_groupbox = new GroupBox(sensor_tab->NewRow(), name);
+  poles = new SpinBox(reglages_groupbox->NewRow(), "nb poles", 0, 255, 1);
+  kp = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(), "kp", 0., 255,
+                         0.001, 4);
+  ki = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(), "ki", 0., 255,
+                         0.001, 4);
+  min = new SpinBox(reglages_groupbox->NewRow(), "min pwm", 0., 2048, 1);
+  max =
+      new SpinBox(reglages_groupbox->LastRowLastCol(), "max pwm", 0., 2048, 1);
+  test = new SpinBox(reglages_groupbox->LastRowLastCol(), "test value", 0.,
+                     2048, 1);
+  start_value = new SpinBox(reglages_groupbox->NewRow(), "valeur demarrage", 0,
+                            10000, 10);
+  trim = new DoubleSpinBox(reglages_groupbox->LastRowLastCol(), "pas decollage",
+                           0, 1000, .1);
+
+  av_g = new ComboBox(reglages_groupbox->NewRow(), "avant gauche");
+  av_g->AddItem("1");
+  av_g->AddItem("2");
+  av_g->AddItem("3");
+  av_g->AddItem("4");
+  button_avg = new PushButton(reglages_groupbox->LastRowLastCol(), "test avg");
+
+  av_d = new ComboBox(reglages_groupbox->LastRowLastCol(), "avant droite:");
+  av_d->AddItem("1");
+  av_d->AddItem("2");
+  av_d->AddItem("3");
+  av_d->AddItem("4");
+  button_avd = new PushButton(reglages_groupbox->LastRowLastCol(), "test avd");
+
+  ar_g = new ComboBox(reglages_groupbox->NewRow(), "arriere gauche:");
+  ar_g->AddItem("1");
+  ar_g->AddItem("2");
+  ar_g->AddItem("3");
+  ar_g->AddItem("4");
+  button_arg = new PushButton(reglages_groupbox->LastRowLastCol(), "test arg");
+
+  ar_d = new ComboBox(reglages_groupbox->LastRowLastCol(), "arriere droite:");
+  ar_d->AddItem("1");
+  ar_d->AddItem("2");
+  ar_d->AddItem("3");
+  ar_d->AddItem("4");
+  button_ard = new PushButton(reglages_groupbox->LastRowLastCol(), "test ard");
+
+  pas = new ComboBox(reglages_groupbox->NewRow(), "pas helice avant gauche:");
+  pas->AddItem("normal");
+  pas->AddItem("inverse");
+
+  input = new cvmatrix((IODevice *)this, 8, 1, floatType);
+
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(4, 2);
+  desc->SetElementName(0, 0, "avant gauche");
+  desc->SetElementName(1, 0, "arriere droite");
+  desc->SetElementName(2, 0, "avant droite");
+  desc->SetElementName(3, 0, "arriere gauche");
+
+  desc->SetElementName(0, 1, "cons avant gauche");
+  desc->SetElementName(1, 1, "cons arriere droite");
+  desc->SetElementName(2, 1, "cons avant droite");
+  desc->SetElementName(3, 1, "cons arriere gauche");
+  output = new cvmatrix((IODevice *)this, desc, floatType);
+
+  /*
+
+  //le 3ieme lu est la tension batteire
+          if(i2c_mutex!=NULL) i2c_mutex->GetMutex();
+      uint16_t pwm_moteur;
+      pwm_moteur=0;
+      ssize_t read;
+      uint8_t rx[8];
+      SetSlave(slave_address);
+
+      for(int j=0;j<10;j++)
+      {
+
+
+          WriteValue(pwm_moteur);
+
+
+          read = rt_dev_read(i2c_fd, rx, sizeof(rx));
+
+          if(read<0)
+          {
+              rt_printf("BlCtrlV2_x4_speed::BlCtrlV2_x4_speed: %s, erreur
+  rt_dev_read (%s)\n",IODevice::ObjectName().c_str(),strerror(-read));
+          }
+          else if (read != sizeof(rx))
+          {
+              rt_printf("BlCtrlV2_x4_speed::BlCtrlV2_x4_speed: %s, erreur
+  rt_dev_read %i/2\n",IODevice::ObjectName().c_str(),read);
+
+          }
+          for(int i=0;i<sizeof(rx);i++) printf("%i ",rx[i]);
+
+          printf("\n");
+
+      }
+
+      if(i2c_mutex!=NULL) i2c_mutex->ReleaseMutex();*/
+}
+
+BlCtrlV2_x4_speed::~BlCtrlV2_x4_speed(void) {
+  SafeStop();
+  Join();
+  delete main_tab;
+}
+
+void BlCtrlV2_x4_speed::UseDefaultPlot(void) {
+  Tab *plot_tab = new Tab(tab, "Mesures");
+  DataPlot1D *av_g_plot = new DataPlot1D(plot_tab->NewRow(), "avg", 0, 10000);
+  av_g_plot->AddCurve(output->Element(0, 0));
+  av_g_plot->AddCurve(output->Element(0, 1), DataPlot::Blue);
+  DataPlot1D *av_d_plot =
+      new DataPlot1D(plot_tab->LastRowLastCol(), "avd", 0, 10000);
+  av_d_plot->AddCurve(output->Element(2, 0));
+  av_d_plot->AddCurve(output->Element(2, 1), DataPlot::Blue);
+  DataPlot1D *ar_g_plot = new DataPlot1D(plot_tab->NewRow(), "arg", 0, 10000);
+  ar_g_plot->AddCurve(output->Element(3, 0));
+  ar_g_plot->AddCurve(output->Element(3, 1), DataPlot::Blue);
+  DataPlot1D *ar_d_plot =
+      new DataPlot1D(plot_tab->LastRowLastCol(), "ard", 0, 10000);
+  ar_d_plot->AddCurve(output->Element(1, 0));
+  ar_d_plot->AddCurve(output->Element(1, 1), DataPlot::Blue);
+}
+
+float BlCtrlV2_x4_speed::TrimValue(void) { return (float)trim->Value(); }
+
+int BlCtrlV2_x4_speed::StartValue(void) { return start_value->Value(); }
+
+void BlCtrlV2_x4_speed::Run(void) {
+  WarnUponSwitches(true);
+
+  SetPeriodUS(TAU_US);
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    Update();
+  }
+
+  WarnUponSwitches(false);
+}
+
+void BlCtrlV2_x4_speed::Update(void) {
+  float u_roll, u_pitch, u_yaw, u_gaz;
+  float trim_roll, trim_pitch, trim_yaw;
+  float pwm[4];
+  uint16_t pwm_moteur[4];
+
+  // on prend une fois pour toute le mutex et on fait des accès directs
+  input->GetMutex();
+
+  u_roll = input->ValueNoMutex(0, 0);
+  u_pitch = input->ValueNoMutex(1, 0);
+  u_yaw = input->ValueNoMutex(2, 0);
+  u_gaz =
+      input->ValueNoMutex(3, 0) +
+      input->ValueNoMutex(7, 0) * input->ValueNoMutex(7, 0); // ugaz+trim*trim
+  trim_roll = input->ValueNoMutex(4, 0);
+  trim_pitch = input->ValueNoMutex(5, 0);
+  trim_yaw = input->ValueNoMutex(6, 0);
+
+  input->ReleaseMutex();
+
+  if (pas->CurrentIndex() == 1) {
+    trim_yaw = -trim_yaw;
+    u_yaw = -u_yaw;
+  }
+
+  // rt_printf("%f %f %f %f\n",u_roll,u_pitch,u_yaw,u_gaz);
+  // if(u_gaz!=0) rt_printf("gaz: %f\n",u_gaz);
+
+  // avant gauche
+  if (u_gaz + u_pitch + u_roll + u_yaw > 0) {
+    pwm[0] = trim_pitch + trim_roll + trim_yaw +
+             sqrtf(u_gaz + u_pitch + u_roll + u_yaw);
+  } else {
+    pwm[0] = trim_pitch + trim_roll + trim_yaw;
+  }
+
+  // arriere gauche
+  if (u_gaz - u_pitch + u_roll - u_yaw > 0) {
+    pwm[3] = -trim_pitch + trim_roll - trim_yaw +
+             sqrtf(u_gaz - u_pitch + u_roll - u_yaw);
+  } else {
+    pwm[3] = -trim_pitch + trim_roll - trim_yaw;
+  }
+
+  // arriere droit
+  if (u_gaz - u_pitch - u_roll + u_yaw > 0) {
+    pwm[1] = -trim_pitch - trim_roll + trim_yaw +
+             sqrtf(u_gaz - u_pitch - u_roll + u_yaw);
+  } else {
+    pwm[1] = -trim_pitch - trim_roll + trim_yaw;
+  }
+
+  // avant droit
+  if (u_gaz + u_pitch - u_roll - u_yaw > 0) {
+    pwm[2] = trim_pitch - trim_roll - trim_yaw +
+             sqrtf(u_gaz + u_pitch - u_roll - u_yaw);
+  } else {
+    pwm[2] = trim_pitch - trim_roll - trim_yaw;
+  }
+
+  int_av_g += ki->Value() * (pwm[0] - speed_av_g);
+  pwm[0] = kp->Value() * (pwm[0] - speed_av_g) + int_av_g;
+
+  int_ar_g += ki->Value() * (pwm[3] - speed_ar_g);
+  pwm[3] = kp->Value() * (pwm[3] - speed_ar_g) + int_ar_g;
+
+  int_ar_d += ki->Value() * (pwm[1] - speed_ar_d);
+  pwm[1] = kp->Value() * (pwm[1] - speed_ar_d) + int_ar_d;
+
+  int_av_d += ki->Value() * (pwm[2] - speed_av_d);
+  pwm[2] = kp->Value() * (pwm[2] - speed_av_d) + int_av_d;
+
+  // rt_printf("%f\n",pwm[0]);
+  for (int i = 0; i < 4; i++)
+    pwm_moteur[i] = SatPWM(pwm[i], min->Value(), max->Value());
+
+  if (button_avg->Clicked() == true) {
+    tested_motor = 0;
+    StartTest();
+  }
+  if (button_avd->Clicked() == true) {
+    tested_motor = 2;
+    StartTest();
+  }
+  if (button_arg->Clicked() == true) {
+    tested_motor = 3;
+    StartTest();
+  }
+  if (button_ard->Clicked() == true) {
+    tested_motor = 1;
+    StartTest();
+  }
+
+  if (tested_motor != -1) {
+    for (int i = 0; i < 4; i++) {
+      pwm_moteur[i] = 0;
     }
-    else
-    {
-        char ligne[32];
-        fgets(ligne, 32, file);
-        time_sec=atoi(ligne);
-        Printf("temps de vol total: %is = %imin = %ih\n",time_sec,time_sec/60,time_sec/3600);
-        fclose(file);
+    pwm_moteur[tested_motor] = (uint16_t)test->Value();
+
+    if (GetTime() > (start_time + 2 * 1000000000))
+      StopTest();
+  }
+
+  i2cport->GetMutex();
+
+  if (enabled == true) {
+    i2cport->SetSlave(slave_address + av_g->CurrentIndex());
+    WriteValue(pwm_moteur[0]);
+
+    i2cport->SetSlave(slave_address + av_d->CurrentIndex());
+    WriteValue(pwm_moteur[2]);
+
+    i2cport->SetSlave(slave_address + ar_g->CurrentIndex());
+    WriteValue(pwm_moteur[3]);
+
+    i2cport->SetSlave(slave_address + ar_d->CurrentIndex());
+    WriteValue(pwm_moteur[1]);
+
+  } else {
+    for (int i = 0; i < 4; i++) {
+      i2cport->SetSlave(slave_address + i);
+      WriteValue(0);
     }
-
-    //station sol
-    main_tab=new Tab(parent->GetTabWidget(),name);
-    tab=new TabWidget(main_tab->NewRow(),name);
-	Tab *sensor_tab=new Tab(tab,"Reglages");
-	reglages_groupbox=new GroupBox(sensor_tab->NewRow(),name);
-            poles=new SpinBox(reglages_groupbox->NewRow(),"nb poles",0,255,1);
-            kp=new DoubleSpinBox(reglages_groupbox->LastRowLastCol(),"kp",0.,255,0.001,4);
-            ki=new DoubleSpinBox(reglages_groupbox->LastRowLastCol(),"ki",0.,255,0.001,4);
-            min=new SpinBox(reglages_groupbox->NewRow(),"min pwm",0.,2048,1);
-            max=new SpinBox(reglages_groupbox->LastRowLastCol(),"max pwm",0.,2048,1);
-            test=new SpinBox(reglages_groupbox->LastRowLastCol(),"test value",0.,2048,1);
-            start_value=new SpinBox(reglages_groupbox->NewRow(),"valeur demarrage",0,10000,10);
-            trim=new DoubleSpinBox(reglages_groupbox->LastRowLastCol(),"pas decollage",0,1000,.1);
-
-            av_g=new ComboBox(reglages_groupbox->NewRow(),"avant gauche");
-            av_g->AddItem("1");
-            av_g->AddItem("2");
-            av_g->AddItem("3");
-            av_g->AddItem("4");
-            button_avg=new PushButton(reglages_groupbox->LastRowLastCol(),"test avg");
-
-            av_d=new ComboBox(reglages_groupbox->LastRowLastCol(),"avant droite:");
-            av_d->AddItem("1");
-            av_d->AddItem("2");
-            av_d->AddItem("3");
-            av_d->AddItem("4");
-            button_avd=new PushButton(reglages_groupbox->LastRowLastCol(),"test avd");
-
-            ar_g=new ComboBox(reglages_groupbox->NewRow(),"arriere gauche:");
-            ar_g->AddItem("1");
-            ar_g->AddItem("2");
-            ar_g->AddItem("3");
-            ar_g->AddItem("4");
-            button_arg=new PushButton(reglages_groupbox->LastRowLastCol(),"test arg");
-
-            ar_d=new ComboBox(reglages_groupbox->LastRowLastCol(),"arriere droite:");
-            ar_d->AddItem("1");
-            ar_d->AddItem("2");
-            ar_d->AddItem("3");
-            ar_d->AddItem("4");
-            button_ard=new PushButton(reglages_groupbox->LastRowLastCol(),"test ard");
-
-            pas=new ComboBox(reglages_groupbox->NewRow(),"pas helice avant gauche:");
-            pas->AddItem("normal");
-            pas->AddItem("inverse");
-
-    input=new cvmatrix((IODevice*)this,8,1,floatType);
-
-    cvmatrix_descriptor* desc=new cvmatrix_descriptor(4,2);
-    desc->SetElementName(0,0,"avant gauche");
-	desc->SetElementName(1,0,"arriere droite");
-	desc->SetElementName(2,0,"avant droite");
-	desc->SetElementName(3,0,"arriere gauche");
-
-	desc->SetElementName(0,1,"cons avant gauche");
-	desc->SetElementName(1,1,"cons arriere droite");
-	desc->SetElementName(2,1,"cons avant droite");
-	desc->SetElementName(3,1,"cons arriere gauche");
-    output=new cvmatrix((IODevice*)this,desc,floatType);
-
-
-
-/*
-
-//le 3ieme lu est la tension batteire
-	if(i2c_mutex!=NULL) i2c_mutex->GetMutex();
-    uint16_t pwm_moteur;
-    pwm_moteur=0;
-    ssize_t read;
-    uint8_t rx[8];
-    SetSlave(slave_address);
-
-    for(int j=0;j<10;j++)
-    {
-
-
-        WriteValue(pwm_moteur);
-
-
-        read = rt_dev_read(i2c_fd, rx, sizeof(rx));
-
-        if(read<0)
-        {
-            rt_printf("BlCtrlV2_x4_speed::BlCtrlV2_x4_speed: %s, erreur rt_dev_read (%s)\n",IODevice::ObjectName().c_str(),strerror(-read));
-        }
-        else if (read != sizeof(rx))
-        {
-            rt_printf("BlCtrlV2_x4_speed::BlCtrlV2_x4_speed: %s, erreur rt_dev_read %i/2\n",IODevice::ObjectName().c_str(),read);
-
-        }
-        for(int i=0;i<sizeof(rx);i++) printf("%i ",rx[i]);
-
-        printf("\n");
-
+    int_av_g = 0;
+    int_av_d = 0;
+    int_ar_g = 0;
+    int_ar_d = 0;
+  }
+
+  i2cport->SetSlave(slave_address + av_g->CurrentIndex());
+  speed_av_g = GetSpeed();
+
+  i2cport->SetSlave(slave_address + av_d->CurrentIndex());
+  speed_av_d = GetSpeed();
+
+  i2cport->SetSlave(slave_address + ar_g->CurrentIndex());
+  speed_ar_g = GetSpeed();
+
+  i2cport->SetSlave(slave_address + ar_d->CurrentIndex());
+  speed_ar_d = GetSpeed();
+
+  i2cport->ReleaseMutex();
+
+  // on prend une fois pour toute le mutex et on fait des accès directs
+  output->GetMutex();
+  output->SetValueNoMutex(0, 0, speed_av_g);
+  output->SetValueNoMutex(1, 0, speed_ar_d);
+  output->SetValueNoMutex(2, 0, speed_av_d);
+  output->SetValueNoMutex(3, 0, speed_ar_g);
+  // rt_printf("%i %i %i
+  // %i\n",pwm_moteur[0],pwm_moteur[1],pwm_moteur[2],pwm_moteur[3]);
+  output->ReleaseMutex();
+
+  output->SetDataTime(GetTime());
+  ProcessUpdate(output);
+}
+
+void BlCtrlV2_x4_speed::StartTest(void) {
+  start_time = GetTime();
+  SetEnabled(true);
+}
+
+void BlCtrlV2_x4_speed::StopTest(void) {
+  SetEnabled(false);
+  tested_motor = -1;
+}
+
+uint16_t BlCtrlV2_x4_speed::SatPWM(float vel_cons, uint16_t min, uint16_t max) {
+  uint16_t sat_value = (uint16_t)vel_cons;
+
+  if (vel_cons > ((float)sat_value + 0.5))
+    sat_value++;
+
+  if (vel_cons < (float)min)
+    sat_value = min;
+  if (vel_cons > (float)max)
+    sat_value = max;
+
+  return sat_value;
+}
+
+void BlCtrlV2_x4_speed::LockUserInterface(void) {
+  reglages_groupbox->setEnabled(false);
+}
+
+void BlCtrlV2_x4_speed::UnlockUserInterface(void) {
+  reglages_groupbox->setEnabled(true);
+}
+
+void BlCtrlV2_x4_speed::SetEnabled(bool status) {
+  enabled = status;
+  if (enabled == true) {
+    LockUserInterface();
+
+    flight_start_time = GetTime();
+  } else {
+    UnlockUserInterface();
+
+    Time now = GetTime();
+    int t_sec;
+    FILE *file;
+    char ligne[32];
+
+    t_sec = (now - flight_start_time) / 1000000000;
+    time_sec += t_sec;
+
+    Printf("temps de vol: %is = %imin\n", t_sec, t_sec / 60);
+    Printf("temps de vol total: %is = %imin = %ih\n", time_sec, time_sec / 60,
+           time_sec / 3600);
+
+    file = fopen("/etc/flight_time", "w");
+    if (file == NULL) {
+      Thread::Err("Erreur a l'ouverture du fichier d'info vol\n");
+    } else {
+      sprintf(ligne, "%i", time_sec);
+      fputs(ligne, file);
+      fclose(file);
     }
-
-    if(i2c_mutex!=NULL) i2c_mutex->ReleaseMutex();*/
-}
-
-BlCtrlV2_x4_speed::~BlCtrlV2_x4_speed(void)
-{
-    SafeStop();
-    Join();
-    delete main_tab;
-}
-
-void BlCtrlV2_x4_speed::UseDefaultPlot(void)
-{
-    Tab *plot_tab=new Tab(tab,"Mesures");
-        DataPlot1D *av_g_plot=new DataPlot1D(plot_tab->NewRow(),"avg",0,10000);
-            av_g_plot->AddCurve(output->Element(0,0));
-            av_g_plot->AddCurve(output->Element(0,1),DataPlot::Blue);
-        DataPlot1D *av_d_plot=new DataPlot1D(plot_tab->LastRowLastCol(),"avd",0,10000);
-            av_d_plot->AddCurve(output->Element(2,0));
-            av_d_plot->AddCurve(output->Element(2,1),DataPlot::Blue);
-        DataPlot1D *ar_g_plot=new DataPlot1D(plot_tab->NewRow(),"arg",0,10000);
-            ar_g_plot->AddCurve(output->Element(3,0));
-            ar_g_plot->AddCurve(output->Element(3,1),DataPlot::Blue);
-        DataPlot1D *ar_d_plot=new DataPlot1D(plot_tab->LastRowLastCol(),"ard",0,10000);
-            ar_d_plot->AddCurve(output->Element(1,0));
-            ar_d_plot->AddCurve(output->Element(1,1),DataPlot::Blue);
-}
-
-float BlCtrlV2_x4_speed::TrimValue(void)
-{
-    return (float)trim->Value();
-}
-
-int BlCtrlV2_x4_speed::StartValue(void)
-{
-    return start_value->Value();
-}
-
-void BlCtrlV2_x4_speed::Run(void)
-{
-    WarnUponSwitches(true);
-
-    SetPeriodUS(TAU_US);
-
-    while(!ToBeStopped())
-    {
-        WaitPeriod();
-
-        Update();
-    }
-
-    WarnUponSwitches(false);
-}
-
-void BlCtrlV2_x4_speed::Update(void)
-{
-    float u_roll,u_pitch,u_yaw,u_gaz;
-    float trim_roll,trim_pitch,trim_yaw;
-    float pwm[4];
-    uint16_t pwm_moteur[4];
-
-
-    //on prend une fois pour toute le mutex et on fait des accès directs
-    input->GetMutex();
-
-    u_roll=input->ValueNoMutex(0,0);
-    u_pitch=input->ValueNoMutex(1,0);
-    u_yaw=input->ValueNoMutex(2,0);
-    u_gaz=input->ValueNoMutex(3,0)+input->ValueNoMutex(7,0)*input->ValueNoMutex(7,0);//ugaz+trim*trim
-    trim_roll=input->ValueNoMutex(4,0);
-    trim_pitch=input->ValueNoMutex(5,0);
-    trim_yaw=input->ValueNoMutex(6,0);
-
-    input->ReleaseMutex();
-
-    if(pas->CurrentIndex()==1)
-    {
-        trim_yaw=-trim_yaw;
-        u_yaw=-u_yaw;
-    }
-
-    //rt_printf("%f %f %f %f\n",u_roll,u_pitch,u_yaw,u_gaz);
-    //if(u_gaz!=0) rt_printf("gaz: %f\n",u_gaz);
-
-    //avant gauche
-    if(u_gaz+u_pitch+u_roll+u_yaw>0)
-    {
-        pwm[0]=trim_pitch+trim_roll+trim_yaw+sqrtf(u_gaz+u_pitch+u_roll+u_yaw);
-    }else
-    {
-        pwm[0]=trim_pitch+trim_roll+trim_yaw;
-    }
-
-    //arriere gauche
-    if(u_gaz-u_pitch+u_roll-u_yaw>0)
-    {
-        pwm[3]=-trim_pitch+trim_roll-trim_yaw+sqrtf(u_gaz-u_pitch+u_roll-u_yaw);
-    }else
-    {
-        pwm[3]=-trim_pitch+trim_roll-trim_yaw;
-    }
-
-    //arriere droit
-    if(u_gaz-u_pitch-u_roll+u_yaw>0)
-    {
-        pwm[1]=-trim_pitch-trim_roll+trim_yaw+sqrtf(u_gaz-u_pitch-u_roll+u_yaw);
-    }else
-    {
-        pwm[1]=-trim_pitch-trim_roll+trim_yaw;
-    }
-
-    //avant droit
-    if(u_gaz+u_pitch-u_roll-u_yaw>0)
-    {
-        pwm[2]=trim_pitch-trim_roll-trim_yaw+sqrtf(u_gaz+u_pitch-u_roll-u_yaw);
-    }else
-    {
-        pwm[2]=trim_pitch-trim_roll-trim_yaw;
-    }
-
-
-    int_av_g+=ki->Value()*(pwm[0]-speed_av_g);
-    pwm[0]=kp->Value()*(pwm[0]-speed_av_g)+int_av_g;
-
-    int_ar_g+=ki->Value()*(pwm[3]-speed_ar_g);
-    pwm[3]=kp->Value()*(pwm[3]-speed_ar_g)+int_ar_g;
-
-    int_ar_d+=ki->Value()*(pwm[1]-speed_ar_d);
-    pwm[1]=kp->Value()*(pwm[1]-speed_ar_d)+int_ar_d;
-
-    int_av_d+=ki->Value()*(pwm[2]-speed_av_d);
-    pwm[2]=kp->Value()*(pwm[2]-speed_av_d)+int_av_d;
-
-//rt_printf("%f\n",pwm[0]);
-    for(int i=0;i<4;i++) pwm_moteur[i]=SatPWM(pwm[i],min->Value(),max->Value());
-
-    if(button_avg->Clicked()==true)
-    {
-        tested_motor=0;
-        StartTest();
-    }
-    if(button_avd->Clicked()==true)
-    {
-        tested_motor=2;
-        StartTest();
-    }
-    if(button_arg->Clicked()==true)
-    {
-        tested_motor=3;
-        StartTest();
-    }
-    if(button_ard->Clicked()==true)
-    {
-        tested_motor=1;
-        StartTest();
-    }
-
-    if(tested_motor!=-1)
-    {
-        for(int i=0;i<4;i++)
-        {
-            pwm_moteur[i]=0;
-        }
-        pwm_moteur[tested_motor]=(uint16_t)test->Value();
-
-        if(GetTime()>(start_time+2*1000000000)) StopTest();
-    }
-
-
-    i2cport->GetMutex();
-
-    if(enabled==true)
-    {
-        i2cport->SetSlave(slave_address+av_g->CurrentIndex());
-        WriteValue(pwm_moteur[0]);
-
-        i2cport->SetSlave(slave_address+av_d->CurrentIndex());
-        WriteValue(pwm_moteur[2]);
-
-        i2cport->SetSlave(slave_address+ar_g->CurrentIndex());
-        WriteValue(pwm_moteur[3]);
-
-        i2cport->SetSlave(slave_address+ar_d->CurrentIndex());
-        WriteValue(pwm_moteur[1]);
-
-    }
-    else
-    {
-        for(int i=0;i<4;i++)
-        {
-            i2cport->SetSlave(slave_address+i);
-            WriteValue(0);
-        }
-        int_av_g=0;
-        int_av_d=0;
-        int_ar_g=0;
-        int_ar_d=0;
-    }
-
-    i2cport->SetSlave(slave_address+av_g->CurrentIndex());
-    speed_av_g=GetSpeed();
-
-    i2cport->SetSlave(slave_address+av_d->CurrentIndex());
-    speed_av_d=GetSpeed();
-
-    i2cport->SetSlave(slave_address+ar_g->CurrentIndex());
-    speed_ar_g=GetSpeed();
-
-    i2cport->SetSlave(slave_address+ar_d->CurrentIndex());
-    speed_ar_d=GetSpeed();
-
-    i2cport->ReleaseMutex();
-
-
-    //on prend une fois pour toute le mutex et on fait des accès directs
-    output->GetMutex();
-    output->SetValueNoMutex(0,0,speed_av_g);
-    output->SetValueNoMutex(1,0,speed_ar_d);
-    output->SetValueNoMutex(2,0,speed_av_d);
-    output->SetValueNoMutex(3,0,speed_ar_g);
-   // rt_printf("%i %i %i %i\n",pwm_moteur[0],pwm_moteur[1],pwm_moteur[2],pwm_moteur[3]);
-    output->ReleaseMutex();
-
-    output->SetDataTime(GetTime());
-    ProcessUpdate(output);
-
-}
-
-void BlCtrlV2_x4_speed::StartTest(void)
-{
-    start_time=GetTime();
-    SetEnabled(true);
-}
-
-void BlCtrlV2_x4_speed::StopTest(void)
-{
-    SetEnabled(false);
-    tested_motor=-1;
-}
-
-uint16_t BlCtrlV2_x4_speed::SatPWM(float vel_cons,uint16_t min,uint16_t max)
-{
-  uint16_t sat_value=(uint16_t)vel_cons;
-
-  if(vel_cons>((float)sat_value+0.5)) sat_value++;
-
-  if(vel_cons<(float)min) sat_value=min;
-  if(vel_cons>(float)max) sat_value=max;
-
-  return sat_value;
-}
-
-void BlCtrlV2_x4_speed::LockUserInterface(void)
-{
-    reglages_groupbox->setEnabled(false);
-}
-
-void BlCtrlV2_x4_speed::UnlockUserInterface(void)
-{
-    reglages_groupbox->setEnabled(true);
-}
-
-void BlCtrlV2_x4_speed::SetEnabled(bool status)
-{
-    enabled=status;
-    if(enabled==true)
-    {
-        LockUserInterface();
-
-        flight_start_time = GetTime();
-    }
-    else
-    {
-        UnlockUserInterface();
-
-        Time now= GetTime();
-        int t_sec;
-        FILE *file;
-        char ligne[32];
-
-        t_sec=(now - flight_start_time)/1000000000;
-        time_sec+=t_sec;
-
-        Printf("temps de vol: %is = %imin\n",t_sec,t_sec/60);
-        Printf("temps de vol total: %is = %imin = %ih\n",time_sec,time_sec/60,time_sec/3600);
-
-        file=fopen("/etc/flight_time","w");
-        if (file == NULL)
-        {
-            Thread::Err("Erreur a l'ouverture du fichier d'info vol\n");
-        }
-        else
-        {
-            sprintf(ligne,"%i",time_sec);
-            fputs(ligne,file);
-            fclose(file);
-        }
-    }
-}
-
-void BlCtrlV2_x4_speed::SetUroll(float value)
-{
-    input->SetValue(0,0,value);
-}
-
-void BlCtrlV2_x4_speed::SetUpitch(float value)
-{
-    input->SetValue(1,0,value);
-}
-
-void BlCtrlV2_x4_speed::SetUyaw(float value)
-{
-    input->SetValue(2,0,value);
-}
-
-void BlCtrlV2_x4_speed::SetUgaz(float value)
-{
-    input->SetValue(3,0,value);
-}
-
-void BlCtrlV2_x4_speed::SetRollTrim(float value)
-{
-    input->SetValue(4,0,value);
-}
-
-void BlCtrlV2_x4_speed::SetPitchTrim(float value)
-{
-    input->SetValue(5,0,value);
-}
-
-void BlCtrlV2_x4_speed::SetYawTrim(float value)
-{
-    input->SetValue(6,0,value);
-}
-
-void BlCtrlV2_x4_speed::SetGazTrim(float value)
-{
-    input->SetValue(7,0,value);
-}
-
-void BlCtrlV2_x4_speed::WriteValue(uint16_t value)
-{
-    unsigned char tx[2];
-    ssize_t written;
-
-    tx[0]=(unsigned char)(value>>3);//msb
-    tx[1]=16+8+(value&0x07);//16+8 pour recuperer la vitesse
-    written = i2cport->Write(tx, 2);
-    if(written<0)
-    {
-        Thread::Err("erreur rt_dev_write (%s)\n",strerror(-written));
-    }
-    else if (written != 2)
-    {
-        Thread::Err("erreur rt_dev_write %i/2\n",written);
-    }
-}
-
-float BlCtrlV2_x4_speed::GetSpeed(void)
-{
-    ssize_t read;
-    uint8_t value;
-    read = i2cport->Read(&value, 1);
-
-    if(read<0)
-    {
-        Thread::Err("erreur rt_dev_read (%s)\n",strerror(-read));
-    }
-    else if (read != 1)
-    {
-        Thread::Err("erreur rt_dev_read %i/2\n",read);
-
-    }
-
-    return value*780./poles->Value();
+  }
+}
+
+void BlCtrlV2_x4_speed::SetUroll(float value) { input->SetValue(0, 0, value); }
+
+void BlCtrlV2_x4_speed::SetUpitch(float value) { input->SetValue(1, 0, value); }
+
+void BlCtrlV2_x4_speed::SetUyaw(float value) { input->SetValue(2, 0, value); }
+
+void BlCtrlV2_x4_speed::SetUgaz(float value) { input->SetValue(3, 0, value); }
+
+void BlCtrlV2_x4_speed::SetRollTrim(float value) {
+  input->SetValue(4, 0, value);
+}
+
+void BlCtrlV2_x4_speed::SetPitchTrim(float value) {
+  input->SetValue(5, 0, value);
+}
+
+void BlCtrlV2_x4_speed::SetYawTrim(float value) {
+  input->SetValue(6, 0, value);
+}
+
+void BlCtrlV2_x4_speed::SetGazTrim(float value) {
+  input->SetValue(7, 0, value);
+}
+
+void BlCtrlV2_x4_speed::WriteValue(uint16_t value) {
+  unsigned char tx[2];
+  ssize_t written;
+
+  tx[0] = (unsigned char)(value >> 3); // msb
+  tx[1] = 16 + 8 + (value & 0x07);     // 16+8 pour recuperer la vitesse
+  written = i2cport->Write(tx, 2);
+  if (written < 0) {
+    Thread::Err("erreur rt_dev_write (%s)\n", strerror(-written));
+  } else if (written != 2) {
+    Thread::Err("erreur rt_dev_write %i/2\n", written);
+  }
+}
+
+float BlCtrlV2_x4_speed::GetSpeed(void) {
+  ssize_t read;
+  uint8_t value;
+  read = i2cport->Read(&value, 1);
+
+  if (read < 0) {
+    Thread::Err("erreur rt_dev_read (%s)\n", strerror(-read));
+  } else if (read != 1) {
+    Thread::Err("erreur rt_dev_read %i/2\n", read);
+  }
+
+  return value * 780. / poles->Value();
 }
 
Index: trunk/lib/FlairSensorActuator/src/BlCtrlV2_x4_speed.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/BlCtrlV2_x4_speed.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/BlCtrlV2_x4_speed.h	(revision 15)
@@ -16,5 +16,4 @@
 /*********************************************************************/
 
-
 #ifndef BLCTRLV2_X4_SPEED_H
 #define BLCTRLV2_X4_SPEED_H
@@ -23,96 +22,91 @@
 #include <Thread.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class cvmatrix;
-        class FrameworkManager;
-        class I2cPort;
-
-    }
-    namespace gui
-    {
-        class TabWidget;
-        class Tab;
-        class SpinBox;
-        class DoubleSpinBox;
-        class ComboBox;
-        class PushButton;
-        class GroupBox;
-    }
+namespace flair {
+namespace core {
+class cvmatrix;
+class FrameworkManager;
+class I2cPort;
+}
+namespace gui {
+class TabWidget;
+class Tab;
+class SpinBox;
+class DoubleSpinBox;
+class ComboBox;
+class PushButton;
+class GroupBox;
+}
 }
 
-namespace flair
-{
-namespace actuator
-{
-    class BlCtrlV2_x4_speed : public core::Thread,public core::IODevice
-    {
+namespace flair {
+namespace actuator {
+class BlCtrlV2_x4_speed : public core::Thread, public core::IODevice {
 
-        public:
-            BlCtrlV2_x4_speed(core::FrameworkManager* parent,std::string name,core::I2cPort* i2cport,uint8_t base_address,uint8_t priority);
-            ~BlCtrlV2_x4_speed();
-            void UseDefaultPlot(void);
-            void LockUserInterface(void);
-            void UnlockUserInterface(void);
-            void SetEnabled(bool status);
-            void SetUroll(float value);
-            void SetUpitch(float value);
-            void SetUyaw(float value);
-            void SetUgaz(float value);
-            void SetRollTrim(float value);
-            void SetPitchTrim(float value);
-            void SetYawTrim(float value);
-            void SetGazTrim(float value);
-            float TrimValue(void);
-            int StartValue(void);
+public:
+  BlCtrlV2_x4_speed(core::FrameworkManager *parent, std::string name,
+                    core::I2cPort *i2cport, uint8_t base_address,
+                    uint8_t priority);
+  ~BlCtrlV2_x4_speed();
+  void UseDefaultPlot(void);
+  void LockUserInterface(void);
+  void UnlockUserInterface(void);
+  void SetEnabled(bool status);
+  void SetUroll(float value);
+  void SetUpitch(float value);
+  void SetUyaw(float value);
+  void SetUgaz(float value);
+  void SetRollTrim(float value);
+  void SetPitchTrim(float value);
+  void SetYawTrim(float value);
+  void SetGazTrim(float value);
+  float TrimValue(void);
+  int StartValue(void);
 
-        private:
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(core::io_data *data){};
-            void WriteValue(uint16_t value);
-            float GetSpeed(void);
-            void StartTest(void);
-            void StopTest(void);
-            /*!
-            * \brief Run function
-            *
-            * Reimplemented from Thread.
-            *
-            */
-            void Run(void);
-            void Update(void);
-            gui::Tab* main_tab;
-            gui::TabWidget* tab;
-            gui::GroupBox* reglages_groupbox;
-            gui::SpinBox *min,*max,*test;
-            gui::PushButton *button_avg,*button_avd,*button_arg,*button_ard;
-            gui::ComboBox *av_g,*av_d,*ar_g,*ar_d,*pas;
-            gui::DoubleSpinBox *trim,*kp,*ki;
-            gui::SpinBox *start_value,*poles;
-            core::Time start_time,flight_start_time;
-            int time_sec;
-            float speed_av_g,speed_av_d,speed_ar_g,speed_ar_d;
-            float int_av_g,int_av_d,int_ar_g,int_ar_d;
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(core::io_data *data){};
+  void WriteValue(uint16_t value);
+  float GetSpeed(void);
+  void StartTest(void);
+  void StopTest(void);
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+  void Update(void);
+  gui::Tab *main_tab;
+  gui::TabWidget *tab;
+  gui::GroupBox *reglages_groupbox;
+  gui::SpinBox *min, *max, *test;
+  gui::PushButton *button_avg, *button_avd, *button_arg, *button_ard;
+  gui::ComboBox *av_g, *av_d, *ar_g, *ar_d, *pas;
+  gui::DoubleSpinBox *trim, *kp, *ki;
+  gui::SpinBox *start_value, *poles;
+  core::Time start_time, flight_start_time;
+  int time_sec;
+  float speed_av_g, speed_av_d, speed_ar_g, speed_ar_d;
+  float int_av_g, int_av_d, int_ar_g, int_ar_d;
 
-            //matrix
-            core::cvmatrix *input;
-            core::cvmatrix *output;
+  // matrix
+  core::cvmatrix *input;
+  core::cvmatrix *output;
 
-            int tested_motor;
-            core::I2cPort* i2cport;
-            uint8_t slave_address;
+  int tested_motor;
+  core::I2cPort *i2cport;
+  uint8_t slave_address;
 
-            bool enabled;
+  bool enabled;
 
-            uint16_t SatPWM(float vel_cons,uint16_t min,uint16_t max);
-    };
+  uint16_t SatPWM(float vel_cons, uint16_t min, uint16_t max);
+};
 } // end namespace actuator
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/Bldc.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Bldc.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Bldc.cpp	(revision 15)
@@ -27,79 +27,67 @@
 using namespace flair::gui;
 
-namespace flair { namespace actuator {
+namespace flair {
+namespace actuator {
 
-Bldc::Bldc(const IODevice* parent,Layout* layout,string name,uint8_t motors_count) : IODevice(parent,name) {
-    pimpl_=new Bldc_impl(this,layout,name,motors_count);
+Bldc::Bldc(const IODevice *parent, Layout *layout, string name,
+           uint8_t motors_count)
+    : IODevice(parent, name) {
+  pimpl_ = new Bldc_impl(this, layout, name, motors_count);
 
-    cvmatrix_descriptor* desc=new cvmatrix_descriptor(motors_count,2);
-    for(int i=0;i<motors_count;i++) {
-        ostringstream speed,current;
-        speed << "speed_" << i;
-        desc->SetElementName(i,0,speed.str());
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(motors_count, 2);
+  for (int i = 0; i < motors_count; i++) {
+    ostringstream speed, current;
+    speed << "speed_" << i;
+    desc->SetElementName(i, 0, speed.str());
 
-        current << "current_" << i;
-        desc->SetElementName(i,1,current.str());
-    }
+    current << "current_" << i;
+    desc->SetElementName(i, 1, current.str());
+  }
 
-    output=new cvmatrix(this,desc,floatType);
-    AddDataToLog(output);
+  output = new cvmatrix(this, desc, floatType);
+  AddDataToLog(output);
 }
 
-Bldc::Bldc(const Object* parent,string name,uint8_t motors_count) : IODevice(parent,name) {
-    pimpl_=new Bldc_impl(this,motors_count);
+Bldc::Bldc(const Object *parent, string name, uint8_t motors_count)
+    : IODevice(parent, name) {
+  pimpl_ = new Bldc_impl(this, motors_count);
 }
 
-Bldc::~Bldc() {
-    delete pimpl_;
+Bldc::~Bldc() { delete pimpl_; }
+
+void Bldc::UpdateFrom(const io_data *data) { pimpl_->UpdateFrom(data); }
+
+void Bldc::LockUserInterface(void) const { pimpl_->LockUserInterface(); }
+
+void Bldc::UnlockUserInterface(void) const { pimpl_->UnlockUserInterface(); }
+
+Layout *Bldc::GetLayout(void) const { return (Layout *)pimpl_->layout; }
+
+void Bldc::UseDefaultPlot(TabWidget *tabwidget) {
+  pimpl_->UseDefaultPlot(tabwidget);
 }
 
-void Bldc::UpdateFrom(const io_data *data) {
-    pimpl_->UpdateFrom(data);
+uint8_t Bldc::MotorsCount(void) const { return pimpl_->motors_count; }
+
+cvmatrix *Bldc::Output(void) const { return output; }
+
+bool Bldc::AreEnabled(void) const { return pimpl_->are_enabled; }
+
+void Bldc::SetEnabled(bool status) {
+  if (pimpl_->are_enabled != status) {
+    pimpl_->are_enabled = status;
+    if (pimpl_->are_enabled) {
+      LockUserInterface();
+    } else {
+      UnlockUserInterface();
+    }
+  }
 }
 
-void Bldc::LockUserInterface(void) const {
-    pimpl_->LockUserInterface();
-}
-
-void Bldc::UnlockUserInterface(void) const {
-    pimpl_->UnlockUserInterface();
-}
-
-Layout* Bldc::GetLayout(void) const {
-    return (Layout*)pimpl_->layout;
-}
-
-void Bldc::UseDefaultPlot(TabWidget* tabwidget) {
-    pimpl_->UseDefaultPlot(tabwidget);
-}
-
-uint8_t Bldc::MotorsCount(void) const {
-    return pimpl_->motors_count;
-}
-
-cvmatrix *Bldc::Output(void) const {
-    return output;
-}
-
-bool Bldc::AreEnabled(void) const {
-    return pimpl_->are_enabled;
-}
-
-void Bldc::SetEnabled(bool status) {
-    if(pimpl_->are_enabled!=status) {
-        pimpl_->are_enabled=status;
-        if(pimpl_->are_enabled) {
-            LockUserInterface();
-        } else {
-            UnlockUserInterface();
-        }
-    }
-}
-
-void Bldc::SetPower(int motor_id,float value) {
-    //use output mutex to avoid making a new mutex
-    output->GetMutex();
-    pimpl_->power[motor_id]=value;
-    output->ReleaseMutex();
+void Bldc::SetPower(int motor_id, float value) {
+  // use output mutex to avoid making a new mutex
+  output->GetMutex();
+  pimpl_->power[motor_id] = value;
+  output->ReleaseMutex();
 }
 
Index: trunk/lib/FlairSensorActuator/src/Bldc.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/Bldc.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Bldc.h	(revision 15)
@@ -17,174 +17,172 @@
 #include <stdint.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class FrameworkManager;
-        class cvmatrix;
-    }
-    namespace gui
-    {
-        class Layout;
-        class TabWidget;
-    }
+namespace flair {
+namespace core {
+class FrameworkManager;
+class cvmatrix;
+}
+namespace gui {
+class Layout;
+class TabWidget;
+}
 }
 
 class Bldc_impl;
 
-namespace flair
-{
-namespace actuator
-{
-    /*! \class Bldc
-    *
-    * \brief Base class for brushless motors drivers
-    */
-    class Bldc : public core::IODevice
-    {
-        friend class ::Bldc_impl;
+namespace flair {
+namespace actuator {
+/*! \class Bldc
+*
+* \brief Base class for brushless motors drivers
+*/
+class Bldc : public core::IODevice {
+  friend class ::Bldc_impl;
 
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a Bldc.
-            *
-            * \param parent parent
-            * \param layout layout
-            * \param name name
-            * \param motors_count number of motors
-            */
-            Bldc(const core::IODevice* parent,gui::Layout* layout,std::string name,uint8_t motors_count);
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Bldc.
+  *
+  * \param parent parent
+  * \param layout layout
+  * \param name name
+  * \param motors_count number of motors
+  */
+  Bldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
+       uint8_t motors_count);
 
-            /*!
-            * \brief Constructor
-            *
-            * Construct a Bldc. \n
-            * This contructor must only be called for a simulated device.
-            *
-            * \param parent parent
-            * \param name name
-            * \param motors_count number of motors
-            */
-            Bldc(const core::Object* parent,std::string name,uint8_t motors_count);
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Bldc. \n
+  * This contructor must only be called for a simulated device.
+  *
+  * \param parent parent
+  * \param name name
+  * \param motors_count number of motors
+  */
+  Bldc(const core::Object *parent, std::string name, uint8_t motors_count);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~Bldc();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Bldc();
 
-            /*!
-            * \brief Lock user interface
-            *
-            */
-            void LockUserInterface(void) const;
+  /*!
+  * \brief Lock user interface
+  *
+  */
+  void LockUserInterface(void) const;
 
-            /*!
-            * \brief Unlock user interface
-            *
-            */
-            void UnlockUserInterface(void) const;
+  /*!
+  * \brief Unlock user interface
+  *
+  */
+  void UnlockUserInterface(void) const;
 
-            /*!
-            * \brief Use default plot
-            *
-            * \param tabwidget TabWidget to draw plots
-            */
-            void UseDefaultPlot(gui::TabWidget* tabwidget);
+  /*!
+  * \brief Use default plot
+  *
+  * \param tabwidget TabWidget to draw plots
+  */
+  void UseDefaultPlot(gui::TabWidget *tabwidget);
 
-            /*!
-            * \brief Output from motors
-            *
-            * First column is real speed if available, secund column is current if available
-            *
-            */
-            core::cvmatrix *Output(void) const;
+  /*!
+  * \brief Output from motors
+  *
+  * First column is real speed if available, secund column is current if
+  *available
+  *
+  */
+  core::cvmatrix *Output(void) const;
 
-            /*!
-            * \brief Motors count
-            *
-            * \return number of motors
-            */
-            uint8_t MotorsCount(void) const;
+  /*!
+  * \brief Motors count
+  *
+  * \return number of motors
+  */
+  uint8_t MotorsCount(void) const;
 
-            /*!
-            * \brief Enable motors
-            *
-            * \param true to enable all motors
-            */
-            void SetEnabled(bool status);
+  /*!
+  * \brief Enable motors
+  *
+  * \param true to enable all motors
+  */
+  void SetEnabled(bool status);
 
-            /*!
-            * \brief Are motors enabled?
-            *
-            * \return true if motors are enabled
-            */
-            bool AreEnabled(void) const;
+  /*!
+  * \brief Are motors enabled?
+  *
+  * \return true if motors are enabled
+  */
+  bool AreEnabled(void) const;
 
-            /*!
-            * \brief Set motor power
-            *
-            * Changes the power (from 0 to 1) of a specific motor. \n
-            * By default power is set to 1 for each motor which has no effect. \n
-            * A value <1 will decrease the power of a motor sent to the reimplemented Bldc class through SetMotors. \n
-            * The power value is applied after applying saturation between min value and max value.
-            * So the resulting value cannot be higher than max value
-            * but it can be lower than min value.
-            *
-            * \param motor_id id of the motor
-            * \param value power value (from 0 to 1)
-            *
-            */
-            void SetPower(int motor_id,float value);
+  /*!
+  * \brief Set motor power
+  *
+  * Changes the power (from 0 to 1) of a specific motor. \n
+  * By default power is set to 1 for each motor which has no effect. \n
+  * A value <1 will decrease the power of a motor sent to the reimplemented Bldc
+  *class through SetMotors. \n
+  * The power value is applied after applying saturation between min value and
+  *max value.
+  * So the resulting value cannot be higher than max value
+  * but it can be lower than min value.
+  *
+  * \param motor_id id of the motor
+  * \param value power value (from 0 to 1)
+  *
+  */
+  void SetPower(int motor_id, float value);
 
-            /*!
-            * \brief Layout
-            *
-            * This the same Layout as passed to the constructor
-            *
-            * \return a Layout
-            */
-            gui::Layout* GetLayout(void) const;
+  /*!
+  * \brief Layout
+  *
+  * This the same Layout as passed to the constructor
+  *
+  * \return a Layout
+  */
+  gui::Layout *GetLayout(void) const;
 
-            /*!
-            * \brief Has speed measurement
-            *
-            * \return true if it has speed measurement
-            */
-            virtual bool HasSpeedMeasurement(void) const=0;
+  /*!
+  * \brief Has speed measurement
+  *
+  * \return true if it has speed measurement
+  */
+  virtual bool HasSpeedMeasurement(void) const = 0;
 
-            /*!
-            * \brief Has current measurement
-            *
-            * \return true if it has current measurement
-            */
-            virtual bool HasCurrentMeasurement(void) const=0;
+  /*!
+  * \brief Has current measurement
+  *
+  * \return true if it has current measurement
+  */
+  virtual bool HasCurrentMeasurement(void) const = 0;
 
-        protected:
-            core::cvmatrix *output;
+protected:
+  core::cvmatrix *output;
 
-        private:
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data);
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data);
 
-            /*!
-            * \brief Set motors values
-            *
-            * values size must be the same as MotorsCount()
-            *
-            * \param values set motors values
-            */
-            virtual void SetMotors(float* values)=0;
+  /*!
+  * \brief Set motors values
+  *
+  * values size must be the same as MotorsCount()
+  *
+  * \param values set motors values
+  */
+  virtual void SetMotors(float *values) = 0;
 
-            class Bldc_impl* pimpl_;
-    };
+  class Bldc_impl *pimpl_;
+};
 } // end namespace actuator
 } // end namespace framewor
Index: trunk/lib/FlairSensorActuator/src/Bldc_impl.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Bldc_impl.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Bldc_impl.cpp	(revision 15)
@@ -35,168 +35,177 @@
 using namespace flair::actuator;
 
-Bldc_impl::Bldc_impl(Bldc* self,Layout* layout,string name,uint8_t motors_count) {
-    this->self=self;
-    this->motors_count=motors_count;
-    this->layout=layout;
-	are_enabled=false;
-	is_running=false;
-	tested_motor=-1;
-
-    values=(float*)malloc(motors_count*sizeof(float));
-    power=(float*)malloc(motors_count*sizeof(float));
-    for(int i=0;i<motors_count;i++) power[i]=1;
-
-    //station sol
-	GroupBox* groupbox=new GroupBox(layout->NewRow(),"bldc");
-        flight_time=new Label(groupbox->NewRow(),"flight time");
-        min_value=new DoubleSpinBox(groupbox->NewRow(),"min value:",0,1,.1,2);
-        max_value=new DoubleSpinBox(groupbox->LastRowLastCol(),"max value:",0,1,.1,2);
-        test_value=new DoubleSpinBox(groupbox->LastRowLastCol(),"test value:",0,1,0.1);
-
-    int index=0;
-    button_test=(PushButton**)malloc(motors_count*sizeof(PushButton*));
-    for(int i=0;i<motors_count/2;i++) {
-        for(int j=0;j<2;j++) {
-            ostringstream test_name;
-            test_name << "test motor " << index;
-            button_test[index]=new PushButton(groupbox->At(2+i,j),test_name.str());
-            index++;
-        }
-    }
-
-	//flight time
-	FILE *file;
-    file=fopen("/etc/flight_time","r");
+Bldc_impl::Bldc_impl(Bldc *self, Layout *layout, string name,
+                     uint8_t motors_count) {
+  this->self = self;
+  this->motors_count = motors_count;
+  this->layout = layout;
+  are_enabled = false;
+  is_running = false;
+  tested_motor = -1;
+
+  values = (float *)malloc(motors_count * sizeof(float));
+  power = (float *)malloc(motors_count * sizeof(float));
+  for (int i = 0; i < motors_count; i++)
+    power[i] = 1;
+
+  // station sol
+  GroupBox *groupbox = new GroupBox(layout->NewRow(), "bldc");
+  flight_time = new Label(groupbox->NewRow(), "flight time");
+  min_value = new DoubleSpinBox(groupbox->NewRow(), "min value:", 0, 1, .1, 2);
+  max_value =
+      new DoubleSpinBox(groupbox->LastRowLastCol(), "max value:", 0, 1, .1, 2);
+  test_value =
+      new DoubleSpinBox(groupbox->LastRowLastCol(), "test value:", 0, 1, 0.1);
+
+  int index = 0;
+  button_test = (PushButton **)malloc(motors_count * sizeof(PushButton *));
+  for (int i = 0; i < motors_count / 2; i++) {
+    for (int j = 0; j < 2; j++) {
+      ostringstream test_name;
+      test_name << "test motor " << index;
+      button_test[index] =
+          new PushButton(groupbox->At(2 + i, j), test_name.str());
+      index++;
+    }
+  }
+
+  // flight time
+  FILE *file;
+  file = fopen("/etc/flight_time", "r");
+  if (file == NULL) {
+    time_sec = 0;
+  } else {
+    char ligne[32];
+    fgets(ligne, 32, file);
+    time_sec = atoi(ligne);
+    fclose(file);
+  }
+  flight_time->SetText("total flight time: %is = %imin = %ih\n", time_sec,
+                       time_sec / 60, time_sec / 3600);
+}
+
+Bldc_impl::Bldc_impl(Bldc *self, uint8_t motors_count) {
+  this->self = self;
+  this->motors_count = motors_count;
+  values = NULL;
+  button_test = NULL;
+  power = NULL;
+}
+
+Bldc_impl::~Bldc_impl() {
+  if (values != NULL)
+    free(values);
+  if (button_test != NULL)
+    free(button_test);
+  if (power != NULL)
+    free(power);
+}
+
+void Bldc_impl::UseDefaultPlot(TabWidget *tab) {
+  Tab *plot_tab = new Tab(tab, "speeds");
+  plots = new DataPlot1D(plot_tab->NewRow(), "values", 0, 1);
+  for (int i = 0; i < motors_count; i++) {
+    plots->AddCurve(self->output->Element(i));
+  }
+}
+
+void Bldc_impl::UpdateFrom(const io_data *data) {
+  cvmatrix *input = (cvmatrix *)data;
+  bool is_motor_running = false;
+
+  if (values == NULL)
+    return; // nothing to do in simulator
+
+  if (input->Rows() != motors_count) {
+    self->Err("nb motors mismatch\n");
+    return;
+  }
+
+  input->GetMutex();
+  for (int i = 0; i < motors_count; i++) {
+    if (input->ValueNoMutex(i, 0) != 0)
+      is_motor_running = true;
+    if (are_enabled) {
+      // Printf("%i %f %f\n",i,input->ValueNoMutex(i,0),power[i]);
+      values[i] = power[i] * Sat(input->ValueNoMutex(i, 0));
+      // Printf("%i %f\n",i,values[i]);
+    } else {
+      values[i] = 0;
+    }
+  }
+  input->ReleaseMutex();
+
+  if (are_enabled && is_motor_running && !is_running) {
+    flight_start_time = GetTime();
+    is_running = true;
+  }
+  if ((!are_enabled || !is_motor_running) && is_running) {
+    Time now = GetTime();
+    int t_sec;
+    FILE *file;
+    char ligne[32];
+
+    t_sec = (now - flight_start_time) / 1000000000;
+    time_sec += t_sec;
+
+    Printf("temps de vol: %is = %imin\n", t_sec, t_sec / 60);
+    // Printf("temps de vol total: %is = %imin =
+    // %ih\n",time_sec,time_sec/60,time_sec/3600);
+    flight_time->SetText("total flight time: %is = %imin = %ih\n", time_sec,
+                         time_sec / 60, time_sec / 3600);
+
+    file = fopen("/etc/flight_time", "w");
     if (file == NULL) {
-        time_sec=0;
+      Printf("Erreur a l'ouverture du fichier d'info vol\n");
     } else {
-        char ligne[32];
-        fgets(ligne, 32, file);
-        time_sec=atoi(ligne);
-        fclose(file);
-    }
-    flight_time->SetText("total flight time: %is = %imin = %ih\n",time_sec,time_sec/60,time_sec/3600);
-}
-
-Bldc_impl::Bldc_impl(Bldc* self,uint8_t motors_count) {
-    this->self=self;
-    this->motors_count=motors_count;
-    values=NULL;
-    button_test=NULL;
-    power=NULL;
-}
-
-Bldc_impl::~Bldc_impl() {
-    if(values!=NULL) free(values);
-    if(button_test!=NULL) free(button_test);
-    if(power!=NULL) free(power);
-}
-
-void Bldc_impl::UseDefaultPlot(TabWidget* tab) {
-    Tab* plot_tab=new Tab(tab,"speeds");
-    plots=new DataPlot1D(plot_tab->NewRow(),"values",0,1);
-    for(int i=0;i<motors_count;i++) {
-        plots->AddCurve(self->output->Element(i));
-    }
-}
-
-void Bldc_impl::UpdateFrom(const io_data *data) {
-    cvmatrix* input=(cvmatrix*)data;
-    bool is_motor_running=false;
-
-    if(values==NULL) return;//nothing to do in simulator
-
-    if(input->Rows()!=motors_count) {
-        self->Err("nb motors mismatch\n");
-        return;
-    }
-
-    input->GetMutex();
-    for(int i=0;i<motors_count;i++) {
-        if(input->ValueNoMutex(i,0)!=0) is_motor_running=true;
-        if(are_enabled) {
-            //Printf("%i %f %f\n",i,input->ValueNoMutex(i,0),power[i]);
-            values[i]=power[i]*Sat(input->ValueNoMutex(i,0));
-            //Printf("%i %f\n",i,values[i]);
-        } else {
-            values[i]=0;
-        }
-    }
-    input->ReleaseMutex();
-
-    if(are_enabled && is_motor_running && !is_running) {
-        flight_start_time = GetTime();
-        is_running=true;
-    }
-    if((!are_enabled || !is_motor_running) && is_running) {
-        Time now= GetTime();
-        int t_sec;
-        FILE *file;
-        char ligne[32];
-
-        t_sec=(now - flight_start_time)/1000000000;
-        time_sec+=t_sec;
-
-        Printf("temps de vol: %is = %imin\n",t_sec,t_sec/60);
-        //Printf("temps de vol total: %is = %imin = %ih\n",time_sec,time_sec/60,time_sec/3600);
-        flight_time->SetText("total flight time: %is = %imin = %ih\n",time_sec,time_sec/60,time_sec/3600);
-
-        file=fopen("/etc/flight_time","w");
-        if (file == NULL) {
-            Printf("Erreur a l'ouverture du fichier d'info vol\n");
-        } else {
-            sprintf(ligne,"%i",time_sec);
-            fputs(ligne,file);
-            fclose(file);
-        }
-        is_running=false;
-    }
-
-    for(int i=0;i<motors_count;i++) {
-        if(button_test[i]->Clicked()==true) {
-            if(!are_enabled) {
-                tested_motor=i;
-                test_start_time=GetTime();
-                LockUserInterface();
-            } else {
-                self->Warn("testing motor is not possible when enabled\n");
-            }
-        }
-    }
-    if(tested_motor!=-1) {
-        for(int i=0;i<motors_count;i++) {
-            values[i]=0;
-        }
-        values[tested_motor]=test_value->Value();
-
-        if(GetTime()>(test_start_time+2*1000000000)) {
-            tested_motor=-1;
-            UnlockUserInterface();
-        }
-    }
-
-    self->SetMotors(values);
-    self->output->SetDataTime(data->DataTime());
-    self->ProcessUpdate(self->output);
+      sprintf(ligne, "%i", time_sec);
+      fputs(ligne, file);
+      fclose(file);
+    }
+    is_running = false;
+  }
+
+  for (int i = 0; i < motors_count; i++) {
+    if (button_test[i]->Clicked() == true) {
+      if (!are_enabled) {
+        tested_motor = i;
+        test_start_time = GetTime();
+        LockUserInterface();
+      } else {
+        self->Warn("testing motor is not possible when enabled\n");
+      }
+    }
+  }
+  if (tested_motor != -1) {
+    for (int i = 0; i < motors_count; i++) {
+      values[i] = 0;
+    }
+    values[tested_motor] = test_value->Value();
+
+    if (GetTime() > (test_start_time + 2 * 1000000000)) {
+      tested_motor = -1;
+      UnlockUserInterface();
+    }
+  }
+
+  self->SetMotors(values);
+  self->output->SetDataTime(data->DataTime());
+  self->ProcessUpdate(self->output);
 }
 
 float Bldc_impl::Sat(float value) {
-    float result=value;
-
-    if(result<min_value->Value()) {
-        result=min_value->Value();
-    }
-    if(result>max_value->Value()) {
-        result=max_value->Value();
-    }
-
-    return result;
-}
-
-void Bldc_impl::LockUserInterface(void) const {
-    layout->setEnabled(false);
-}
-
-void Bldc_impl::UnlockUserInterface(void) const {
-    layout->setEnabled(true);
-}
+  float result = value;
+
+  if (result < min_value->Value()) {
+    result = min_value->Value();
+  }
+  if (result > max_value->Value()) {
+    result = max_value->Value();
+  }
+
+  return result;
+}
+
+void Bldc_impl::LockUserInterface(void) const { layout->setEnabled(false); }
+
+void Bldc_impl::UnlockUserInterface(void) const { layout->setEnabled(true); }
Index: trunk/lib/FlairSensorActuator/src/Camera.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Camera.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Camera.cpp	(revision 15)
@@ -31,81 +31,76 @@
 using namespace flair::gui;
 
-namespace flair { namespace sensor {
+namespace flair {
+namespace sensor {
 
-Camera::Camera(const FrameworkManager* parent,string name,uint16_t width,uint16_t height,cvimage::Type::Format format) : IODevice(parent,name) {
-    plot_tab=NULL;
+Camera::Camera(const FrameworkManager *parent, string name, uint16_t width,
+               uint16_t height, cvimage::Type::Format format)
+    : IODevice(parent, name) {
+  plot_tab = NULL;
 
-    //do not allocate imagedata, allocation is done by the camera
-    output=new cvimage((IODevice*)this,width,height,format,"out",false);
+  // do not allocate imagedata, allocation is done by the camera
+  output = new cvimage((IODevice *)this, width, height, format, "out", false);
 
-    //station sol
-    main_tab=new Tab(parent->GetTabWidget(),name);
-    tab=new TabWidget(main_tab->NewRow(),name);
-	sensor_tab=new Tab(tab,"Setup");
-	setup_groupbox=new GroupBox(sensor_tab->NewRow(),name);
-	setup_layout=new GridLayout(sensor_tab->NewRow(),"setup");
+  // station sol
+  main_tab = new Tab(parent->GetTabWidget(), name);
+  tab = new TabWidget(main_tab->NewRow(), name);
+  sensor_tab = new Tab(tab, "Setup");
+  setup_groupbox = new GroupBox(sensor_tab->NewRow(), name);
+  setup_layout = new GridLayout(sensor_tab->NewRow(), "setup");
 }
 
-Camera::Camera(const IODevice* parent,std::string name) : IODevice(parent,name) {
-    plot_tab=NULL;
-    main_tab=NULL;
-    tab=NULL;
-	sensor_tab=NULL;
-	setup_groupbox=NULL;
+Camera::Camera(const IODevice *parent, std::string name)
+    : IODevice(parent, name) {
+  plot_tab = NULL;
+  main_tab = NULL;
+  tab = NULL;
+  sensor_tab = NULL;
+  setup_groupbox = NULL;
 
-    output=NULL;
+  output = NULL;
 }
 
 Camera::~Camera() {
-    if(main_tab!=NULL) delete main_tab;
+  if (main_tab != NULL)
+    delete main_tab;
 }
 
 DataType const &Camera::GetOutputDataType() const {
-    return output->GetDataType();
+  return output->GetDataType();
 }
 
-GroupBox* Camera::GetGroupBox(void) const {
-    return setup_groupbox;
+GroupBox *Camera::GetGroupBox(void) const { return setup_groupbox; }
+
+GridLayout *Camera::GetLayout(void) const { return setup_layout; }
+
+void Camera::UseDefaultPlot(const core::cvimage *image) {
+  if (tab == NULL) {
+    Err("not applicable for simulation part.\n");
+    return;
+  }
+
+  plot_tab = new Tab(tab, "Picture");
+  Picture *plot = new Picture(plot_tab->NewRow(), ObjectName(), image);
 }
 
-GridLayout* Camera::GetLayout(void) const {
-    return setup_layout;
+Tab *Camera::GetPlotTab(void) const { return plot_tab; }
+
+uint16_t Camera::Width(void) const { return output->GetDataType().GetWidth(); }
+
+uint16_t Camera::Height(void) const {
+  return output->GetDataType().GetHeight();
 }
 
-void Camera::UseDefaultPlot(const core::cvimage *image) {
-    if(tab==NULL) {
-        Err("not applicable for simulation part.\n");
-        return;
-    }
-
-    plot_tab=new Tab(tab,"Picture");
-        Picture* plot=new Picture(plot_tab->NewRow(),ObjectName(),image);
-}
-
-Tab* Camera::GetPlotTab(void) const {
-    return plot_tab;
-}
-
-uint16_t Camera::Width(void) const {
-    return output->GetDataType().GetWidth();
-}
-
-uint16_t Camera::Height(void) const {
-    return output->GetDataType().GetHeight();
-}
-
-core::cvimage* Camera::Output(void) {
-    return output;
-}
+core::cvimage *Camera::Output(void) { return output; }
 
 void Camera::SaveToFile(string filename) const {
-    Printf("saving %s, size %i\n",filename.c_str(),output->img->imageSize);
-    std::ofstream pFile;
-	pFile.open (filename);
-	output->GetMutex();
-	pFile.write(output->img->imageData, output->img->imageSize);
-    output->ReleaseMutex();
+  Printf("saving %s, size %i\n", filename.c_str(), output->img->imageSize);
+  std::ofstream pFile;
+  pFile.open(filename);
+  output->GetMutex();
+  pFile.write(output->img->imageData, output->img->imageSize);
+  output->ReleaseMutex();
 
-	pFile.close();
+  pFile.close();
 }
 
Index: trunk/lib/FlairSensorActuator/src/Camera.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/Camera.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Camera.h	(revision 15)
@@ -18,129 +18,125 @@
 #include <cvimage.h>
 
-namespace flair
-{
-    namespace gui
-    {
-        class GroupBox;
-        class Tab;
-        class TabWidget;
-        class Picture;
-        class GridLayout;
-    }
+namespace flair {
+namespace gui {
+class GroupBox;
+class Tab;
+class TabWidget;
+class Picture;
+class GridLayout;
+}
 }
 
-namespace flair
-{
-namespace sensor
-{
-    /*! \class Camera
-    *
-    * \brief Base class for Camera
-    *
-    * Use this class to define a custom Camera.
-    *
-    */
-    class Camera : public core::IODevice
-    {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a Camera.
-            *
-            * \param parent parent
-            * \param name name
-            * \param width width
-            * \param height height
-            * \param format image format
-            */
-            Camera(const core::FrameworkManager* parent,std::string name,uint16_t width,uint16_t height,core::cvimage::Type::Format format);
+namespace flair {
+namespace sensor {
+/*! \class Camera
+*
+* \brief Base class for Camera
+*
+* Use this class to define a custom Camera.
+*
+*/
+class Camera : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Camera.
+  *
+  * \param parent parent
+  * \param name name
+  * \param width width
+  * \param height height
+  * \param format image format
+  */
+  Camera(const core::FrameworkManager *parent, std::string name, uint16_t width,
+         uint16_t height, core::cvimage::Type::Format format);
 
-            /*!
-            * \brief Constructor
-            *
-            * Construct a Camera. \n
-            * This contructor must only be called for a simulated device.
-            *
-            * \param parent parent
-            * \param name name
-            */
-            Camera(const core::IODevice* parent,std::string name);
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Camera. \n
+  * This contructor must only be called for a simulated device.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  Camera(const core::IODevice *parent, std::string name);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~Camera();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Camera();
 
-            /*!
-            * \brief Use default plot
-            *
-            * \param image image to display
-            */
-            void UseDefaultPlot(const core::cvimage *image);
+  /*!
+  * \brief Use default plot
+  *
+  * \param image image to display
+  */
+  void UseDefaultPlot(const core::cvimage *image);
 
-            /*!
-            * \brief get Layout
-            *
-            * \return a Layout available
-            */
-            gui::GridLayout* GetLayout(void) const;
+  /*!
+  * \brief get Layout
+  *
+  * \return a Layout available
+  */
+  gui::GridLayout *GetLayout(void) const;
 
-            /*!
-            * \brief plot tab
-            *
-            * \return plot tab
-            */
-            gui::Tab* GetPlotTab(void) const;
+  /*!
+  * \brief plot tab
+  *
+  * \return plot tab
+  */
+  gui::Tab *GetPlotTab(void) const;
 
-            /*!
-            * \brief Save picture to file
-            *
-            * \param filename filename
-            */
-            void SaveToFile(std::string filename) const;
+  /*!
+  * \brief Save picture to file
+  *
+  * \param filename filename
+  */
+  void SaveToFile(std::string filename) const;
 
-            /*!
-            * \brief Width
-            *
-            * \return width
-            */
-            uint16_t Width(void) const;
+  /*!
+  * \brief Width
+  *
+  * \return width
+  */
+  uint16_t Width(void) const;
 
-            /*!
-            * \brief Height
-            *
-            * \return height
-            */
-            uint16_t Height(void) const;
+  /*!
+  * \brief Height
+  *
+  * \return height
+  */
+  uint16_t Height(void) const;
 
-             /*!
-            * \brief Output matrix
-            *
-            * Output matrix is of the same size as declared in constructor. \n
-            *
-            * \return the output matrix
-            */
-            core::cvimage* Output(void);
+  /*!
+ * \brief Output matrix
+ *
+ * Output matrix is of the same size as declared in constructor. \n
+ *
+ * \return the output matrix
+ */
+  core::cvimage *Output(void);
 
-            core::DataType const &GetOutputDataType() const;
+  core::DataType const &GetOutputDataType() const;
 
-        protected:
-            /*!
-            * \brief get GroupBox
-            *
-            * \return a GroupBox available
-            */
-            gui::GroupBox* GetGroupBox(void) const;
+protected:
+  /*!
+  * \brief get GroupBox
+  *
+  * \return a GroupBox available
+  */
+  gui::GroupBox *GetGroupBox(void) const;
 
-            core::cvimage *output;
+  core::cvimage *output;
 
-        private:
-            gui::Tab *main_tab,*sensor_tab,*plot_tab;
-            gui::TabWidget *tab;
-            gui::GroupBox* setup_groupbox;
-            gui::GridLayout* setup_layout;
-    };
+private:
+  gui::Tab *main_tab, *sensor_tab, *plot_tab;
+  gui::TabWidget *tab;
+  gui::GroupBox *setup_groupbox;
+  gui::GridLayout *setup_layout;
+};
 } // end namespace sensor
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/Controller.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Controller.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Controller.cpp	(revision 15)
@@ -19,119 +19,130 @@
 using namespace flair::core;
 
-namespace flair { namespace sensor {
+namespace flair {
+namespace sensor {
 
-RumbleMessage::RumbleMessage(unsigned int leftForce,unsigned int leftTimeout,unsigned int rightForce,unsigned int rightTimeout):Message(sizeof(ControllerAction)+sizeof(leftForce)+sizeof(leftTimeout)+sizeof(rightForce)+sizeof(rightTimeout)) {
-    SetLeftForce(leftForce);
-    SetLeftTimeout(leftTimeout);
-    SetRightForce(rightForce);
-    SetRightTimeout(rightTimeout);
-    buffer[0]=(char)ControllerAction::Rumble;
+RumbleMessage::RumbleMessage(unsigned int leftForce, unsigned int leftTimeout,
+                             unsigned int rightForce, unsigned int rightTimeout)
+    : Message(sizeof(ControllerAction) + sizeof(leftForce) +
+              sizeof(leftTimeout) + sizeof(rightForce) + sizeof(rightTimeout)) {
+  SetLeftForce(leftForce);
+  SetLeftTimeout(leftTimeout);
+  SetRightForce(rightForce);
+  SetRightTimeout(rightTimeout);
+  buffer[0] = (char)ControllerAction::Rumble;
 }
 
 unsigned int RumbleMessage::GetLeftForce() const {
-    unsigned int leftForce;
-    memcpy(&leftForce,buffer+leftForceOffset,sizeof(leftForce));
-    return leftForce;
+  unsigned int leftForce;
+  memcpy(&leftForce, buffer + leftForceOffset, sizeof(leftForce));
+  return leftForce;
 }
 
 unsigned int RumbleMessage::GetLeftTimeout() const {
-    unsigned int leftTimeout;
-    memcpy(&leftTimeout,buffer+leftTimeoutOffset,sizeof(leftTimeout));
-    return leftTimeout;
+  unsigned int leftTimeout;
+  memcpy(&leftTimeout, buffer + leftTimeoutOffset, sizeof(leftTimeout));
+  return leftTimeout;
 }
 
 unsigned int RumbleMessage::GetRightForce() const {
-    unsigned int rightForce;
-    memcpy(&rightForce,buffer+rightForceOffset,sizeof(rightForce));
-    return rightForce;
+  unsigned int rightForce;
+  memcpy(&rightForce, buffer + rightForceOffset, sizeof(rightForce));
+  return rightForce;
 }
 
 unsigned int RumbleMessage::GetRightTimeout() const {
-    unsigned int rightTimeout;
-    memcpy(&rightTimeout,buffer+rightTimeoutOffset,sizeof(rightTimeout));
-    return rightTimeout;
+  unsigned int rightTimeout;
+  memcpy(&rightTimeout, buffer + rightTimeoutOffset, sizeof(rightTimeout));
+  return rightTimeout;
 }
 
 void RumbleMessage::SetLeftForce(unsigned int leftForce) {
-    memcpy(buffer+leftForceOffset,&leftForce,sizeof(leftForce));
+  memcpy(buffer + leftForceOffset, &leftForce, sizeof(leftForce));
 }
 
 void RumbleMessage::SetLeftTimeout(unsigned int leftTimeout) {
-    memcpy(buffer+leftTimeoutOffset,&leftTimeout,sizeof(leftTimeout));
+  memcpy(buffer + leftTimeoutOffset, &leftTimeout, sizeof(leftTimeout));
 }
 
 void RumbleMessage::SetRightForce(unsigned int rightForce) {
-    memcpy(buffer+rightForceOffset,&rightForce,sizeof(rightForce));
+  memcpy(buffer + rightForceOffset, &rightForce, sizeof(rightForce));
 }
 
-void RumbleMessage::SetRightTimeout(unsigned int rightTimeout){
-    memcpy(buffer+rightTimeoutOffset,&rightTimeout,sizeof(rightTimeout));
+void RumbleMessage::SetRightTimeout(unsigned int rightTimeout) {
+  memcpy(buffer + rightTimeoutOffset, &rightTimeout, sizeof(rightTimeout));
 }
 
-SwitchLedMessage::SwitchLedMessage(bool isOn, unsigned int ledId):Message(sizeof(ControllerAction)+sizeof(isOn)+sizeof(ledId)) {
-    if (isOn) SetOn(); else SetOff();
-    SetLedId(ledId);
+SwitchLedMessage::SwitchLedMessage(bool isOn, unsigned int ledId)
+    : Message(sizeof(ControllerAction) + sizeof(isOn) + sizeof(ledId)) {
+  if (isOn)
+    SetOn();
+  else
+    SetOff();
+  SetLedId(ledId);
 }
 
 bool SwitchLedMessage::IsOn() const {
-    bool isOn;
-    memcpy(&isOn,buffer+isOnOffset,sizeof(isOn));
-    return isOn;
+  bool isOn;
+  memcpy(&isOn, buffer + isOnOffset, sizeof(isOn));
+  return isOn;
 }
 
 unsigned int SwitchLedMessage::GetLedId() const {
-    unsigned int ledId;
-    memcpy(&ledId,buffer+ledIdOffset,sizeof(ledId));
-    return ledId;
+  unsigned int ledId;
+  memcpy(&ledId, buffer + ledIdOffset, sizeof(ledId));
+  return ledId;
 }
 
 void SwitchLedMessage::SetOn() {
-    bool isOn=true;
-    memcpy(buffer+isOnOffset,&isOn,sizeof(isOn));
+  bool isOn = true;
+  memcpy(buffer + isOnOffset, &isOn, sizeof(isOn));
 }
 
 void SwitchLedMessage::SetOff() {
-    bool isOn=false;
-    memcpy(buffer+isOnOffset,&isOn,sizeof(isOn));
+  bool isOn = false;
+  memcpy(buffer + isOnOffset, &isOn, sizeof(isOn));
 }
 
 void SwitchLedMessage::SetLedId(unsigned int ledId) {
-    memcpy(buffer+ledIdOffset,&ledId,sizeof(ledId));
+  memcpy(buffer + ledIdOffset, &ledId, sizeof(ledId));
 }
 
-FlashLedMessage::FlashLedMessage(unsigned int ledId,unsigned int onTime,unsigned int offTime):Message(sizeof(ControllerAction)+sizeof(ledId)+sizeof(onTime)+sizeof(offTime)) {
-    SetLedId(ledId);
-    SetOnTime(onTime);
-    SetOffTime(offTime);
+FlashLedMessage::FlashLedMessage(unsigned int ledId, unsigned int onTime,
+                                 unsigned int offTime)
+    : Message(sizeof(ControllerAction) + sizeof(ledId) + sizeof(onTime) +
+              sizeof(offTime)) {
+  SetLedId(ledId);
+  SetOnTime(onTime);
+  SetOffTime(offTime);
 }
 
 unsigned int FlashLedMessage::GetLedId() const {
-    unsigned int ledId;
-    memcpy(&ledId,buffer+ledIdOffset,sizeof(ledId));
-    return ledId;
+  unsigned int ledId;
+  memcpy(&ledId, buffer + ledIdOffset, sizeof(ledId));
+  return ledId;
 }
 
 unsigned int FlashLedMessage::GetOnTime() const {
-    unsigned int onTime;
-    memcpy(&onTime,buffer+onTimeOffset,sizeof(onTime));
-    return onTime;
+  unsigned int onTime;
+  memcpy(&onTime, buffer + onTimeOffset, sizeof(onTime));
+  return onTime;
 }
 
 unsigned int FlashLedMessage::GetOffTime() const {
-    unsigned int offTime;
-    memcpy(&offTime,buffer+offTimeOffset,sizeof(offTime));
-    return offTime;
+  unsigned int offTime;
+  memcpy(&offTime, buffer + offTimeOffset, sizeof(offTime));
+  return offTime;
 }
 
 void FlashLedMessage::SetLedId(unsigned int ledId) {
-    memcpy(buffer+ledIdOffset,&ledId,sizeof(ledId));
+  memcpy(buffer + ledIdOffset, &ledId, sizeof(ledId));
 }
 
 void FlashLedMessage::SetOnTime(unsigned int onTime) {
-    memcpy(buffer+onTimeOffset,&onTime,sizeof(onTime));
+  memcpy(buffer + onTimeOffset, &onTime, sizeof(onTime));
 }
 
 void FlashLedMessage::SetOffTime(unsigned int offTime) {
-    memcpy(buffer+offTimeOffset,&offTime,sizeof(offTime));
+  memcpy(buffer + offTimeOffset, &offTime, sizeof(offTime));
 }
 
Index: trunk/lib/FlairSensorActuator/src/Controller.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/Controller.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Controller.h	(revision 15)
@@ -23,66 +23,72 @@
 
 namespace flair {
-    namespace core {
-        class Message;
-    }
+namespace core {
+class Message;
+}
 }
 
-namespace flair { namespace sensor {
+namespace flair {
+namespace sensor {
 
-    enum class ControllerAction {
-        SetLedOn,
-        SetLedOff,
-        Rumble,
-        FlashLed,
-        Exit
-    };
+enum class ControllerAction { SetLedOn, SetLedOff, Rumble, FlashLed, Exit };
 
-    class RumbleMessage: public core::Message {
-    public:
-        RumbleMessage(unsigned int leftForce,unsigned int leftTimeout,unsigned int rightForce,unsigned int rightTimeout);
-        unsigned int GetLeftForce() const;
-        unsigned int GetLeftTimeout() const;
-        unsigned int GetRightForce() const;
-        unsigned int GetRightTimeout() const;
-        void SetLeftForce(unsigned int leftForce);
-        void SetLeftTimeout(unsigned int leftTimeout);
-        void SetRightForce(unsigned int rightForce);
-        void SetRightTimeout(unsigned int rightTimeout);
-    private:
-        static const unsigned int leftForceOffset=sizeof(ControllerAction);
-        static const unsigned int leftTimeoutOffset=sizeof(ControllerAction)+sizeof(unsigned int);
-        static const unsigned int rightForceOffset=sizeof(ControllerAction)+2*sizeof(unsigned int);
-        static const unsigned int rightTimeoutOffset=sizeof(ControllerAction)+3*sizeof(unsigned int);
-    };
+class RumbleMessage : public core::Message {
+public:
+  RumbleMessage(unsigned int leftForce, unsigned int leftTimeout,
+                unsigned int rightForce, unsigned int rightTimeout);
+  unsigned int GetLeftForce() const;
+  unsigned int GetLeftTimeout() const;
+  unsigned int GetRightForce() const;
+  unsigned int GetRightTimeout() const;
+  void SetLeftForce(unsigned int leftForce);
+  void SetLeftTimeout(unsigned int leftTimeout);
+  void SetRightForce(unsigned int rightForce);
+  void SetRightTimeout(unsigned int rightTimeout);
 
-    class SwitchLedMessage: public core::Message {
-    public:
-        SwitchLedMessage(bool isOn,unsigned int ledId);
-        bool IsOn() const;
-        unsigned int GetLedId() const;
-        void SetOn();
-        void SetOff();
-        void SetLedId(unsigned int ledId);
-    private:
-        static const unsigned int isOnOffset=sizeof(ControllerAction);
-        static const unsigned int ledIdOffset=sizeof(ControllerAction)+sizeof(bool);
-    };
+private:
+  static const unsigned int leftForceOffset = sizeof(ControllerAction);
+  static const unsigned int leftTimeoutOffset =
+      sizeof(ControllerAction) + sizeof(unsigned int);
+  static const unsigned int rightForceOffset =
+      sizeof(ControllerAction) + 2 * sizeof(unsigned int);
+  static const unsigned int rightTimeoutOffset =
+      sizeof(ControllerAction) + 3 * sizeof(unsigned int);
+};
 
-    class FlashLedMessage: public core::Message {
-    public:
-        FlashLedMessage(unsigned int ledId,unsigned int onTime,unsigned int offTime);
-        unsigned int GetLedId() const;
-        unsigned int GetOnTime() const;
-        unsigned int GetOffTime() const;
-        void SetLedId(unsigned int ledId);
-        void SetOnTime(unsigned int onTime);
-        void SetOffTime(unsigned int offTime);
-    private:
-        static const unsigned int ledIdOffset=sizeof(ControllerAction);
-        static const unsigned int onTimeOffset=sizeof(ControllerAction)+sizeof(unsigned int);
-        static const unsigned int offTimeOffset=sizeof(ControllerAction)+2*sizeof(unsigned int);
-    };
+class SwitchLedMessage : public core::Message {
+public:
+  SwitchLedMessage(bool isOn, unsigned int ledId);
+  bool IsOn() const;
+  unsigned int GetLedId() const;
+  void SetOn();
+  void SetOff();
+  void SetLedId(unsigned int ledId);
 
-}}
+private:
+  static const unsigned int isOnOffset = sizeof(ControllerAction);
+  static const unsigned int ledIdOffset =
+      sizeof(ControllerAction) + sizeof(bool);
+};
+
+class FlashLedMessage : public core::Message {
+public:
+  FlashLedMessage(unsigned int ledId, unsigned int onTime,
+                  unsigned int offTime);
+  unsigned int GetLedId() const;
+  unsigned int GetOnTime() const;
+  unsigned int GetOffTime() const;
+  void SetLedId(unsigned int ledId);
+  void SetOnTime(unsigned int onTime);
+  void SetOffTime(unsigned int offTime);
+
+private:
+  static const unsigned int ledIdOffset = sizeof(ControllerAction);
+  static const unsigned int onTimeOffset =
+      sizeof(ControllerAction) + sizeof(unsigned int);
+  static const unsigned int offTimeOffset =
+      sizeof(ControllerAction) + 2 * sizeof(unsigned int);
+};
+}
+}
 
 #endif // CONTROLLER_H
Index: trunk/lib/FlairSensorActuator/src/Gps.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Gps.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Gps.cpp	(revision 15)
@@ -38,303 +38,254 @@
 using namespace flair::gui;
 
-namespace flair
-{
-namespace sensor
-{
-
-Gps::Gps(const FrameworkManager* parent,string name,NMEAFlags_t NMEAFlags) : IODevice(parent,name)
-{
-    this->NMEAFlags=NMEAFlags;
-
-    nmea_zero_INFO(&info);
-    nmea_parser_init(&parser);
-    alt_ref=0;
-
-
-    if((NMEAFlags&GGA)==0)
+namespace flair {
+namespace sensor {
+
+Gps::Gps(const FrameworkManager *parent, string name, NMEAFlags_t NMEAFlags)
+    : IODevice(parent, name) {
+  this->NMEAFlags = NMEAFlags;
+
+  nmea_zero_INFO(&info);
+  nmea_parser_init(&parser);
+  alt_ref = 0;
+
+  if ((NMEAFlags & GGA) == 0) {
+    Err("Enable at least GGA sentence\n");
+  }
+
+  int index = 0;
+  if ((NMEAFlags & GGA) != 0) {
+    index += 3;
+  }
+  if ((NMEAFlags & VTG) != 0) {
+    index += 2;
+  }
+  if ((NMEAFlags & GST) != 0) {
+    index += 3;
+  }
+
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(index, 1);
+  index = 0;
+  if ((NMEAFlags & GGA) != 0) {
+    desc->SetElementName(0, 0, "e");
+    desc->SetElementName(1, 0, "n");
+    desc->SetElementName(2, 0, "u");
+    index += 3;
+  }
+  if ((NMEAFlags & VTG) != 0) {
+    desc->SetElementName(index, 0, "ve");
+    desc->SetElementName(index + 1, 0, "vn");
+    index += 2;
+  }
+  if ((NMEAFlags & GST) != 0) {
+    desc->SetElementName(index, 0, "dev_lat");
+    desc->SetElementName(index + 1, 0, "dev_lon");
+    desc->SetElementName(index + 2, 0, "dev_elv");
+    index += 3;
+  }
+  output = new cvmatrix((IODevice *)this, desc, floatType);
+  AddDataToLog(output);
+
+  // station sol
+  main_tab = new Tab(parent->GetTabWidget(), name);
+  tab = new TabWidget(main_tab->NewRow(), name);
+  sensor_tab = new Tab(tab, "Reglages");
+  GroupBox *reglages_groupbox = new GroupBox(sensor_tab->NewRow(), name);
+  button_ref = new PushButton(reglages_groupbox->NewRow(), "set ref");
+  nb_sat_label = new Label(reglages_groupbox->NewRow(), "nb_sat");
+  fix_label = new Label(reglages_groupbox->LastRowLastCol(), "fix");
+
+  position = new GeoCoordinate((IODevice *)this, "position", 0, 0, 0);
+
+  fix = FixQuality_t::Invalid;
+  nb_sat = 0;
+  take_ref = false;
+  nb_sat_label->SetText("nb_sat: %i", nb_sat);
+  fix_label->SetText("fix: %i", fix);
+}
+
+Gps::~Gps() {
+  nmea_parser_destroy(&parser);
+  delete main_tab;
+}
+
+void Gps::UseDefaultPlot(void) {
+  int index = 0;
+  plot_tab = new Tab(tab, "Mesures");
+
+  if ((NMEAFlags & GGA) != 0) {
+    e_plot = new DataPlot1D(plot_tab->NewRow(), "e", -10, 10);
+    e_plot->AddCurve(output->Element(index));
+    n_plot = new DataPlot1D(plot_tab->LastRowLastCol(), "n", -10, 10);
+    n_plot->AddCurve(output->Element(index + 1));
+    u_plot = new DataPlot1D(plot_tab->LastRowLastCol(), "u", -10, 10);
+    u_plot->AddCurve(output->Element(index + 2));
+    index += 3;
+  }
+  if ((NMEAFlags & VTG) != 0) {
+    ve_plot = new DataPlot1D(plot_tab->NewRow(), "ve", -10, 10);
+    ve_plot->AddCurve(output->Element(index));
+    vn_plot = new DataPlot1D(plot_tab->LastRowLastCol(), "vn", -10, 10);
+    vn_plot->AddCurve(output->Element(index + 1));
+    index += 2;
+  }
+
+  Tab *map_tab = new Tab(tab, "carte");
+  map = new Map(map_tab->NewRow(), "map");
+  map->AddPoint(position, "drone");
+}
+
+DataPlot1D *Gps::EPlot(void) const {
+  if ((NMEAFlags & GGA) != 0) {
+    return e_plot;
+  } else {
+    Err("GGA sentence not requested\n");
+    return NULL;
+  }
+}
+
+DataPlot1D *Gps::NPlot(void) const {
+  if ((NMEAFlags & GGA) != 0) {
+    return n_plot;
+  } else {
+    Err("GGA sentence not requested\n");
+    return NULL;
+  }
+}
+
+DataPlot1D *Gps::UPlot(void) const {
+  if ((NMEAFlags & GGA) != 0) {
+    return u_plot;
+  } else {
+    Err("GGA sentence not requested\n");
+    return NULL;
+  }
+}
+
+DataPlot1D *Gps::VEPlot(void) const {
+  if ((NMEAFlags & VTG) != 0) {
+    return ve_plot;
+  } else {
+    Err("GGA sentence not requested\n");
+    return NULL;
+  }
+}
+
+DataPlot1D *Gps::VNPlot(void) const {
+  if ((NMEAFlags & VTG) != 0) {
+    return vn_plot;
+  } else {
+    Err("GGA sentence not requested\n");
+    return NULL;
+  }
+}
+
+Layout *Gps::GetLayout(void) const { return sensor_tab; }
+
+Tab *Gps::GetPlotTab(void) const { return plot_tab; }
+
+TabWidget *Gps::GetTab(void) const { return tab; }
+
+uint16_t Gps::NbSat(void) const {
+  output->GetMutex();
+  uint16_t result = nb_sat;
+  output->ReleaseMutex();
+  return result;
+}
+
+Gps::FixQuality_t Gps::FixQuality(void) const {
+  output->GetMutex();
+  FixQuality_t result = fix;
+  output->ReleaseMutex();
+  return result;
+}
+
+void Gps::SetRef(void) { take_ref = true; }
+
+void Gps::GetENUPosition(Vector3D *point) {
+  output->GetMutex();
+  point->x = output->ValueNoMutex(0, 0);
+  point->y = output->ValueNoMutex(1, 0);
+  point->z = output->ValueNoMutex(2, 0);
+  output->ReleaseMutex();
+}
+
+void Gps::parseFrame(const char *frame, int frame_size) {
+
+  int result;
+
+  result = nmea_parse(&parser, frame, frame_size, &info);
+  if (result != 1) {
+    Warn("unrecognized nmea sentence\n");
+    Warn("%s\n", frame);
+  }
+
+  result = nmea_parse_GPGGA(frame, frame_size, &pack);
+
+  if (result == 1) {
+    // Printf("%s\n",frame);
+    // Printf("nb:%i fix:%i lat:%f long:%f alt:%f vel:%f
+    // angle:%f\n",pack.satinuse,pack.sig,info.lat,info.lon,info.elv,info.speed*1000./3600.,info.direction);
+    // Printf("lat:%f long:%f\n",pos.lat,pos.lon);
+    output->GetMutex(); // on utilise le mutex de l'output pour fix et nb_sat
+    if ((int)fix != pack.sig) {
+      fix = (FixQuality_t)pack.sig;
+      fix_label->SetText("fix: %i", fix);
+    }
+    if (nb_sat != pack.satinuse) {
+      nb_sat = pack.satinuse;
+      nb_sat_label->SetText("nb_sat: %i", nb_sat);
+    }
+    output->ReleaseMutex();
+
+    nmea_info2pos(&info, &pos);
+    position->SetCoordinates(Euler::ToDegree(pos.lat), Euler::ToDegree(pos.lon),
+                             info.elv);
+
+    if ((info.sig == 2 && alt_ref == 0) || button_ref->Clicked() == true ||
+        take_ref == true) {
+      Printf("prise pos ref\n");
+      lat_ref = pos.lat;
+      long_ref = pos.lon;
+      alt_ref = info.elv;
+      take_ref = false;
+    }
+    // if(alt_ref!=0)
     {
-        Err("Enable at least GGA sentence\n");
-    }
-
-    int index=0;
-    if((NMEAFlags&GGA)!=0)
-    {
-        index+=3;
-    }
-    if((NMEAFlags&VTG)!=0)
-    {
-        index+=2;
-    }
-    if((NMEAFlags&GST)!=0)
-    {
-        index+=3;
-    }
-
-    cvmatrix_descriptor* desc=new cvmatrix_descriptor(index,1);
-    index=0;
-    if((NMEAFlags&GGA)!=0)
-    {
-        desc->SetElementName(0,0,"e");
-        desc->SetElementName(1,0,"n");
-        desc->SetElementName(2,0,"u");
-        index+=3;
-    }
-    if((NMEAFlags&VTG)!=0)
-    {
-        desc->SetElementName(index,0,"ve");
-        desc->SetElementName(index+1,0,"vn");
-        index+=2;
-    }
-    if((NMEAFlags&GST)!=0)
-    {
-        desc->SetElementName(index,0,"dev_lat");
-        desc->SetElementName(index+1,0,"dev_lon");
-        desc->SetElementName(index+2,0,"dev_elv");
-        index+=3;
-    }
-    output=new cvmatrix((IODevice*)this,desc,floatType);
-    AddDataToLog(output);
-
-    //station sol
-    main_tab=new Tab(parent->GetTabWidget(),name);
-    tab=new TabWidget(main_tab->NewRow(),name);
-	sensor_tab=new Tab(tab,"Reglages");
-	GroupBox* reglages_groupbox=new GroupBox(sensor_tab->NewRow(),name);
-        button_ref=new PushButton(reglages_groupbox->NewRow(),"set ref");
-        nb_sat_label=new Label(reglages_groupbox->NewRow(),"nb_sat");
-        fix_label=new Label(reglages_groupbox->LastRowLastCol(),"fix");
-
-    position=new GeoCoordinate((IODevice*)this,"position",0,0,0);
-
-    fix=FixQuality_t::Invalid;
-    nb_sat=0;
-    take_ref=false;
-    nb_sat_label->SetText("nb_sat: %i",nb_sat);
-    fix_label->SetText("fix: %i",fix);
-}
-
-Gps::~Gps()
-{
-    nmea_parser_destroy(&parser);
-    delete main_tab;
-}
-
-void Gps::UseDefaultPlot(void)
-{
-    int index=0;
-    plot_tab=new Tab(tab,"Mesures");
-
-    if((NMEAFlags&GGA)!=0)
-    {
-        e_plot=new DataPlot1D(plot_tab->NewRow(),"e",-10,10);
-            e_plot->AddCurve(output->Element(index));
-        n_plot=new DataPlot1D(plot_tab->LastRowLastCol(),"n",-10,10);
-            n_plot->AddCurve(output->Element(index+1));
-        u_plot=new DataPlot1D(plot_tab->LastRowLastCol(),"u",-10,10);
-            u_plot->AddCurve(output->Element(index+2));
-        index+=3;
-    }
-    if((NMEAFlags&VTG)!=0)
-    {
-        ve_plot=new DataPlot1D(plot_tab->NewRow(),"ve",-10,10);
-            ve_plot->AddCurve(output->Element(index));
-        vn_plot=new DataPlot1D(plot_tab->LastRowLastCol(),"vn",-10,10);
-            vn_plot->AddCurve(output->Element(index+1));
-        index+=2;
-    }
-
-    Tab* map_tab=new Tab(tab,"carte");
-        map=new Map(map_tab->NewRow(),"map");
-            map->AddPoint(position,"drone");
-}
-
-DataPlot1D* Gps::EPlot(void) const
-{
-    if((NMEAFlags&GGA)!=0)
-    {
-        return e_plot;
-    }
-    else
-    {
-        Err("GGA sentence not requested\n");
-        return NULL;
-    }
-}
-
-DataPlot1D* Gps::NPlot(void) const
-{
-    if((NMEAFlags&GGA)!=0)
-    {
-        return n_plot;
-    }
-    else
-    {
-        Err("GGA sentence not requested\n");
-        return NULL;
-    }
-}
-
-DataPlot1D* Gps::UPlot(void) const
-{
-    if((NMEAFlags&GGA)!=0)
-    {
-        return u_plot;
-    }
-    else
-    {
-        Err("GGA sentence not requested\n");
-        return NULL;
-    }
-}
-
-DataPlot1D* Gps::VEPlot(void) const
-{
-    if((NMEAFlags&VTG)!=0)
-    {
-        return ve_plot;
-    }
-    else
-    {
-        Err("GGA sentence not requested\n");
-        return NULL;
-    }
-}
-
-DataPlot1D* Gps::VNPlot(void) const
-{
-    if((NMEAFlags&VTG)!=0)
-    {
-        return vn_plot;
-    }
-    else
-    {
-        Err("GGA sentence not requested\n");
-        return NULL;
-    }
-}
-
-Layout* Gps::GetLayout(void) const
-{
-    return sensor_tab;
-}
-
-Tab* Gps::GetPlotTab(void) const
-{
-    return plot_tab;
-}
-
-TabWidget* Gps::GetTab(void) const
-{
-    return tab;
-}
-
-uint16_t Gps::NbSat(void) const
-{
-    output->GetMutex();
-    uint16_t result=nb_sat;
-    output->ReleaseMutex();
-    return result;
-}
-
-Gps::FixQuality_t Gps::FixQuality(void) const
-{
-    output->GetMutex();
-    FixQuality_t result=fix;
-    output->ReleaseMutex();
-    return result;
-}
-
-void Gps::SetRef(void)
-{
-    take_ref=true;
-}
-
-void Gps::GetENUPosition(Vector3D *point)
-{
-    output->GetMutex();
-    point->x=output->ValueNoMutex(0,0);
-    point->y=output->ValueNoMutex(1,0);
-    point->z=output->ValueNoMutex(2,0);
-    output->ReleaseMutex();
-}
-
-void Gps::parseFrame(const char *frame, int frame_size){
-
-    int result;
-
-    result=nmea_parse(&parser, frame, frame_size, &info);
-    if(result!=1)
-    {
-        Warn("unrecognized nmea sentence\n");
-        Warn("%s\n",frame);
-    }
-
-    result=nmea_parse_GPGGA(frame, frame_size, &pack);
-
-    if(result==1)
-    {
-        //Printf("%s\n",frame);
-        //Printf("nb:%i fix:%i lat:%f long:%f alt:%f vel:%f angle:%f\n",pack.satinuse,pack.sig,info.lat,info.lon,info.elv,info.speed*1000./3600.,info.direction);
-        //Printf("lat:%f long:%f\n",pos.lat,pos.lon);
-        output->GetMutex();//on utilise le mutex de l'output pour fix et nb_sat
-        if((int)fix!=pack.sig)
-        {
-            fix=(FixQuality_t)pack.sig;
-            fix_label->SetText("fix: %i",fix);
-        }
-        if(nb_sat!=pack.satinuse)
-        {
-            nb_sat=pack.satinuse;
-            nb_sat_label->SetText("nb_sat: %i",nb_sat);
-        }
-        output->ReleaseMutex();
-
-
-        nmea_info2pos(&info,&pos);
-        position->SetCoordinates(Euler::ToDegree(pos.lat),Euler::ToDegree(pos.lon),info.elv);
-
-        if((info.sig==2 && alt_ref==0) || button_ref->Clicked()==true || take_ref==true)
-        {
-            Printf("prise pos ref\n");
-            lat_ref=pos.lat;
-            long_ref=pos.lon;
-            alt_ref=info.elv;
-            take_ref=false;
-        }
-        //if(alt_ref!=0)
-        {
-            double x,y,z;
-            double e,n,u;
-            Geographique_2_ECEF(pos.lon,pos.lat,info.elv,x,y,z);
-            ECEF_2_ENU(x,y,z,e, n, u,long_ref,lat_ref,alt_ref);
-            //Printf("lon:%f lat:%f elv:%f\n",pos.lon,pos.lat,info.elv);
-
-            //on prend une fois pour toute le mutex et on fait des accès directs
-            output->GetMutex();
-            output->SetValueNoMutex( 0, 0,e);
-            output->SetValueNoMutex( 1, 0,n);
-            output->SetValueNoMutex( 2, 0,u);
-
-            int index=3;
-            if((NMEAFlags&VTG)!=0)
-            {
-                output->SetValueNoMutex( index, 0,info.speed*1000./3600.*sin(Euler::ToRadian(info.direction)));
-                output->SetValueNoMutex( index+1, 0,info.speed*1000./3600.*cos(Euler::ToRadian(info.direction)));
-                index+=2;
-            }
-            if((NMEAFlags&GST)!=0)
-            {
-                //Thread::Printf("dev_lon:%f dev_lat:%f dev_elv:%f\n",info.dev_lat,info.dev_lon,info.dev_elv);
-                output->SetValueNoMutex( index, 0,info.dev_lat);
-                output->SetValueNoMutex( index+1, 0,info.dev_lon);
-                output->SetValueNoMutex( index+2, 0,info.dev_elv);
-                index+=3;
-            }
-            output->ReleaseMutex();
-
-            output->SetDataTime(GetTime());
-            ProcessUpdate(output);
-        }
-    }
+      double x, y, z;
+      double e, n, u;
+      Geographique_2_ECEF(pos.lon, pos.lat, info.elv, x, y, z);
+      ECEF_2_ENU(x, y, z, e, n, u, long_ref, lat_ref, alt_ref);
+      // Printf("lon:%f lat:%f elv:%f\n",pos.lon,pos.lat,info.elv);
+
+      // on prend une fois pour toute le mutex et on fait des accès directs
+      output->GetMutex();
+      output->SetValueNoMutex(0, 0, e);
+      output->SetValueNoMutex(1, 0, n);
+      output->SetValueNoMutex(2, 0, u);
+
+      int index = 3;
+      if ((NMEAFlags & VTG) != 0) {
+        output->SetValueNoMutex(index, 0,
+                                info.speed * 1000. / 3600. *
+                                    sin(Euler::ToRadian(info.direction)));
+        output->SetValueNoMutex(index + 1, 0,
+                                info.speed * 1000. / 3600. *
+                                    cos(Euler::ToRadian(info.direction)));
+        index += 2;
+      }
+      if ((NMEAFlags & GST) != 0) {
+        // Thread::Printf("dev_lon:%f dev_lat:%f
+        // dev_elv:%f\n",info.dev_lat,info.dev_lon,info.dev_elv);
+        output->SetValueNoMutex(index, 0, info.dev_lat);
+        output->SetValueNoMutex(index + 1, 0, info.dev_lon);
+        output->SetValueNoMutex(index + 2, 0, info.dev_elv);
+        index += 3;
+      }
+      output->ReleaseMutex();
+
+      output->SetDataTime(GetTime());
+      ProcessUpdate(output);
+    }
+  }
 }
 
Index: trunk/lib/FlairSensorActuator/src/Gps.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/Gps.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Gps.h	(revision 15)
@@ -17,223 +17,218 @@
 #include <nmea/nmea.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class cvmatrix;
-        class FrameworkManager;
-        class GeoCoordinate;
-        class Vector3D;
-    }
-    namespace gui
-    {
-        class Layout;
-        class DataPlot1D;
-        class Tab;
-        class TabWidget;
-        class PushButton;
-        class Map;
-        class Label;
-    }
+namespace flair {
+namespace core {
+class cvmatrix;
+class FrameworkManager;
+class GeoCoordinate;
+class Vector3D;
 }
-
-namespace flair
-{
-namespace sensor
-{
-    /*! \class Gps
-    *
-    * \brief Base class for GPS
-    */
-    class Gps : public core::IODevice
-    {
-        public:
-            /*!
-            \enum FixQuality_t
-            \brief Fix qualty indicators
-            */
-            enum class FixQuality_t {
-                Invalid=0,/*!< invalid */
-                Gps=1,/*!< Gps */
-                DGps=2,/*!< Differential Gps */
-                Pps=3,/*!< Pps */
-                Rtk=4,/*!< RTK */
-                RtkFloat=5,/*!< RTK float */
-                Estimated=6,/*!< Estimated */
-                Manual=7,/*!< Manual */
-                Simulation=8,/*!< Simulation */
-                };
-
-            /*!
-            \enum NMEAFlags_t
-            \brief NMEA flags
-            */
-            enum NMEAFlags_t {
-                GGA=0x01,/*!< GGA */
-                VTG=0x02,/*!< VTG */
-                GST=0x04,/*!< GST */
-                };
-
-            /*!
-            * \brief Constructor
-            *
-            * Construct a Gps.
-            *
-            * \param parent parent
-            * \param name name
-            * \param NMEAFlags NMEA sentances to enable
-            */
-            Gps(const core::FrameworkManager* parent,std::string name,NMEAFlags_t NMEAFlags);
-
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~Gps();
-
-            /*!
-            * \brief Use default plot
-            *
-            */
-            void UseDefaultPlot(void);
-
-            /*!
-            * \brief East plot
-            *
-            * \return east plot
-            */
-            gui::DataPlot1D* EPlot(void) const;
-
-            /*!
-            * \brief North plot
-            *
-            * \return north plot
-            */
-            gui::DataPlot1D* NPlot(void) const;
-
-            /*!
-            * \brief Up plot
-            *
-            * \return up plot
-            */
-            gui::DataPlot1D* UPlot(void) const;
-
-            /*!
-            * \brief East velocity plot
-            *
-            * \return east velocity plot
-            */
-            gui::DataPlot1D* VEPlot(void) const;
-
-            /*!
-            * \brief North velocity plot
-            *
-            * \return north velocity plot
-            */
-            gui::DataPlot1D* VNPlot(void) const;
-
-            /*!
-            * \brief Main tab
-            *
-            * \return main tab
-            */
-            gui::TabWidget* GetTab(void) const;
-
-            /*!
-            * \brief Setup Layout
-            *
-            * \return setup Layout
-            */
-            gui::Layout* GetLayout(void) const;
-
-            /*!
-            * \brief Plot tab
-            *
-            * \return plot Tab
-            */
-            gui::Tab* GetPlotTab(void) const;
-
-            /*!
-            * \brief Number of used satellites
-            *
-            * \return number of used satellites
-            */
-            uint16_t NbSat(void) const;
-
-            /*!
-            * \brief Fix Quality
-            *
-            * \return fix quality
-            */
-            FixQuality_t FixQuality(void) const;
-
-            /*!
-            * \brief Set reference for ENU coordinates
-            *
-            * The actual position is used as reference to calculate
-            * ENU coordinates.
-            *
-            * \return fix quality
-            */
-            void SetRef(void);
-
-            /*!
-            * \brief Get ENU position
-            *
-            * \param point to store position
-            */
-            void GetENUPosition(core::Vector3D *point);
-
-        protected:
-            /*!
-            * \brief Parse a NMEA frame
-            *
-            * This function must be called by the reimplemented class. \n
-            * When a frame is parsed, GPS datas are filled.
-            *
-            * \param frame NMEA frame
-            * \param frame_size frame size
-            *
-            */
-            void parseFrame(const char *frame, int frame_size);
-
-            NMEAFlags_t NMEAFlags;
-
-        protected:
-            core::GeoCoordinate *position;
-
-        private:
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data){};
-
-            gui::Tab *main_tab,*sensor_tab;
-            gui::TabWidget* tab;
-            gui::PushButton *button_ref;
-            gui::DataPlot1D* e_plot;
-            gui::DataPlot1D* n_plot;
-            gui::DataPlot1D* u_plot;
-            gui::DataPlot1D* ve_plot;
-            gui::DataPlot1D* vn_plot;
-            gui::Tab* plot_tab;
-            gui::Map *map;
-            gui::Label *nb_sat_label,*fix_label;
-            uint16_t nb_sat;
-            FixQuality_t fix;
-            bool take_ref;
-            nmeaINFO info;
-            nmeaPARSER parser;
-            nmeaGPGGA pack;
-            nmeaPOS pos;
-            double lat_ref,long_ref,alt_ref;
-
-            //matrix
-            core::cvmatrix *output;
-    };
+namespace gui {
+class Layout;
+class DataPlot1D;
+class Tab;
+class TabWidget;
+class PushButton;
+class Map;
+class Label;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class Gps
+*
+* \brief Base class for GPS
+*/
+class Gps : public core::IODevice {
+public:
+  /*!
+  \enum FixQuality_t
+  \brief Fix qualty indicators
+  */
+  enum class FixQuality_t {
+    Invalid = 0,    /*!< invalid */
+    Gps = 1,        /*!< Gps */
+    DGps = 2,       /*!< Differential Gps */
+    Pps = 3,        /*!< Pps */
+    Rtk = 4,        /*!< RTK */
+    RtkFloat = 5,   /*!< RTK float */
+    Estimated = 6,  /*!< Estimated */
+    Manual = 7,     /*!< Manual */
+    Simulation = 8, /*!< Simulation */
+  };
+
+  /*!
+  \enum NMEAFlags_t
+  \brief NMEA flags
+  */
+  enum NMEAFlags_t {
+    GGA = 0x01, /*!< GGA */
+    VTG = 0x02, /*!< VTG */
+    GST = 0x04, /*!< GST */
+  };
+
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Gps.
+  *
+  * \param parent parent
+  * \param name name
+  * \param NMEAFlags NMEA sentances to enable
+  */
+  Gps(const core::FrameworkManager *parent, std::string name,
+      NMEAFlags_t NMEAFlags);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Gps();
+
+  /*!
+  * \brief Use default plot
+  *
+  */
+  void UseDefaultPlot(void);
+
+  /*!
+  * \brief East plot
+  *
+  * \return east plot
+  */
+  gui::DataPlot1D *EPlot(void) const;
+
+  /*!
+  * \brief North plot
+  *
+  * \return north plot
+  */
+  gui::DataPlot1D *NPlot(void) const;
+
+  /*!
+  * \brief Up plot
+  *
+  * \return up plot
+  */
+  gui::DataPlot1D *UPlot(void) const;
+
+  /*!
+  * \brief East velocity plot
+  *
+  * \return east velocity plot
+  */
+  gui::DataPlot1D *VEPlot(void) const;
+
+  /*!
+  * \brief North velocity plot
+  *
+  * \return north velocity plot
+  */
+  gui::DataPlot1D *VNPlot(void) const;
+
+  /*!
+  * \brief Main tab
+  *
+  * \return main tab
+  */
+  gui::TabWidget *GetTab(void) const;
+
+  /*!
+  * \brief Setup Layout
+  *
+  * \return setup Layout
+  */
+  gui::Layout *GetLayout(void) const;
+
+  /*!
+  * \brief Plot tab
+  *
+  * \return plot Tab
+  */
+  gui::Tab *GetPlotTab(void) const;
+
+  /*!
+  * \brief Number of used satellites
+  *
+  * \return number of used satellites
+  */
+  uint16_t NbSat(void) const;
+
+  /*!
+  * \brief Fix Quality
+  *
+  * \return fix quality
+  */
+  FixQuality_t FixQuality(void) const;
+
+  /*!
+  * \brief Set reference for ENU coordinates
+  *
+  * The actual position is used as reference to calculate
+  * ENU coordinates.
+  *
+  * \return fix quality
+  */
+  void SetRef(void);
+
+  /*!
+  * \brief Get ENU position
+  *
+  * \param point to store position
+  */
+  void GetENUPosition(core::Vector3D *point);
+
+protected:
+  /*!
+  * \brief Parse a NMEA frame
+  *
+  * This function must be called by the reimplemented class. \n
+  * When a frame is parsed, GPS datas are filled.
+  *
+  * \param frame NMEA frame
+  * \param frame_size frame size
+  *
+  */
+  void parseFrame(const char *frame, int frame_size);
+
+  NMEAFlags_t NMEAFlags;
+
+protected:
+  core::GeoCoordinate *position;
+
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
+
+  gui::Tab *main_tab, *sensor_tab;
+  gui::TabWidget *tab;
+  gui::PushButton *button_ref;
+  gui::DataPlot1D *e_plot;
+  gui::DataPlot1D *n_plot;
+  gui::DataPlot1D *u_plot;
+  gui::DataPlot1D *ve_plot;
+  gui::DataPlot1D *vn_plot;
+  gui::Tab *plot_tab;
+  gui::Map *map;
+  gui::Label *nb_sat_label, *fix_label;
+  uint16_t nb_sat;
+  FixQuality_t fix;
+  bool take_ref;
+  nmeaINFO info;
+  nmeaPARSER parser;
+  nmeaGPGGA pack;
+  nmeaPOS pos;
+  double lat_ref, long_ref, alt_ref;
+
+  // matrix
+  core::cvmatrix *output;
+};
 } // end namespace sensor
 } // end namespace framewor
Index: trunk/lib/FlairSensorActuator/src/Gx3_25_imu.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Gx3_25_imu.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Gx3_25_imu.cpp	(revision 15)
@@ -25,28 +25,30 @@
 using namespace flair::core;
 
-namespace flair { namespace sensor {
+namespace flair {
+namespace sensor {
 
-Gx3_25_imu::Gx3_25_imu(const FrameworkManager* parent,string name,SerialPort* serialport,Command_t command,uint8_t priority) : Imu(parent,name),Thread(parent,name,priority) {
-    pimpl_=new Gx3_25_imu_impl(this,name,serialport,command,GetGroupBox());
+Gx3_25_imu::Gx3_25_imu(const FrameworkManager *parent, string name,
+                       SerialPort *serialport, Command_t command,
+                       uint8_t priority)
+    : Imu(parent, name), Thread(parent, name, priority) {
+  pimpl_ = new Gx3_25_imu_impl(this, name, serialport, command, GetGroupBox());
 
-    if(command==EulerAnglesAndAngularRates) {
+  if (command == EulerAnglesAndAngularRates) {
 
-    } else if(command==AccelerationAngularRateAndOrientationMatrix) {
-        Thread::Err("oneaxis rotation of rotation matrix is not yet implemented\n");
-    } else {
-        Thread::Err("command not supported (%i)\n",command);
-    }
-    //AddDataToLog(imudata);
+  } else if (command == AccelerationAngularRateAndOrientationMatrix) {
+    Thread::Err("oneaxis rotation of rotation matrix is not yet implemented\n");
+  } else {
+    Thread::Err("command not supported (%i)\n", command);
+  }
+  // AddDataToLog(imudata);
 }
 
 Gx3_25_imu::~Gx3_25_imu() {
-    SafeStop();
-    Join();
-    delete pimpl_;
+  SafeStop();
+  Join();
+  delete pimpl_;
 }
 
-void Gx3_25_imu::Run(void) {
-    pimpl_->Run();
-}
+void Gx3_25_imu::Run(void) { pimpl_->Run(); }
 
 } // end namespace sensor
Index: trunk/lib/FlairSensorActuator/src/Gx3_25_imu.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/Gx3_25_imu.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Gx3_25_imu.h	(revision 15)
@@ -18,69 +18,72 @@
 
 namespace flair {
-    namespace core {
-        class FrameworkManager;
-        class SerialPort;
-    }
+namespace core {
+class FrameworkManager;
+class SerialPort;
+}
 }
 
 class Gx3_25_imu_impl;
 
-namespace flair { namespace sensor {
-    /*! \class Gx3_25_imu
-    *
-    * \brief Class for 3dmgx3-25 Imu
-    */
-    class Gx3_25_imu : public Imu, public core::Thread {
-        friend class ::Gx3_25_imu_impl;
+namespace flair {
+namespace sensor {
+/*! \class Gx3_25_imu
+*
+* \brief Class for 3dmgx3-25 Imu
+*/
+class Gx3_25_imu : public Imu, public core::Thread {
+  friend class ::Gx3_25_imu_impl;
 
-        public:
-            /*!
-            \enum Command_t
-            \brief Command for the continuous mode
-            */
-            enum Command_t{
-                EulerAnglesAndAngularRates=0xcf,/*!< Euler angles and angular rates */
-                AccelerationAngularRateAndOrientationMatrix=0xc8,/*!< Acceleration, angular rate and orientation matrix */
-                };
+public:
+  /*!
+  \enum Command_t
+  \brief Command for the continuous mode
+  */
+  enum Command_t {
+    EulerAnglesAndAngularRates = 0xcf, /*!< Euler angles and angular rates */
+    AccelerationAngularRateAndOrientationMatrix =
+        0xc8, /*!< Acceleration, angular rate and orientation matrix */
+  };
 
-            /*!
-            * \brief Constructor
-            *
-            * Construct a Gx3_25_imu.
-            *
-            * \param parent parent
-            * \param name name
-            * \param serialport SerialPort
-            * \param command command for continuous mode
-            * \param priority priority of the Thread
-            */
-            Gx3_25_imu(const core::FrameworkManager* parent,std::string name,core::SerialPort *serialport,Command_t command,uint8_t priority);
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Gx3_25_imu.
+  *
+  * \param parent parent
+  * \param name name
+  * \param serialport SerialPort
+  * \param command command for continuous mode
+  * \param priority priority of the Thread
+  */
+  Gx3_25_imu(const core::FrameworkManager *parent, std::string name,
+             core::SerialPort *serialport, Command_t command, uint8_t priority);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~Gx3_25_imu();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Gx3_25_imu();
 
-        private:
-            /*!
-            * \brief Run function
-            *
-            * Reimplemented from Thread.
-            *
-            */
-            void Run(void);
+private:
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
 
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data){};
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
 
-            class Gx3_25_imu_impl* pimpl_;
-    };
+  class Gx3_25_imu_impl *pimpl_;
+};
 } // end namespace sensor
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/Gx3_25_imu_impl.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Gx3_25_imu_impl.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Gx3_25_imu_impl.cpp	(revision 15)
@@ -38,513 +38,546 @@
 using namespace flair::sensor;
 
-Gx3_25_imu_impl::Gx3_25_imu_impl(Gx3_25_imu* self,string name,SerialPort *serialport,Gx3_25_imu::Command_t command,GroupBox* setupgroupbox) {
-    int err = 0;
-
-    this->self=self;
-    this->command=(uint8_t)command;
-    this->setupgroupbox=setupgroupbox;
-    this->serialport=serialport;
-
-    ahrsData=new AhrsData((Imu*)self);
-
-    //station sol
-    button_bias=new PushButton(setupgroupbox->NewRow(),"gyros bias");
-    data_rate=new SpinBox(setupgroupbox->NewRow(),"data rate (Hz):",1,500,1,200);
-    data_rate_label=new Label(setupgroupbox->LastRowLastCol(),"data_rate");
-    gyro_acc_size=new SpinBox(setupgroupbox->NewRow(),"gyro and acc filter win size:",1,32,1,15);
-    mag_size=new SpinBox(setupgroupbox->LastRowLastCol(),"mag filter win size:",1,32,1,17);
-    up_comp=new SpinBox(setupgroupbox->NewRow(),"up compensation (s):",1,1000,1,10);
-    north_comp=new SpinBox(setupgroupbox->LastRowLastCol(),"north compensation (s):",1,1000,1,10);
-    coning=new CheckBox(setupgroupbox->NewRow(),"enable Coning&Sculling:",true);
-    disable_magn=new CheckBox(setupgroupbox->LastRowLastCol(),"disable magnetometer:",true);
-    disable_north_comp=new CheckBox(setupgroupbox->NewRow(),"disable magnetic north compensation:",false);
-    disable_grav_comp=new CheckBox(setupgroupbox->NewRow(),"disable gravity compensation:",false);
-}
-
-Gx3_25_imu_impl::~Gx3_25_imu_impl() {
-}
+Gx3_25_imu_impl::Gx3_25_imu_impl(Gx3_25_imu *self, string name,
+                                 SerialPort *serialport,
+                                 Gx3_25_imu::Command_t command,
+                                 GroupBox *setupgroupbox) {
+  int err = 0;
+
+  this->self = self;
+  this->command = (uint8_t)command;
+  this->setupgroupbox = setupgroupbox;
+  this->serialport = serialport;
+
+  ahrsData = new AhrsData((Imu *)self);
+
+  // station sol
+  button_bias = new PushButton(setupgroupbox->NewRow(), "gyros bias");
+  data_rate =
+      new SpinBox(setupgroupbox->NewRow(), "data rate (Hz):", 1, 500, 1, 200);
+  data_rate_label = new Label(setupgroupbox->LastRowLastCol(), "data_rate");
+  gyro_acc_size = new SpinBox(setupgroupbox->NewRow(),
+                              "gyro and acc filter win size:", 1, 32, 1, 15);
+  mag_size = new SpinBox(setupgroupbox->LastRowLastCol(),
+                         "mag filter win size:", 1, 32, 1, 17);
+  up_comp = new SpinBox(setupgroupbox->NewRow(), "up compensation (s):", 1,
+                        1000, 1, 10);
+  north_comp = new SpinBox(setupgroupbox->LastRowLastCol(),
+                           "north compensation (s):", 1, 1000, 1, 10);
+  coning =
+      new CheckBox(setupgroupbox->NewRow(), "enable Coning&Sculling:", true);
+  disable_magn = new CheckBox(setupgroupbox->LastRowLastCol(),
+                              "disable magnetometer:", true);
+  disable_north_comp = new CheckBox(
+      setupgroupbox->NewRow(), "disable magnetic north compensation:", false);
+  disable_grav_comp = new CheckBox(setupgroupbox->NewRow(),
+                                   "disable gravity compensation:", false);
+}
+
+Gx3_25_imu_impl::~Gx3_25_imu_impl() {}
 
 void Gx3_25_imu_impl::Run(void) {
-    Time imuTime;
-    ImuData* imuData;
-    self->GetDatas(&imuData);
-
-    self->WarnUponSwitches(true);
-
-    //reset IMU to be sure it is at 115200
-    Printf("Gx3_25_imu::Reset IMU at 921600\n");
-    serialport->SetBaudrate(921600);
-    DeviceReset();
-    self->Thread::SleepMS(100);
-    serialport->FlushInput();
-    serialport->SetBaudrate(115200);
-
-    SetBaudrate(921600);
-    Printf("Gx3_25_imu firmware number: %i\n",FirmwareNumber());
-    PrintModelInfo();
-    SamplingSettings();
-    GyrosBias();
-    //RealignUpNorth(true,true);
-
-    //on provoque les 9 ValueChanged
-    for(int i=0; i<9; i++) {
-        if(data_rate->ValueChanged()==true || disable_magn->ValueChanged()==true ||disable_north_comp->ValueChanged()==true ||disable_grav_comp->ValueChanged()==true ||coning->ValueChanged()==true
-                || gyro_acc_size->ValueChanged()==true || mag_size->ValueChanged()==true ||up_comp->ValueChanged()==true || north_comp->ValueChanged()==true) {
-            if(setupgroupbox->isEnabled()==true) SamplingSettings();
-        }
-    }
-
-    //periode a passer an argument (reglable)
-    //ou plutot laisser la periode geree par le centrale (polling)
-    //self->SetPeriodMS(2);
-    SetContinuousMode(command);
-
-    //_printf("firmware version: %i\n",get_firmware_number());
-
-    while(!self->ToBeStopped()) {
-        if(command==Gx3_25_imu::EulerAnglesAndAngularRates) {
-            uint8_t response[31] = {0};
-            uint8_t *buf=&response[1];
-            GetData(response,sizeof(response),&imuTime);
-
-            Euler eulerAngles;
-            eulerAngles.roll=Dequeue(&buf);
-            eulerAngles.pitch=Dequeue(&buf);
-            eulerAngles.yaw=Dequeue(&buf);
-
-            Vector3D filteredAngRates;
-            filteredAngRates.x=Dequeue(&buf);
-            filteredAngRates.y=Dequeue(&buf);
-            filteredAngRates.z=Dequeue(&buf);
-
-            ahrsData->SetQuaternionAndAngularRates(eulerAngles.ToQuaternion(),filteredAngRates);
-        } else if(command==Gx3_25_imu::AccelerationAngularRateAndOrientationMatrix) {
-            uint8_t response[67] = {0};
-            uint8_t *buf=&response[1];
-            GetData(response,sizeof(response),&imuTime);
-
-            Vector3D rawAcc;
-            rawAcc.x=9.80665*Dequeue(&buf);
-            rawAcc.y=9.80665*Dequeue(&buf);
-            rawAcc.z=9.80665*Dequeue(&buf);
-
-            Vector3D filteredAngRates;
-            filteredAngRates.x=Dequeue(&buf);
-            filteredAngRates.y=Dequeue(&buf);
-            filteredAngRates.z=Dequeue(&buf);
-
-            RotationMatrix matrix;
-            matrix(0,0)=Dequeue(&buf);
-            matrix(0,1)=Dequeue(&buf);
-            matrix(0,2)=Dequeue(&buf);
-            matrix(1,0)=Dequeue(&buf);
-            matrix(1,1)=Dequeue(&buf);
-            matrix(1,2)=Dequeue(&buf);
-            matrix(2,0)=Dequeue(&buf);
-            matrix(2,1)=Dequeue(&buf);
-            matrix(2,2)=Dequeue(&buf);
-
-            ahrsData->SetQuaternionAndAngularRates(matrix.ToEuler().ToQuaternion(),filteredAngRates);
-            imuData->SetRawAcc(rawAcc);
-        }
-
-        //change settings as soon as possible
-        //we assume that new imu datas will not come so fast
-        //so newt message from imu is an ack from the change settings
-        if(button_bias->Clicked()==true) GyrosBias();
-
-        if(data_rate->ValueChanged()==true || disable_magn->ValueChanged()==true ||disable_north_comp->ValueChanged()==true ||disable_grav_comp->ValueChanged()==true ||coning->ValueChanged()==true
-                || gyro_acc_size->ValueChanged()==true || mag_size->ValueChanged()==true ||up_comp->ValueChanged()==true || north_comp->ValueChanged()==true) {
-            if(setupgroupbox->isEnabled()==true) SamplingSettings();
-        }
-
-        imuData->SetDataTime(imuTime);
-        ahrsData->SetDataTime(imuTime);
-        self->UpdateImu();
-        self->ProcessUpdate(ahrsData);
-    }
-    SetContinuousMode(0);
-    SetBaudrate(115200);
-
-    self->WarnUponSwitches(false);
-}
-
-void Gx3_25_imu_impl::GetData(uint8_t* buf,ssize_t buf_size,Time *time) {
+  Time imuTime;
+  ImuData *imuData;
+  self->GetDatas(&imuData);
+
+  self->WarnUponSwitches(true);
+
+  // reset IMU to be sure it is at 115200
+  Printf("Gx3_25_imu::Reset IMU at 921600\n");
+  serialport->SetBaudrate(921600);
+  DeviceReset();
+  self->Thread::SleepMS(100);
+  serialport->FlushInput();
+  serialport->SetBaudrate(115200);
+
+  SetBaudrate(921600);
+  Printf("Gx3_25_imu firmware number: %i\n", FirmwareNumber());
+  PrintModelInfo();
+  SamplingSettings();
+  GyrosBias();
+  // RealignUpNorth(true,true);
+
+  // on provoque les 9 ValueChanged
+  for (int i = 0; i < 9; i++) {
+    if (data_rate->ValueChanged() == true ||
+        disable_magn->ValueChanged() == true ||
+        disable_north_comp->ValueChanged() == true ||
+        disable_grav_comp->ValueChanged() == true ||
+        coning->ValueChanged() == true ||
+        gyro_acc_size->ValueChanged() == true ||
+        mag_size->ValueChanged() == true || up_comp->ValueChanged() == true ||
+        north_comp->ValueChanged() == true) {
+      if (setupgroupbox->isEnabled() == true)
+        SamplingSettings();
+    }
+  }
+
+  // periode a passer an argument (reglable)
+  // ou plutot laisser la periode geree par le centrale (polling)
+  // self->SetPeriodMS(2);
+  SetContinuousMode(command);
+
+  //_printf("firmware version: %i\n",get_firmware_number());
+
+  while (!self->ToBeStopped()) {
+    if (command == Gx3_25_imu::EulerAnglesAndAngularRates) {
+      uint8_t response[31] = {0};
+      uint8_t *buf = &response[1];
+      GetData(response, sizeof(response), &imuTime);
+
+      Euler eulerAngles;
+      eulerAngles.roll = Dequeue(&buf);
+      eulerAngles.pitch = Dequeue(&buf);
+      eulerAngles.yaw = Dequeue(&buf);
+
+      Vector3D filteredAngRates;
+      filteredAngRates.x = Dequeue(&buf);
+      filteredAngRates.y = Dequeue(&buf);
+      filteredAngRates.z = Dequeue(&buf);
+
+      ahrsData->SetQuaternionAndAngularRates(eulerAngles.ToQuaternion(),
+                                             filteredAngRates);
+    } else if (command ==
+               Gx3_25_imu::AccelerationAngularRateAndOrientationMatrix) {
+      uint8_t response[67] = {0};
+      uint8_t *buf = &response[1];
+      GetData(response, sizeof(response), &imuTime);
+
+      Vector3D rawAcc;
+      rawAcc.x = 9.80665 * Dequeue(&buf);
+      rawAcc.y = 9.80665 * Dequeue(&buf);
+      rawAcc.z = 9.80665 * Dequeue(&buf);
+
+      Vector3D filteredAngRates;
+      filteredAngRates.x = Dequeue(&buf);
+      filteredAngRates.y = Dequeue(&buf);
+      filteredAngRates.z = Dequeue(&buf);
+
+      RotationMatrix matrix;
+      matrix(0, 0) = Dequeue(&buf);
+      matrix(0, 1) = Dequeue(&buf);
+      matrix(0, 2) = Dequeue(&buf);
+      matrix(1, 0) = Dequeue(&buf);
+      matrix(1, 1) = Dequeue(&buf);
+      matrix(1, 2) = Dequeue(&buf);
+      matrix(2, 0) = Dequeue(&buf);
+      matrix(2, 1) = Dequeue(&buf);
+      matrix(2, 2) = Dequeue(&buf);
+
+      ahrsData->SetQuaternionAndAngularRates(matrix.ToEuler().ToQuaternion(),
+                                             filteredAngRates);
+      imuData->SetRawAcc(rawAcc);
+    }
+
+    // change settings as soon as possible
+    // we assume that new imu datas will not come so fast
+    // so newt message from imu is an ack from the change settings
+    if (button_bias->Clicked() == true)
+      GyrosBias();
+
+    if (data_rate->ValueChanged() == true ||
+        disable_magn->ValueChanged() == true ||
+        disable_north_comp->ValueChanged() == true ||
+        disable_grav_comp->ValueChanged() == true ||
+        coning->ValueChanged() == true ||
+        gyro_acc_size->ValueChanged() == true ||
+        mag_size->ValueChanged() == true || up_comp->ValueChanged() == true ||
+        north_comp->ValueChanged() == true) {
+      if (setupgroupbox->isEnabled() == true)
+        SamplingSettings();
+    }
+
+    imuData->SetDataTime(imuTime);
+    ahrsData->SetDataTime(imuTime);
+    self->UpdateImu();
+    self->ProcessUpdate(ahrsData);
+  }
+  SetContinuousMode(0);
+  SetBaudrate(115200);
+
+  self->WarnUponSwitches(false);
+}
+
+void Gx3_25_imu_impl::GetData(uint8_t *buf, ssize_t buf_size, Time *time) {
+  ssize_t read = 0;
+  ssize_t written = 0;
+  /*
+      written = serialport->Write(&command, sizeof(command));
+      if(written<0)
+      {
+          self->Thread::Err("Write error (%s)\n",strerror(-written));
+      }
+      else if (written != sizeof(command))
+      {
+          self->Thread::Err("Write error %i/%i\n",written,sizeof(command));
+      }
+  */
+  read = serialport->Read(buf, buf_size);
+  *time = GetTime();
+  if (read < 0) {
+    self->Thread::Err("Read error (%s)\n", strerror(-read));
+  } else if (read != buf_size) {
+    self->Thread::Err("Read error %i/%i\n", read, buf_size);
+  }
+
+  if (CalcChecksum(buf, buf_size) == false) {
+    self->Thread::Err("wrong checksum\n");
+    return;
+  }
+}
+
+float Gx3_25_imu_impl::Dequeue(uint8_t **buf) {
+  union float_4uint8 {
+    float f;
+    uint8_t b[4];
+  } float_value;
+
+  float_value.b[0] = (*buf)[3];
+  float_value.b[1] = (*buf)[2];
+  float_value.b[2] = (*buf)[1];
+  float_value.b[3] = (*buf)[0];
+  (*buf) += sizeof(float);
+
+  return float_value.f;
+}
+
+void Gx3_25_imu_impl::GyrosBias(void) {
+  if (setupgroupbox->isEnabled() == true) { // devrait toujours etre bon
+    uint8_t response[19] = {0};
+    uint8_t command[5];
     ssize_t read = 0;
     ssize_t written = 0;
-    /*
-        written = serialport->Write(&command, sizeof(command));
-        if(written<0)
-        {
-            self->Thread::Err("Write error (%s)\n",strerror(-written));
-        }
-        else if (written != sizeof(command))
-        {
-            self->Thread::Err("Write error %i/%i\n",written,sizeof(command));
-        }
-    */
-    read = serialport->Read(buf,buf_size);
-    *time=GetTime();
-    if(read<0) {
-        self->Thread::Err("Read error (%s)\n",strerror(-read));
-    } else if (read != buf_size) {
-        self->Thread::Err("Read error %i/%i\n",read,buf_size);
-    }
-
-    if(CalcChecksum(buf,buf_size)==false) {
-        self->Thread::Err("wrong checksum\n");
-        return;
-    }
-}
-
-float Gx3_25_imu_impl::Dequeue(uint8_t** buf) {
-    union float_4uint8 {
-        float f;
-        uint8_t b[4];
-    }
-    float_value;
-
-    float_value.b[0]=(*buf)[3];
-    float_value.b[1]=(*buf)[2];
-    float_value.b[2]=(*buf)[1];
-    float_value.b[3]=(*buf)[0];
-    (*buf)+=sizeof(float);
-
-    return float_value.f;
-}
-
-void Gx3_25_imu_impl::GyrosBias(void) {
-    if(setupgroupbox->isEnabled()==true) { //devrait toujours etre bon
-        uint8_t response[19] = {0};
-        uint8_t command[5];
-        ssize_t read = 0;
-        ssize_t written = 0;
-
-        Printf("Gx3_25_imu::gyros_bias: %s\n",self->IODevice::ObjectName().c_str());
-
-        command[0]=0xcd;//entete
-        command[1]=0xc1;//confirm
-        command[2]=0x29;//confirm
-        command[3]=0x27;//time MSB en us
-        command[4]=0x10;//time LSB en us
-
-        written = serialport->Write( &command, sizeof(command));
-        if(written<0) {
-            self->Thread::Err("Write error (%s)\n",strerror(-written));
-        } else if (written != sizeof(command)) {
-            self->Thread::Err("Write error %i/%i\n",written,sizeof(command));
-        }
-
-        self->SleepUS(1.1*(command[3]*256+command[4]));//on fait un sleep un peu plus grand
-
-        read = serialport->Read(&response[0],sizeof(response));
-        if(read<0) {
-            self->Thread::Err("Read error (%s)\n",strerror(-read));
-        } else if (read != sizeof(response)) {
-            self->Thread::Err("Read error %i/%i\n",read,sizeof(response));
-        }
-
-        if(CalcChecksum(response,sizeof(response))==false) {
-            self->Thread::Err("wrong checksum\n");
-            //return -1;
-        }
-
-        Printf("Gx3_25_imu::gyros_bias: %s ok\n",self->IODevice::ObjectName().c_str());
-
-    } else {
-        self->Thread::Err("error locked\n");
-    }
+
+    Printf("Gx3_25_imu::gyros_bias: %s\n",
+           self->IODevice::ObjectName().c_str());
+
+    command[0] = 0xcd; // entete
+    command[1] = 0xc1; // confirm
+    command[2] = 0x29; // confirm
+    command[3] = 0x27; // time MSB en us
+    command[4] = 0x10; // time LSB en us
+
+    written = serialport->Write(&command, sizeof(command));
+    if (written < 0) {
+      self->Thread::Err("Write error (%s)\n", strerror(-written));
+    } else if (written != sizeof(command)) {
+      self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+    }
+
+    self->SleepUS(1.1 * (command[3] * 256 +
+                         command[4])); // on fait un sleep un peu plus grand
+
+    read = serialport->Read(&response[0], sizeof(response));
+    if (read < 0) {
+      self->Thread::Err("Read error (%s)\n", strerror(-read));
+    } else if (read != sizeof(response)) {
+      self->Thread::Err("Read error %i/%i\n", read, sizeof(response));
+    }
+
+    if (CalcChecksum(response, sizeof(response)) == false) {
+      self->Thread::Err("wrong checksum\n");
+      // return -1;
+    }
+
+    Printf("Gx3_25_imu::gyros_bias: %s ok\n",
+           self->IODevice::ObjectName().c_str());
+
+  } else {
+    self->Thread::Err("error locked\n");
+  }
 }
 
 void Gx3_25_imu_impl::SetContinuousMode(uint8_t continuous_command) {
-    uint8_t response[8] = {0};
-    uint8_t command[4];
-    ssize_t read = 0;
-    ssize_t written = 0;
-
-    command[0]=0xc4;//entete
-    command[1]=0xc1;//confirm
-    command[2]=0x29;//confirm
-    command[3]=continuous_command;
-
-    written = serialport->Write(command,sizeof(command));
-    if(written<0) {
-        self->Thread::Err("Write error (%s)\n",strerror(-written));
+  uint8_t response[8] = {0};
+  uint8_t command[4];
+  ssize_t read = 0;
+  ssize_t written = 0;
+
+  command[0] = 0xc4; // entete
+  command[1] = 0xc1; // confirm
+  command[2] = 0x29; // confirm
+  command[3] = continuous_command;
+
+  written = serialport->Write(command, sizeof(command));
+  if (written < 0) {
+    self->Thread::Err("Write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(command)) {
+    self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+  }
+
+  read = serialport->Read(response, sizeof(response));
+  if (read < 0) {
+    self->Thread::Err("Read error (%s)\n", strerror(-read));
+  } else if (read != sizeof(response)) {
+    self->Thread::Err("Read error %i/%i\n", read, sizeof(response));
+  }
+
+  if (CalcChecksum(response, sizeof(response)) == false) {
+    self->Thread::Err("wrong checksum\n", self->IODevice::ObjectName().c_str());
+  }
+}
+
+void Gx3_25_imu_impl::SamplingSettings(void) {
+  uint8_t response[19] = {0};
+  uint8_t command[20];
+  uint8_t result;
+  ssize_t read = 0;
+  ssize_t written = 0;
+
+  uint16_t rate = 1000 / data_rate->Value();
+
+  command[0] = 0xdb;               // entete
+  command[1] = 0xa8;               // confirm
+  command[2] = 0xb9;               // confirm
+  command[3] = 1;                  // change values
+  command[4] = (rate >> 8) & 0xff; // data rate MSB
+  command[5] = rate & 0xff;        // data rate LSB
+  result = 0;
+  if (disable_magn->IsChecked() == true)
+    result |= 0x01;
+  if (disable_north_comp->IsChecked() == true)
+    result |= 0x04;
+  if (disable_grav_comp->IsChecked() == true)
+    result |= 0x08;
+
+  command[6] = result;
+  result = 0x01; // Calculate orientation
+  if (coning->IsChecked() == true)
+    result |= 0x02;
+
+  command[7] = result;
+  command[8] = gyro_acc_size->Value();             // gyro acc filter window
+  command[9] = mag_size->Value();                  // mag filter window
+  command[10] = (up_comp->Value() >> 8) & 0xff;    // up comp MSB
+  command[11] = up_comp->Value() & 0xff;           // up comp LSB
+  command[12] = (north_comp->Value() >> 8) & 0xff; // north comp MSB
+  command[13] = north_comp->Value() & 0xff;        // north comp LSB
+  command[14] = 0;                                 // reserved
+  command[15] = 0;                                 // reserved
+  command[16] = 0;                                 // reserved
+  command[17] = 0;                                 // reserved
+  command[18] = 0;                                 // reserved
+  command[19] = 0;                                 // reserved
+
+  written = serialport->Write(&command, sizeof(command));
+  if (written < 0) {
+    self->Thread::Err("Write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(command)) {
+    self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+  }
+
+  read = serialport->Read(&response[0], sizeof(response));
+  if (read < 0) {
+    self->Thread::Err("Read error (%s)\n", strerror(-read));
+  } else if (read != sizeof(response)) {
+    self->Thread::Err("Read error %i/%i\n", read, sizeof(response));
+  }
+
+  if (CalcChecksum(response, sizeof(response)) == false) {
+    self->Thread::Err("wrong checksum\n", self->IODevice::ObjectName().c_str());
+  } else {
+    data_rate_label->SetText("real: %.2fHz", 1000. / rate);
+  }
+}
+
+void Gx3_25_imu_impl::SetBaudrate(int value) {
+  uint8_t response[10] = {0};
+  uint8_t command[11];
+  ssize_t read = 0;
+  ssize_t written = 0;
+
+  union int32_4uint8 {
+    int32_t i;
+    uint8_t b[4];
+  } baudrate_value;
+
+  baudrate_value.i = value;
+  Printf("Gx3_25_imu::SetBaudrate: %s ->%i\n",
+         self->IODevice::ObjectName().c_str(), baudrate_value.i);
+
+  command[0] = 0xd9; // entete
+  command[1] = 0xc3; // confirm
+  command[2] = 0x55; // confirm
+  command[3] = 1;    // primary uart
+  command[4] = 1;    // chgt temporaire
+  command[5] = baudrate_value.b[3];
+  command[6] = baudrate_value.b[2];
+  command[7] = baudrate_value.b[1];
+  command[8] = baudrate_value.b[0];
+  command[9] = 2;  // uart enabled
+  command[10] = 0; // reserved
+
+  written = serialport->Write(&command, sizeof(command));
+  if (written < 0) {
+    self->Thread::Err("Write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(command)) {
+    self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+  }
+
+  read = serialport->Read(&response[0], sizeof(response));
+  if (read < 0) {
+    self->Thread::Err("Read error (%s)\n", strerror(-read));
+  } else if (read != sizeof(response)) {
+    self->Thread::Err("Read error %i/%i\n", read, sizeof(response));
+  }
+
+  if (CalcChecksum(response, sizeof(response)) == false) {
+    self->Thread::Err("wrong checksum\n");
+    return;
+  }
+
+  serialport->SetBaudrate(value);
+}
+
+int Gx3_25_imu_impl::FirmwareNumber(void) {
+  uint8_t response[7] = {0};
+  uint8_t command;
+  ssize_t read = 0;
+  ssize_t written = 0;
+  union int32_4uint8 {
+    int32_t i;
+    uint8_t b[4];
+  } value;
+
+  command = 0xe9; // entete
+
+  written = serialport->Write(&command, sizeof(command));
+  if (written < 0) {
+    self->Thread::Err("Write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(command)) {
+    self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+  }
+
+  read = serialport->Read(&response[0], sizeof(response));
+  if (read < 0) {
+    self->Thread::Err("Read error (%s)\n", strerror(-read));
+  } else if (read != sizeof(response)) {
+    self->Thread::Err("Read error %i/%i\n", read, sizeof(response));
+  }
+
+  if (CalcChecksum(response, sizeof(response)) == false) {
+    self->Thread::Err("wrong checksum\n");
+    return -1;
+  }
+
+  value.b[3] = response[1];
+  value.b[2] = response[2];
+  value.b[1] = response[3];
+  value.b[0] = response[4];
+
+  return value.i;
+}
+
+void Gx3_25_imu_impl::PrintModelInfo(void) {
+  uint8_t response[20] = {0};
+  uint8_t command[2];
+  ssize_t read = 0;
+  ssize_t written = 0;
+
+  for (int i = 0; i < 3; i++) {
+    command[0] = 0xea; // entete
+    command[1] = i;    // entete
+
+    written = serialport->Write(&command, sizeof(command));
+    if (written < 0) {
+      self->Thread::Err("Write error (%s)\n", strerror(-written));
     } else if (written != sizeof(command)) {
-        self->Thread::Err("Write error %i/%i\n",written,sizeof(command));
-    }
-
-    read = serialport->Read(response,sizeof(response));
-    if(read<0) {
-        self->Thread::Err("Read error (%s)\n",strerror(-read));
+      self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+    }
+
+    read = serialport->Read(&response[0], sizeof(response));
+    if (read < 0) {
+      self->Thread::Err("Read error (%s)\n", strerror(-read));
     } else if (read != sizeof(response)) {
-        self->Thread::Err("Read error %i/%i\n",read,sizeof(response));
-    }
-
-    if(CalcChecksum(response,sizeof(response))==false) {
-        self->Thread::Err("wrong checksum\n",self->IODevice::ObjectName().c_str());
-    }
-}
-
-void Gx3_25_imu_impl::SamplingSettings(void) {
-    uint8_t response[19] = {0};
-    uint8_t command[20];
-    uint8_t result;
-    ssize_t read = 0;
-    ssize_t written = 0;
-
-    uint16_t rate=1000/data_rate->Value();
-
-    command[0]=0xdb;//entete
-    command[1]=0xa8;//confirm
-    command[2]=0xb9;//confirm
-    command[3]=1;//change values
-    command[4]=(rate>>8)&0xff;//data rate MSB
-    command[5]=rate&0xff;//data rate LSB
-    result=0;
-    if(disable_magn->IsChecked()==true) result|=0x01;
-    if(disable_north_comp->IsChecked()==true) result|=0x04;
-    if(disable_grav_comp->IsChecked()==true) result|=0x08;
-
-    command[6]=result;
-    result=0x01;//Calculate orientation
-    if(coning->IsChecked()==true) result|=0x02;
-
-    command[7]=result;
-    command[8]=gyro_acc_size->Value();//gyro acc filter window
-    command[9]=mag_size->Value();//mag filter window
-    command[10]=(up_comp->Value()>>8)&0xff;//up comp MSB
-    command[11]=up_comp->Value()&0xff;//up comp LSB
-    command[12]=(north_comp->Value()>>8)&0xff;//north comp MSB
-    command[13]=north_comp->Value()&0xff;//north comp LSB
-    command[14]=0;//reserved
-    command[15]=0;//reserved
-    command[16]=0;//reserved
-    command[17]=0;//reserved
-    command[18]=0;//reserved
-    command[19]=0;//reserved
-
-    written = serialport->Write(&command, sizeof(command));
-    if(written<0) {
-        self->Thread::Err("Write error (%s)\n",strerror(-written));
-    } else if (written != sizeof(command)) {
-        self->Thread::Err("Write error %i/%i\n",written,sizeof(command));
-    }
-
-    read = serialport->Read(&response[0],sizeof(response));
-    if(read<0) {
-        self->Thread::Err("Read error (%s)\n",strerror(-read));
-    } else if (read != sizeof(response)) {
-        self->Thread::Err("Read error %i/%i\n",read,sizeof(response));
-    }
-
-    if(CalcChecksum(response,sizeof(response))==false) {
-        self->Thread::Err("wrong checksum\n",self->IODevice::ObjectName().c_str());
-    } else {
-        data_rate_label->SetText("real: %.2fHz",1000./rate);
-    }
-}
-
-void Gx3_25_imu_impl::SetBaudrate(int value) {
-    uint8_t response[10] = {0};
-    uint8_t command[11];
-    ssize_t read = 0;
-    ssize_t written = 0;
-
-    union int32_4uint8 {
-        int32_t i;
-        uint8_t b[4];
-    }
-    baudrate_value;
-
-    baudrate_value.i=value;
-    Printf("Gx3_25_imu::SetBaudrate: %s ->%i\n",self->IODevice::ObjectName().c_str(),baudrate_value.i);
-
-    command[0]=0xd9;//entete
-    command[1]=0xc3;//confirm
-    command[2]=0x55;//confirm
-    command[3]=1;//primary uart
-    command[4]=1;//chgt temporaire
-    command[5]=baudrate_value.b[3];
-    command[6]=baudrate_value.b[2];
-    command[7]=baudrate_value.b[1];
-    command[8]=baudrate_value.b[0];
-    command[9]=2;//uart enabled
-    command[10]=0;//reserved
-
-    written = serialport->Write(&command, sizeof(command));
-    if(written<0) {
-        self->Thread::Err("Write error (%s)\n",strerror(-written));
-    } else if (written != sizeof(command)) {
-        self->Thread::Err("Write error %i/%i\n",written,sizeof(command));
-    }
-
-    read = serialport->Read(&response[0],sizeof(response));
-    if(read<0) {
-        self->Thread::Err("Read error (%s)\n",strerror(-read));
-    } else if (read != sizeof(response)) {
-        self->Thread::Err("Read error %i/%i\n",read,sizeof(response));
-    }
-
-    if(CalcChecksum(response,sizeof(response))==false) {
-        self->Thread::Err("wrong checksum\n");
-        return ;
-    }
-
-    serialport->SetBaudrate(value);
-}
-
-int Gx3_25_imu_impl::FirmwareNumber(void) {
-    uint8_t response[7] = {0};
-    uint8_t command;
-    ssize_t read = 0;
-    ssize_t written = 0;
-    union int32_4uint8 {
-        int32_t i;
-        uint8_t b[4];
-    }
-    value;
-
-    command=0xe9;//entete
-
-    written = serialport->Write(&command, sizeof(command));
-    if(written<0) {
-        self->Thread::Err("Write error (%s)\n",strerror(-written));
-    } else if (written != sizeof(command)) {
-        self->Thread::Err("Write error %i/%i\n",written,sizeof(command));
-    }
-
-    read = serialport->Read(&response[0],sizeof(response));
-    if(read<0) {
-        self->Thread::Err("Read error (%s)\n",strerror(-read));
-    } else if (read != sizeof(response)) {
-        self->Thread::Err("Read error %i/%i\n",read,sizeof(response));
-    }
-
-    if(CalcChecksum(response,sizeof(response))==false) {
-        self->Thread::Err("wrong checksum\n");
-        return -1;
-    }
-
-    value.b[3]=response[1];
-    value.b[2]=response[2];
-    value.b[1]=response[3];
-    value.b[0]=response[4];
-
-    return value.i;
-
-}
-
-void Gx3_25_imu_impl::PrintModelInfo(void) {
-    uint8_t response[20] = {0};
-    uint8_t command[2];
-    ssize_t read = 0;
-    ssize_t written = 0;
-
-    for(int i=0; i<3; i++) {
-        command[0]=0xea;//entete
-        command[1]=i;//entete
-
-        written = serialport->Write(&command, sizeof(command));
-        if(written<0) {
-            self->Thread::Err("Write error (%s)\n",strerror(-written));
-        } else if (written != sizeof(command)) {
-            self->Thread::Err("Write error %i/%i\n",written,sizeof(command));
-        }
-
-        read = serialport->Read(&response[0],sizeof(response));
-        if(read<0) {
-            self->Thread::Err("Read error (%s)\n",strerror(-read));
-        } else if (read != sizeof(response)) {
-            self->Thread::Err("Read error %i/%i\n",read,sizeof(response));
-        }
-
-        if(CalcChecksum(response,sizeof(response))==false) {
-            self->Thread::Err("wrong checksum\n");
-            //return -1;
-        }
-
-        char* msg=(char*)(&response[2]);
-        msg[16]=0;
-        switch(i) {
-        case 0:
-            Printf("Gx3_25_imu model number: %s\n",msg);
-            break;
-        case 1:
-            Printf("Gx3_25_imu serial number: %s\n",msg);
-            break;
-        case 2:
-            Printf("Gx3_25_imu model name: %s\n",msg);
-            break;
-        }
-    }
-
-}
-
-void Gx3_25_imu_impl::RealignUpNorth(bool realign_up,bool realign_north) {
-    uint8_t response[7] = {0};
-    uint8_t command[10];
-    ssize_t read = 0;
-    ssize_t written = 0;
-
-    command[0]=0xdd;//entete
-    command[1]=0x54;//confirm
-    command[2]=0x4c;//confirm
-    command[3]=0;//send reply
-    command[4]=255;//up realign
-    command[5]=1;//north realign
-    command[6]=0;//reserved
-    command[7]=0;//reserved
-    command[8]=0;//reserved
-    command[9]=0;//reserved
-
-    written = serialport->Write(&command, sizeof(command));
-    if(written<0) {
-        self->Thread::Err("Write error (%s)\n",strerror(-written));
-    } else if (written != sizeof(command)) {
-        self->Thread::Err("Write error %i/%i\n",written,sizeof(command));
-    }
-
-    read = serialport->Read(&response[0],sizeof(response));
-    if(read<0) {
-        self->Thread::Err("Read error(%s)\n",strerror(-read));
-    } else if (read != sizeof(response)) {
-        self->Thread::Err("Read error %i/%i\n",read,sizeof(response));
-    }
-
-    if(CalcChecksum(response,sizeof(response))==false) {
-        self->Thread::Err("wrong checksum\n");
-    }
+      self->Thread::Err("Read error %i/%i\n", read, sizeof(response));
+    }
+
+    if (CalcChecksum(response, sizeof(response)) == false) {
+      self->Thread::Err("wrong checksum\n");
+      // return -1;
+    }
+
+    char *msg = (char *)(&response[2]);
+    msg[16] = 0;
+    switch (i) {
+    case 0:
+      Printf("Gx3_25_imu model number: %s\n", msg);
+      break;
+    case 1:
+      Printf("Gx3_25_imu serial number: %s\n", msg);
+      break;
+    case 2:
+      Printf("Gx3_25_imu model name: %s\n", msg);
+      break;
+    }
+  }
+}
+
+void Gx3_25_imu_impl::RealignUpNorth(bool realign_up, bool realign_north) {
+  uint8_t response[7] = {0};
+  uint8_t command[10];
+  ssize_t read = 0;
+  ssize_t written = 0;
+
+  command[0] = 0xdd; // entete
+  command[1] = 0x54; // confirm
+  command[2] = 0x4c; // confirm
+  command[3] = 0;    // send reply
+  command[4] = 255;  // up realign
+  command[5] = 1;    // north realign
+  command[6] = 0;    // reserved
+  command[7] = 0;    // reserved
+  command[8] = 0;    // reserved
+  command[9] = 0;    // reserved
+
+  written = serialport->Write(&command, sizeof(command));
+  if (written < 0) {
+    self->Thread::Err("Write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(command)) {
+    self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+  }
+
+  read = serialport->Read(&response[0], sizeof(response));
+  if (read < 0) {
+    self->Thread::Err("Read error(%s)\n", strerror(-read));
+  } else if (read != sizeof(response)) {
+    self->Thread::Err("Read error %i/%i\n", read, sizeof(response));
+  }
+
+  if (CalcChecksum(response, sizeof(response)) == false) {
+    self->Thread::Err("wrong checksum\n");
+  }
 }
 
 void Gx3_25_imu_impl::DeviceReset(void) {
-    uint8_t command[3];
-    ssize_t written = 0;
-
-    command[0]=0xfe;//entete
-    command[1]=0x9e;//confirm
-    command[2]=0x3a;//confirm
-
-    written = serialport->Write(&command, sizeof(command));
-    if(written<0) {
-        self->Thread::Err("Write error (%s)\n",strerror(-written));
-    } else if (written != sizeof(command)) {
-        self->Thread::Err("Write error %i/%i\n",written,sizeof(command));
-    }
-}
-
-bool Gx3_25_imu_impl::CalcChecksum(uint8_t *buf,int size) {
-    uint16_t tChksum,tResponseChksum;
-
-    tChksum = 0;
-    for (int i = 0; i < size - 2; i++) tChksum += buf[i];
-    // Extract the big-endian checksum from reply
-    tResponseChksum = 0;
-    tResponseChksum = buf[size - 2] << 8;
-    tResponseChksum += buf[size - 1];
-
-    if(tChksum!=tResponseChksum)
-        return false;
-    else
-        return true;
-}
+  uint8_t command[3];
+  ssize_t written = 0;
+
+  command[0] = 0xfe; // entete
+  command[1] = 0x9e; // confirm
+  command[2] = 0x3a; // confirm
+
+  written = serialport->Write(&command, sizeof(command));
+  if (written < 0) {
+    self->Thread::Err("Write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(command)) {
+    self->Thread::Err("Write error %i/%i\n", written, sizeof(command));
+  }
+}
+
+bool Gx3_25_imu_impl::CalcChecksum(uint8_t *buf, int size) {
+  uint16_t tChksum, tResponseChksum;
+
+  tChksum = 0;
+  for (int i = 0; i < size - 2; i++)
+    tChksum += buf[i];
+  // Extract the big-endian checksum from reply
+  tResponseChksum = 0;
+  tResponseChksum = buf[size - 2] << 8;
+  tResponseChksum += buf[size - 1];
+
+  if (tChksum != tResponseChksum)
+    return false;
+  else
+    return true;
+}
Index: trunk/lib/FlairSensorActuator/src/HokuyoUTM30Lx.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/HokuyoUTM30Lx.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/HokuyoUTM30Lx.cpp	(revision 15)
@@ -32,221 +32,220 @@
 using namespace flair::gui;
 
-namespace flair
-{
-namespace sensor
-{
-
-HokuyoUTM30Lx::HokuyoUTM30Lx(const FrameworkManager* parent,string name,SerialPort *serialport,uint8_t priority) : LaserRangeFinder(parent,name), Thread(parent,name,priority)
-{
-    main_tab=new Tab(parent->GetTabWidget(),name);
-	cvmatrix_descriptor* desc=new cvmatrix_descriptor(1081,1);
-    output=new cvmatrix((IODevice*)this,desc,SignedIntegerType(16));
-
-    bufRetMut = new Mutex(reinterpret_cast<Object*>(this),(string)name+"BufRetMut");
-    sendingCmdMut = new Mutex(reinterpret_cast<Object*>(this),(string)name+"SendingCmdMut");
-
-    this->serialport=serialport;
-    serialport->SetRxTimeout(100000000);
-}
-
-HokuyoUTM30Lx::~HokuyoUTM30Lx()
-{
-    delete main_tab;
-    SafeStop();
-    Join();
-}
-
-void HokuyoUTM30Lx::Run(void)
-{
-	/** Debut init **/
-    char c,lastC;
-    int startStep;
-    bool mustDecode=false;
-    stringstream ss;
-    vector<string> ret;
-    lastC=c=0;
-
-	/** Fin init **/
-	resetConfig();
-	startLaser();
-	Printf("Laser started\r\n");
-
-    /** Debut running loop **/
-    WarnUponSwitches(true);
-
-    while(!ToBeStopped())
-    {
-        ss.clear();
-        ss.str("");
-        do{
-            lastC=c;
-            serialport->Read(&c,1);
-            ss << c;
-        }while(!(c=='\n'&&lastC=='\n'));
-        ret=explode(ss.str(),'\n');
-        if(!checkSum(ret.at(1)))
-            perror("Bad Checksum !");
-        if(ret.at(0).substr(0,2)=="MD")
-            mustDecode=true;
-
-        startStep=atoi(ret.at(0).substr(2,4).c_str());
-        ret.erase(ret.begin());
-        bufRetMut->GetMutex();
-        bufRet.push(ret.at(0).substr(0,2));
-        bufRetMut->ReleaseMutex();
-        if(mustDecode){
-            mustDecode=false;
-            ss.clear();
-            ss.str("");
-            do{
-                lastC=c;
-                serialport->Read(&c,1);
-                ss << c;
-            }while(!(c=='\n'&&lastC=='\n'));
-            ret=explode(ss.str(),'\n');
-            ret.erase(ret.begin());
-            ret.erase(ret.begin());
-            if(ret.at(0).size()==5)
-                if(!checkSum(ret.at(0)))
-                    perror("TimeStamp checksum error!");
-            ret.erase(ret.begin());
-            Printf("!post\r\n");
-            ret.pop_back();
-            decodeDatas(ret, startStep);
-        }
+namespace flair {
+namespace sensor {
+
+HokuyoUTM30Lx::HokuyoUTM30Lx(const FrameworkManager *parent, string name,
+                             SerialPort *serialport, uint8_t priority)
+    : LaserRangeFinder(parent, name), Thread(parent, name, priority) {
+  main_tab = new Tab(parent->GetTabWidget(), name);
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(1081, 1);
+  output = new cvmatrix((IODevice *)this, desc, SignedIntegerType(16));
+
+  bufRetMut =
+      new Mutex(reinterpret_cast<Object *>(this), (string)name + "BufRetMut");
+  sendingCmdMut = new Mutex(reinterpret_cast<Object *>(this),
+                            (string)name + "SendingCmdMut");
+
+  this->serialport = serialport;
+  serialport->SetRxTimeout(100000000);
+}
+
+HokuyoUTM30Lx::~HokuyoUTM30Lx() {
+  delete main_tab;
+  SafeStop();
+  Join();
+}
+
+void HokuyoUTM30Lx::Run(void) {
+  /** Debut init **/
+  char c, lastC;
+  int startStep;
+  bool mustDecode = false;
+  stringstream ss;
+  vector<string> ret;
+  lastC = c = 0;
+
+  /** Fin init **/
+  resetConfig();
+  startLaser();
+  Printf("Laser started\r\n");
+
+  /** Debut running loop **/
+  WarnUponSwitches(true);
+
+  while (!ToBeStopped()) {
+    ss.clear();
+    ss.str("");
+    do {
+      lastC = c;
+      serialport->Read(&c, 1);
+      ss << c;
+    } while (!(c == '\n' && lastC == '\n'));
+    ret = explode(ss.str(), '\n');
+    if (!checkSum(ret.at(1)))
+      perror("Bad Checksum !");
+    if (ret.at(0).substr(0, 2) == "MD")
+      mustDecode = true;
+
+    startStep = atoi(ret.at(0).substr(2, 4).c_str());
+    ret.erase(ret.begin());
+    bufRetMut->GetMutex();
+    bufRet.push(ret.at(0).substr(0, 2));
+    bufRetMut->ReleaseMutex();
+    if (mustDecode) {
+      mustDecode = false;
+      ss.clear();
+      ss.str("");
+      do {
+        lastC = c;
+        serialport->Read(&c, 1);
+        ss << c;
+      } while (!(c == '\n' && lastC == '\n'));
+      ret = explode(ss.str(), '\n');
+      ret.erase(ret.begin());
+      ret.erase(ret.begin());
+      if (ret.at(0).size() == 5)
+        if (!checkSum(ret.at(0)))
+          perror("TimeStamp checksum error!");
+      ret.erase(ret.begin());
+      Printf("!post\r\n");
+      ret.pop_back();
+      decodeDatas(ret, startStep);
     }
-    /** fin running loop **/
-    stopLaser();
-    WarnUponSwitches(false);
-}
-
-
-void HokuyoUTM30Lx::decodeDatas(vector<string> datas, int startStep){
-            stringstream ss;
-            for (unsigned i=0; i<datas.size(); i++){
-                if(datas.at(i).size()!=0){
-                    if(!checkSum(datas.at(i)))
-                        perror("Datas checksum error !");
-                    datas.at(i).erase(datas.at(i).end()-1);
-                    ss << datas.at(i);
-                }
-            }
-            output->GetMutex();
-            for(unsigned i=0;i<1080;i++){
-            //TODO: remettre -1 pour les points non lus
-                output->SetValueNoMutex(i,0,0);
-            }
-            for(unsigned i=0;i<ss.str().size();i+=3){
-                output->SetValueNoMutex(startStep+(i/3),0,decode3car(ss.str().substr(i,3).c_str()));
-            }
-            UpdateFrom(output);
-            ProcessUpdate(output);
-            output->ReleaseMutex();
-
-}
-
-bool HokuyoUTM30Lx::checkSum(string data){
-    return (char)encodeSum(data.substr(0,data.size()-1).c_str(),data.size()-1)==data.at(data.size()-1);
-}
-
-void HokuyoUTM30Lx::startLaser(){
-    string ret = sendCommand("BM");
-    #ifdef VERBOSE
-        if(ret == "00"){
-            cout << "BM: Alright !" << endl;
-        }else if(ret == "01"){
-            cout << "BM: Laser malfunction !" << endl;
-        }else if(ret == "02"){
-            cout << "BM: Laser already started !" << endl;
-        }
-    #endif
-}
-
-void HokuyoUTM30Lx::stopLaser(){
-    sendCommand("QT");
-}
-
-void HokuyoUTM30Lx::resetConfig(){
-    sendCommand("RS");
-}
-
-vector<string> HokuyoUTM30Lx::explode(const string str, char delimiter){
-    istringstream split(str);
-    vector<string> tokens;
-    for (string each; getline(split, each, delimiter); tokens.push_back(each));
-    return tokens;
-}
-
-int HokuyoUTM30Lx::encodeSum(const char* code, int byte) {
-    unsigned char value = 0;
-    int i;
-    for (i = 0; i < byte; ++i) {
-        value+=code[i];
+  }
+  /** fin running loop **/
+  stopLaser();
+  WarnUponSwitches(false);
+}
+
+void HokuyoUTM30Lx::decodeDatas(vector<string> datas, int startStep) {
+  stringstream ss;
+  for (unsigned i = 0; i < datas.size(); i++) {
+    if (datas.at(i).size() != 0) {
+      if (!checkSum(datas.at(i)))
+        perror("Datas checksum error !");
+      datas.at(i).erase(datas.at(i).end() - 1);
+      ss << datas.at(i);
     }
-    value &= 0x3f;
-    value += 0x30;
-    return value;
-}
-
-float HokuyoUTM30Lx::decode2car(const char* data){
-    return ((data[0]-0x30)<<6)|((data[1]-0x30));
-}
-float HokuyoUTM30Lx::decode3car(const char* data){
-    return ((data[0]-0x30)<<12)|((data[1]-0x30)<<6)|((data[2]-0x30));
-}
-float HokuyoUTM30Lx::decode4car(const char* data){
-    return ((data[0]-0x30)<<18)|((data[1]-0x30)<<12)|((data[2]-0x30)<<6)|((data[3]-0x30));
-}
-
-string HokuyoUTM30Lx::sendCommand(string command){
-    char c;
-    string ret="00";
-    c='\n';
-    sendingCmdMut->GetMutex();
-    serialport->Write(command.c_str(),command.size());
-    serialport->Write(&c,1);
-    sendingCmdMut->ReleaseMutex();
-    return ret;
-}
-
-void HokuyoUTM30Lx::getMesure(int startStep, int endStep,int clusterCount, int interval, int scanNumber){
-    stringstream ss;
-    string ret;
-    ss << "MD" << std::setfill('0') << std::setw(4) << startStep << std::setw(4) << endStep << std::setw(2) << clusterCount << std::setw(1) << interval << std::setw(2) << scanNumber;
-    ret = sendCommand(ss.str());
-    #ifdef VERBOSE
-        if(ret == "00"){
-            cout << "MD: Alright !" << endl;
-        }else if(ret == "01"){
-            cout << "MD: Laser malfunction !" << endl;
-        }else if(ret == "02"){
-            cout << "MD: End Step has non-numeric value !" << endl;
-        }else if(ret == "03"){
-            cout << "MD: Cluster Count has non-numeric value !" << endl;
-        }else if(ret == "04"){
-            cout << "MD: End Step is out of range !" << endl;
-        }else if(ret == "05"){
-            cout << "MD: End Step is smaller than Starting Step !" << endl;
-        }else if(ret == "06"){
-            cout << "MD: Scan Interval has non-numeric value !" << endl;
-        }else if(ret == "07"){
-            cout << "MD: Number of Scan has non-numeric value !" << endl;
-        }else if(ret == "98"){
-            cout << "MD: Resumption of process after confirming normal HokuyoUTM30Lx operation." << endl;
-        }else{
-            /* Concerne :
-            21~49 --- Processing stopped to verify the error.
-            50~97 --- Hardware trouble (such as laser, motor malfunctions etc.)*/
-            cout << "MD: Malfunction !" << endl;
-        }
-    #endif
-    }
-cvmatrix* HokuyoUTM30Lx::getDatas(){
-    return output;
-}
-
-void HokuyoUTM30Lx::UseDefaultPlot(void)
-{
-    plot=new RangeFinderPlot(main_tab->NewRow(),"plot","x",-100,100,"y",-0,100,output,-45,225,output->Rows());
+  }
+  output->GetMutex();
+  for (unsigned i = 0; i < 1080; i++) {
+    // TODO: remettre -1 pour les points non lus
+    output->SetValueNoMutex(i, 0, 0);
+  }
+  for (unsigned i = 0; i < ss.str().size(); i += 3) {
+    output->SetValueNoMutex(startStep + (i / 3), 0,
+                            decode3car(ss.str().substr(i, 3).c_str()));
+  }
+  UpdateFrom(output);
+  ProcessUpdate(output);
+  output->ReleaseMutex();
+}
+
+bool HokuyoUTM30Lx::checkSum(string data) {
+  return (char)encodeSum(data.substr(0, data.size() - 1).c_str(),
+                         data.size() - 1) == data.at(data.size() - 1);
+}
+
+void HokuyoUTM30Lx::startLaser() {
+  string ret = sendCommand("BM");
+#ifdef VERBOSE
+  if (ret == "00") {
+    cout << "BM: Alright !" << endl;
+  } else if (ret == "01") {
+    cout << "BM: Laser malfunction !" << endl;
+  } else if (ret == "02") {
+    cout << "BM: Laser already started !" << endl;
+  }
+#endif
+}
+
+void HokuyoUTM30Lx::stopLaser() { sendCommand("QT"); }
+
+void HokuyoUTM30Lx::resetConfig() { sendCommand("RS"); }
+
+vector<string> HokuyoUTM30Lx::explode(const string str, char delimiter) {
+  istringstream split(str);
+  vector<string> tokens;
+  for (string each; getline(split, each, delimiter); tokens.push_back(each))
+    ;
+  return tokens;
+}
+
+int HokuyoUTM30Lx::encodeSum(const char *code, int byte) {
+  unsigned char value = 0;
+  int i;
+  for (i = 0; i < byte; ++i) {
+    value += code[i];
+  }
+  value &= 0x3f;
+  value += 0x30;
+  return value;
+}
+
+float HokuyoUTM30Lx::decode2car(const char *data) {
+  return ((data[0] - 0x30) << 6) | ((data[1] - 0x30));
+}
+float HokuyoUTM30Lx::decode3car(const char *data) {
+  return ((data[0] - 0x30) << 12) | ((data[1] - 0x30) << 6) |
+         ((data[2] - 0x30));
+}
+float HokuyoUTM30Lx::decode4car(const char *data) {
+  return ((data[0] - 0x30) << 18) | ((data[1] - 0x30) << 12) |
+         ((data[2] - 0x30) << 6) | ((data[3] - 0x30));
+}
+
+string HokuyoUTM30Lx::sendCommand(string command) {
+  char c;
+  string ret = "00";
+  c = '\n';
+  sendingCmdMut->GetMutex();
+  serialport->Write(command.c_str(), command.size());
+  serialport->Write(&c, 1);
+  sendingCmdMut->ReleaseMutex();
+  return ret;
+}
+
+void HokuyoUTM30Lx::getMesure(int startStep, int endStep, int clusterCount,
+                              int interval, int scanNumber) {
+  stringstream ss;
+  string ret;
+  ss << "MD" << std::setfill('0') << std::setw(4) << startStep << std::setw(4)
+     << endStep << std::setw(2) << clusterCount << std::setw(1) << interval
+     << std::setw(2) << scanNumber;
+  ret = sendCommand(ss.str());
+#ifdef VERBOSE
+  if (ret == "00") {
+    cout << "MD: Alright !" << endl;
+  } else if (ret == "01") {
+    cout << "MD: Laser malfunction !" << endl;
+  } else if (ret == "02") {
+    cout << "MD: End Step has non-numeric value !" << endl;
+  } else if (ret == "03") {
+    cout << "MD: Cluster Count has non-numeric value !" << endl;
+  } else if (ret == "04") {
+    cout << "MD: End Step is out of range !" << endl;
+  } else if (ret == "05") {
+    cout << "MD: End Step is smaller than Starting Step !" << endl;
+  } else if (ret == "06") {
+    cout << "MD: Scan Interval has non-numeric value !" << endl;
+  } else if (ret == "07") {
+    cout << "MD: Number of Scan has non-numeric value !" << endl;
+  } else if (ret == "98") {
+    cout << "MD: Resumption of process after confirming normal HokuyoUTM30Lx "
+            "operation." << endl;
+  } else {
+    /* Concerne :
+    21~49 --- Processing stopped to verify the error.
+    50~97 --- Hardware trouble (such as laser, motor malfunctions etc.)*/
+    cout << "MD: Malfunction !" << endl;
+  }
+#endif
+}
+cvmatrix *HokuyoUTM30Lx::getDatas() { return output; }
+
+void HokuyoUTM30Lx::UseDefaultPlot(void) {
+  plot = new RangeFinderPlot(main_tab->NewRow(), "plot", "x", -100, 100, "y",
+                             -0, 100, output, -45, 225, output->Rows());
 }
 
Index: trunk/lib/FlairSensorActuator/src/HokuyoUTM30Lx.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/HokuyoUTM30Lx.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/HokuyoUTM30Lx.h	(revision 15)
@@ -21,154 +21,150 @@
 #include <vector>
 
-namespace flair
-{
-    namespace core
-    {
-        class cvmatrix;
-        class FrameworkManager;
-        class SerialPort;
-        class Mutex;
-    }
-    namespace gui
-    {
-        class Tab;
-        class TabWidget;
-        class RangeFinderPlot;
-    }
+namespace flair {
+namespace core {
+class cvmatrix;
+class FrameworkManager;
+class SerialPort;
+class Mutex;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class RangeFinderPlot;
+}
 }
 
-namespace flair
-{
-namespace sensor
-{
-    /*! \class HokuyoUTM30Lx
-    *
-    * \brief Classe intégrant le telemetre laser Hokuyo UTM 30lx
-    */
-    class HokuyoUTM30Lx : public core::Thread, public LaserRangeFinder
-    {
-        public:
+namespace flair {
+namespace sensor {
+/*! \class HokuyoUTM30Lx
+*
+* \brief Classe intégrant le telemetre laser Hokuyo UTM 30lx
+*/
+class HokuyoUTM30Lx : public core::Thread, public LaserRangeFinder {
+public:
+  /*!
+ * \brief Constructor
+ *
+ * Construct a Hokuyo UTM30-Lx.
+ *
+ * \param parent parent
+ * \param name name
+ * \param serialport serialport
+ * \param priority priority of the Thread
+ */
+  HokuyoUTM30Lx(const core::FrameworkManager *parent, std::string name,
+                core::SerialPort *serialport, uint8_t priority);
+  void getMesure(int startStep, int endStep, int clusterCount, int interval,
+                 int scanNumber = 0);
+  core::cvmatrix *getDatas(void);
 
-             /*!
-            * \brief Constructor
-            *
-            * Construct a Hokuyo UTM30-Lx.
-            *
-            * \param parent parent
-            * \param name name
-            * \param serialport serialport
-            * \param priority priority of the Thread
-            */
-            HokuyoUTM30Lx(const core::FrameworkManager* parent,std::string name,core::SerialPort *serialport,uint8_t priority);
-            void getMesure(int startStep, int endStep,int clusterCount, int interval, int scanNumber=0);
-            core::cvmatrix* getDatas(void);
+  /*!
+  * \brief Use default plot
+  *
+  */
+  void UseDefaultPlot(void);
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~HokuyoUTM30Lx();
 
-            /*!
-            * \brief Use default plot
-            *
-            */
-            void UseDefaultPlot(void);
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~HokuyoUTM30Lx();
+private:
+  core::SerialPort *serialport;
+  core::Mutex *bufRetMut;
+  core::Mutex *sendingCmdMut;
+  gui::Tab *main_tab;
+  gui::TabWidget *tab;
+  gui::RangeFinderPlot *plot;
 
-        private:
-            core::SerialPort *serialport;
-            core::Mutex* bufRetMut;
-            core::Mutex* sendingCmdMut;
-            gui::Tab* main_tab;
-            gui::TabWidget* tab;
-            gui::RangeFinderPlot* plot;
+  // matrix
+  core::cvmatrix *output;
 
-            //matrix
-            core::cvmatrix *output;
+  std::queue<std::string> bufRet;
 
-			std::queue<std::string> bufRet;
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+  /*!
+  * \brief Send a command
+  * \param command Command to send (see Hokuyo UTM 30-LX doc for more
+  * informations)
+  * \return Return code
+  */
+  std::string sendCommand(std::string command);
+  /*!
+  * \brief Start the laser
+  *
+  */
+  void startLaser(void);
+  /*!
+  * \brief Stop the laser
+  *
+  */
+  void stopLaser(void);
+  /*!
+* \brief Stop and reset the laser's settings
+*
+*/
+  void resetConfig(void);
+  /*!
+* \brief Decode incomming datas
+* \param datas Datas to decode
+* \param startStep Set the first mesured point
+* Decode mesured points from incoming datas and fill the output matrix
+*/
+  void decodeDatas(std::vector<std::string> datas, int startStep);
+  /*!
+  * \brief Explode a string into a vector
+  * \param str The string to explode
+  * \param delimiter The character separating elements
+  * \return A vector containing the elements
+  */
+  static std::vector<std::string> explode(const std::string str,
+                                          char delimiter);
+  /*!
+* \brief Calculate the checksum
+* \param code Data from which calculate
+* \param byte Data's size
+* \return A character corresponding to the code's checksum
+*/
+  static int encodeSum(const char *code, int byte);
+  /*!
+* \brief Check if a data correspond to its checksum
+* \param data Datas to check
+*/
+  static bool checkSum(std::string data);
+  /*!
+* \brief Decode datas using the 2 character encoding
+* \param data Datas to decode
+* \return Decoded datas
+*/
+  static float decode2car(const char *data);
+  /*!
+* \brief Decode datas using the 3 character encoding
+* \param data Datas to decode
+* \return Decoded datas
+*/
+  static float decode3car(const char *data);
+  /*!
+* \brief Decode datas using the 4 character encoding
+* \param data Datas to decode
+* \return Decoded datas
+*/
+  static float decode4car(const char *data);
 
-            /*!
-            * \brief Run function
-            *
-            * Reimplemented from Thread.
-            *
-            */
-            void Run(void);
-            /*!
-            * \brief Send a command
-            * \param command Command to send (see Hokuyo UTM 30-LX doc for more informations)
-            * \return Return code
-            */
-            std::string sendCommand(std::string command);
-            /*!
-            * \brief Start the laser
-            *
-            */
-            void startLaser(void);
-            /*!
-            * \brief Stop the laser
-            *
-            */
-			void stopLaser(void);
-			/*!
-            * \brief Stop and reset the laser's settings
-            *
-            */
-		    void resetConfig(void);
-		    /*!
-            * \brief Decode incomming datas
-            * \param datas Datas to decode
-            * \param startStep Set the first mesured point
-            * Decode mesured points from incoming datas and fill the output matrix
-            */
-		    void decodeDatas(std::vector<std::string> datas, int startStep);
-            /*!
-            * \brief Explode a string into a vector
-            * \param str The string to explode
-            * \param delimiter The character separating elements
-            * \return A vector containing the elements
-            */
-			static std::vector<std::string> explode(const std::string str, char delimiter);
-			/*!
-            * \brief Calculate the checksum
-            * \param code Data from which calculate
-            * \param byte Data's size
-            * \return A character corresponding to the code's checksum
-            */
-			static int encodeSum(const char* code, int byte);
-			/*!
-            * \brief Check if a data correspond to its checksum
-            * \param data Datas to check
-            */
-			static bool checkSum(std::string data);
-			/*!
-            * \brief Decode datas using the 2 character encoding
-            * \param data Datas to decode
-            * \return Decoded datas
-            */
-			static float decode2car(const char* data);
-			/*!
-            * \brief Decode datas using the 3 character encoding
-            * \param data Datas to decode
-            * \return Decoded datas
-            */
-			static float decode3car(const char* data);
-			/*!
-            * \brief Decode datas using the 4 character encoding
-            * \param data Datas to decode
-            * \return Decoded datas
-            */
-			static float decode4car(const char* data);
-
-			/*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data){};
-
-    };
+  /*!
+* \brief Update using provided datas
+*
+* Reimplemented from IODevice.
+*
+* \param data data from the parent to process
+*/
+  void UpdateFrom(const core::io_data *data){};
+};
 } // end namespace sensor
 } // end namespace framewor
Index: trunk/lib/FlairSensorActuator/src/HostEthController.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/HostEthController.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/HostEthController.cpp	(revision 15)
@@ -11,5 +11,6 @@
 //  version:    $Id: $
 //
-//  purpose:    Base class for host side remote controls that talks to target side through ethernet connection
+//  purpose:    Base class for host side remote controls that talks to target
+//  side through ethernet connection
 //
 //
@@ -37,225 +38,265 @@
 using std::string;
 
-namespace flair
-{
-namespace sensor
-{
-
-HostEthController::HostEthController(const FrameworkManager* parent,string name,string _address,int _port,uint32_t period,uint32_t _bitsPerAxis,uint8_t priority) :
-    Thread(parent,name,priority),IODevice(parent,name),tab(new Tab(parent->GetTabWidget(),name)),axisNumber(0),buttonNumber(0),targetAddress(_address),targetPort(_port),
-    bitsPerAxis(_bitsPerAxis),dataFrameBuffer(NULL),meaningfulDataAvailable(false) {
-    tabWidget=new TabWidget(tab->NewRow(),name);
-
-    const bool blocking=true;
-    controlSocket=new TcpSocket((Thread*)this,"eth controller control socket", blocking, !blocking);
-    dataSocket=new Socket((Thread*)this,"eth controller data socket",_address+":"+std::to_string(_port+1));
-    dataSender=new DataSender((Thread*)this, this, "eth controller data sender thread");
-    dataSender->SetPeriodMS(period);
-    dataSender->Start();
-
-    //test binary
-    /*
-    uint16_t testValue=0b0111011010; //0x1DA
-    char buffer[3]={(char)0b10101011, (char)0b01100101, (char)0b10110110}; // 0xAB65B6
-    writeBits(testValue,10,buffer,7); // 0b1010101 0 11101101 0 0110110 0xAAED36
-    Thread::Info("Debug: buffer after bits written=%X %X\n",buffer[0],buffer[1]);
-    */
-    connectionEstablishedMutex=new Mutex((Thread*)this);
+namespace flair {
+namespace sensor {
+
+HostEthController::HostEthController(const FrameworkManager *parent,
+                                     string name, string _address, int _port,
+                                     uint32_t period, uint32_t _bitsPerAxis,
+                                     uint8_t priority)
+    : Thread(parent, name, priority), IODevice(parent, name),
+      tab(new Tab(parent->GetTabWidget(), name)), axisNumber(0),
+      buttonNumber(0), targetAddress(_address), targetPort(_port),
+      bitsPerAxis(_bitsPerAxis), dataFrameBuffer(NULL),
+      meaningfulDataAvailable(false) {
+  tabWidget = new TabWidget(tab->NewRow(), name);
+
+  const bool blocking = true;
+  controlSocket = new TcpSocket((Thread *)this, "eth controller control socket",
+                                blocking, !blocking);
+  dataSocket = new Socket((Thread *)this, "eth controller data socket",
+                          _address + ":" + std::to_string(_port + 1));
+  dataSender =
+      new DataSender((Thread *)this, this, "eth controller data sender thread");
+  dataSender->SetPeriodMS(period);
+  dataSender->Start();
+
+  // test binary
+  /*
+  uint16_t testValue=0b0111011010; //0x1DA
+  char buffer[3]={(char)0b10101011, (char)0b01100101, (char)0b10110110}; //
+  0xAB65B6
+  writeBits(testValue,10,buffer,7); // 0b1010101 0 11101101 0 0110110 0xAAED36
+  Thread::Info("Debug: buffer after bits written=%X %X\n",buffer[0],buffer[1]);
+  */
+  connectionEstablishedMutex = new Mutex((Thread *)this);
 }
 
 HostEthController::~HostEthController() {
+  SafeStop();
+  Join();
+
+  if (!getFrameworkManager()->ConnectionLost())
+    delete tab;
+}
+
+void HostEthController::DrawUserInterface() {
+  Tab *plotTab = new Tab(tabWidget, "Measures");
+  axisPlot = new DataPlot1D *[axisNumber];
+  for (unsigned int i = 0; i < axisNumber; i++) {
+    // Start a new row or add up to the current row? We try to keep a 4/3 ratio
+    unsigned int columns = sqrt(4.0 * axisNumber / 3.0);
+    LayoutPosition *position;
+    if (i % columns == 0) {
+      position = plotTab->NewRow();
+    } else {
+      position = plotTab->LastRowLastCol();
+    }
+    axisPlot[i] = new DataPlot1D(position, axis->Name(i, 0),
+                                 -(1 << (nativeBitsPerAxis - 1)) * 1.2,
+                                 (1 << (nativeBitsPerAxis - 1)) * 1.5);
+    axisPlot[i]->AddCurve(axis->Element(i));
+  }
+  // we don't plot the button state for now
+}
+
+string HostEthController::GetAxisDescription(unsigned int axis) {
+  return string("axis") + std::to_string(axis);
+}
+
+string HostEthController::GetButtonDescription(unsigned int button) {
+  return string("button") + std::to_string(button);
+}
+
+bool HostEthController::ControllerInitialization() {
+
+  buttonOffset = (axisNumber * bitsPerAxis) / 8;
+  if ((axisNumber * bitsPerAxis) % 8 != 0)
+    buttonOffset++;
+  dataFrameSize = buttonOffset + (buttonNumber / 8) * sizeof(uint8_t);
+  if ((buttonNumber % 8) != 0)
+    dataFrameSize++;
+  dataFrameBuffer = new char[dataFrameSize];
+  return true;
+}
+
+void HostEthController::SendControllerInfo() {
+  // send axis info
+  controlSocket->WriteUInt32((uint32_t)axisNumber, 0);
+  controlSocket->WriteUInt32(bitsPerAxis, 0);
+  for (unsigned int i = 0; i < axisNumber; i++) {
+    // Thread::Info("Debug: sending axis name for axis %d = %s (takes up %d
+    // bytes)\n",i,GetAxisDescription(i).c_str(),GetAxisDescription(i).length());
+    int stringLength = GetAxisDescription(i).length();
+    controlSocket->WriteUInt32((uint32_t)stringLength, 0);
+    controlSocket->SendMessage(GetAxisDescription(i).c_str(), stringLength, 0);
+  }
+
+  // send button info
+  controlSocket->WriteUInt32((uint32_t)buttonNumber, 0);
+  for (unsigned int i = 0; i < buttonNumber; i++) {
+    int stringLength = GetButtonDescription(i).length();
+    controlSocket->WriteUInt32((uint32_t)stringLength, 0);
+    controlSocket->SendMessage(GetButtonDescription(i).c_str(), stringLength,
+                               0);
+  }
+}
+
+bool HostEthController::ConnectedWithTarget() {
+  char message[1024];
+  ssize_t sent, received;
+  static bool connectionEstablished = false;
+
+  connectionEstablishedMutex->GetMutex();
+  if (!connectionEstablished &&
+      controlSocket->Connect(targetPort, targetAddress, 10)) {
+    Thread::Info("Connected to %s:%d\n", targetAddress.c_str(), targetPort);
+    SendControllerInfo();
+    connectionEstablished = true;
+  }
+  connectionEstablishedMutex->ReleaseMutex();
+  return connectionEstablished;
+}
+
+void HostEthController::Run() {
+  static int divider = 0;
+  Message *msgControllerAction = new Message(1024);
+  if (getFrameworkManager()->ErrorOccured() || !ControllerInitialization()) {
     SafeStop();
-    Join();
-
-    if(!getFrameworkManager()->ConnectionLost()) delete tab;
-}
-
-void HostEthController::DrawUserInterface() {
-    Tab* plotTab=new Tab(tabWidget,"Measures");
-    axisPlot=new DataPlot1D *[axisNumber];
-    for (unsigned int i=0; i<axisNumber;i++) {
-        //Start a new row or add up to the current row? We try to keep a 4/3 ratio
-        unsigned int columns=sqrt(4.0*axisNumber/3.0);
-        LayoutPosition *position;
-        if (i%columns==0) {
-            position=plotTab->NewRow();
-        } else {
-            position=plotTab->LastRowLastCol();
+    Thread::Err("Une erreur a eu lieu, on ne lance pas la boucle\n");
+  }
+
+  if (buttonNumber % 8 != 0) {
+    SafeStop();
+    Thread::Err("Button number is not multiple of 8\n");
+  }
+
+  while (!ToBeStopped()) {
+    // Thread::Info("Debug: entering acquisition loop\n");
+    if (getFrameworkManager()->ConnectionLost() == true)
+      SafeStop();
+
+    if (IsDataFrameReady()) { // wait for next data frame
+      meaningfulDataAvailable = true;
+      GetAxisData();
+      GetButtonData();
+
+      if (ConnectedWithTarget()) {
+        // read for commands from the target (remote control state change
+        // requests such as rumble or led on/off)
+        ssize_t bytesReceived =
+            controlSocket->RecvMessage((char *)msgControllerAction->buffer,
+                                       msgControllerAction->bufferSize);
+        if (bytesReceived > 0) {
+          // if the message is a cnx exit request we manage it here, if not it
+          // will be managed by the derived class
+          ControllerAction action;
+          memcpy(&action, msgControllerAction->buffer,
+                 sizeof(ControllerAction));
+          if (action == ControllerAction::Exit) {
+            // Thread::Info("Debug: exit request received from server\n");
+            SafeStop();
+          }
+          ProcessMessage(msgControllerAction);
         }
-        axisPlot[i]=new DataPlot1D(position,axis->Name(i,0),-(1<<(nativeBitsPerAxis-1))*1.2,(1<<(nativeBitsPerAxis-1))*1.5);
-        axisPlot[i]->AddCurve(axis->Element(i));
-    }
-    //we don't plot the button state for now
-}
-
-string HostEthController::GetAxisDescription(unsigned int axis) {
-    return string("axis")+std::to_string(axis);
-}
-
-string HostEthController::GetButtonDescription(unsigned int button) {
-    return string("button")+std::to_string(button);
-}
-
-bool HostEthController::ControllerInitialization() {
-
-    buttonOffset=(axisNumber*bitsPerAxis)/8;
-    if ((axisNumber*bitsPerAxis)%8!=0) buttonOffset++;
-    dataFrameSize=buttonOffset+(buttonNumber/8)*sizeof(uint8_t);
-    if ((buttonNumber%8)!=0) dataFrameSize++;
-    dataFrameBuffer=new char[dataFrameSize];
-    return true;
-}
-
-void HostEthController::SendControllerInfo() {
-    //send axis info
-    controlSocket->WriteUInt32((uint32_t)axisNumber,0);
-    controlSocket->WriteUInt32(bitsPerAxis,0);
-    for (unsigned int i=0; i<axisNumber; i++) {
-        //Thread::Info("Debug: sending axis name for axis %d = %s (takes up %d bytes)\n",i,GetAxisDescription(i).c_str(),GetAxisDescription(i).length());
-        int stringLength=GetAxisDescription(i).length();
-        controlSocket->WriteUInt32((uint32_t)stringLength,0);
-        controlSocket->SendMessage(GetAxisDescription(i).c_str(), stringLength,0);
-    }
-
-    //send button info
-    controlSocket->WriteUInt32((uint32_t)buttonNumber,0);
-    for (unsigned int i=0; i<buttonNumber; i++) {
-        int stringLength=GetButtonDescription(i).length();
-        controlSocket->WriteUInt32((uint32_t)stringLength,0);
-        controlSocket->SendMessage(GetButtonDescription(i).c_str(), stringLength,0);
-    }
-}
-
-bool HostEthController::ConnectedWithTarget() {
-    char message[1024];
-    ssize_t sent,received;
-    static bool connectionEstablished=false;
-
-    connectionEstablishedMutex->GetMutex();
-    if (!connectionEstablished && controlSocket->Connect(targetPort,targetAddress,10)) {
-        Thread::Info("Connected to %s:%d\n", targetAddress.c_str(), targetPort);
-        SendControllerInfo();
-        connectionEstablished=true;
-    }
-    connectionEstablishedMutex->ReleaseMutex();
-    return connectionEstablished;
-}
-
-void HostEthController::Run() {
-    static int divider=0;
-    Message *msgControllerAction=new Message(1024);
-    if(getFrameworkManager()->ErrorOccured()||!ControllerInitialization()) {
-        SafeStop();
-        Thread::Err("Une erreur a eu lieu, on ne lance pas la boucle\n");
-    }
-
-    if(buttonNumber%8!=0) {
-        SafeStop();
-        Thread::Err("Button number is not multiple of 8\n");
-    }
-
-    while(!ToBeStopped()) {
-        //Thread::Info("Debug: entering acquisition loop\n");
-        if(getFrameworkManager()->ConnectionLost()==true) SafeStop();
-
-        if (IsDataFrameReady()) {  //wait for next data frame
-            meaningfulDataAvailable=true;
-            GetAxisData();
-            GetButtonData();
-
-            if (ConnectedWithTarget()) {
-                //read for commands from the target (remote control state change requests such as rumble or led on/off)
-                ssize_t bytesReceived=controlSocket->RecvMessage((char*)msgControllerAction->buffer,msgControllerAction->bufferSize);
-                if(bytesReceived>0) {
-                    //if the message is a cnx exit request we manage it here, if not it will be managed by the derived class
-                    ControllerAction action;
-                    memcpy(&action,msgControllerAction->buffer,sizeof(ControllerAction));
-                    if (action==ControllerAction::Exit) {
-                        //Thread::Info("Debug: exit request received from server\n");
-                        SafeStop();
-                    }
-                    ProcessMessage(msgControllerAction);
-                }
-            }
-        } else {//try to connect even if host is not sending anything
-            ConnectedWithTarget();
-        }
-        //Thread::Info("Debug: exiting acquisition loop\n");
-    }
-}
-
-bool HostEthController::writeBits(uint16_t value,uint8_t valueSizeInBits,char *buffer,uint8_t offsetInBits) {
-    if (valueSizeInBits>16) return false;
-    uint8_t remainingBitsToWrite=valueSizeInBits;
-    //skip first bytes
-    buffer+=offsetInBits/8;
-    offsetInBits-=(offsetInBits/8)*8;
-    while (remainingBitsToWrite>0) {
-        uint8_t remainingBitsInByteBeforeWrite=8-offsetInBits;
-        uint8_t bitsToWrite=remainingBitsToWrite<remainingBitsInByteBeforeWrite?remainingBitsToWrite:remainingBitsInByteBeforeWrite;
-        uint8_t remainingBitsInByteAfterWrite=remainingBitsInByteBeforeWrite-bitsToWrite;
-        //write in the current byte
-        uint8_t byteMask=((1<<bitsToWrite)-1)<<remainingBitsInByteAfterWrite;
-        (*buffer)&=~byteMask;
-        uint16_t valueMask=(1<<remainingBitsToWrite)-1;
-        (*buffer)|=((value&valueMask)>>(remainingBitsToWrite-bitsToWrite))<<remainingBitsInByteAfterWrite;
-        //update state
-        remainingBitsToWrite-=bitsToWrite;
-        offsetInBits=(offsetInBits+bitsToWrite)%8;
-        buffer++;
-    }
-    return true;
+      }
+    } else { // try to connect even if host is not sending anything
+      ConnectedWithTarget();
+    }
+    // Thread::Info("Debug: exiting acquisition loop\n");
+  }
+}
+
+bool HostEthController::writeBits(uint16_t value, uint8_t valueSizeInBits,
+                                  char *buffer, uint8_t offsetInBits) {
+  if (valueSizeInBits > 16)
+    return false;
+  uint8_t remainingBitsToWrite = valueSizeInBits;
+  // skip first bytes
+  buffer += offsetInBits / 8;
+  offsetInBits -= (offsetInBits / 8) * 8;
+  while (remainingBitsToWrite > 0) {
+    uint8_t remainingBitsInByteBeforeWrite = 8 - offsetInBits;
+    uint8_t bitsToWrite = remainingBitsToWrite < remainingBitsInByteBeforeWrite
+                              ? remainingBitsToWrite
+                              : remainingBitsInByteBeforeWrite;
+    uint8_t remainingBitsInByteAfterWrite =
+        remainingBitsInByteBeforeWrite - bitsToWrite;
+    // write in the current byte
+    uint8_t byteMask = ((1 << bitsToWrite) - 1)
+                       << remainingBitsInByteAfterWrite;
+    (*buffer) &= ~byteMask;
+    uint16_t valueMask = (1 << remainingBitsToWrite) - 1;
+    (*buffer) |= ((value & valueMask) >> (remainingBitsToWrite - bitsToWrite))
+                 << remainingBitsInByteAfterWrite;
+    // update state
+    remainingBitsToWrite -= bitsToWrite;
+    offsetInBits = (offsetInBits + bitsToWrite) % 8;
+    buffer++;
+  }
+  return true;
 }
 
 void HostEthController::BuildDataFrame() {
-    //int16_t testValue[4]={-120,-43,27,98}; //0x 88 d5 1b 62
-    for (unsigned int i=0;i<axisNumber;i++) {
-        //We shift value to always be positive (so that division/multiplication by power of 2 can easily be done with bit shifts)
-        uint16_t shiftedNativeAxisValue=axis->Value(i,0)+(1<<(nativeBitsPerAxis-1));
-        //int16_t nativeAxisValue=testValue[i];
-        uint16_t scaledAxisValue;
-        if (bitsPerAxis>nativeBitsPerAxis) {
-            scaledAxisValue=shiftedNativeAxisValue<<(bitsPerAxis-nativeBitsPerAxis);
-        } else {
-            scaledAxisValue=shiftedNativeAxisValue>>(nativeBitsPerAxis-bitsPerAxis);
-        }
-        //Thread::Info("Debug: shiftedNativeAxisValue=%#x, scaled axis value=%#x\n",shiftedNativeAxisValue,scaledAxisValue);
-        unsigned int offsetInBits=i*bitsPerAxis;
-        writeBits(scaledAxisValue,bitsPerAxis,dataFrameBuffer,offsetInBits);
-    }
-    //Thread::Info("Buffer après: %x %x %x\n", dataFrameBuffer[0], dataFrameBuffer[1], dataFrameBuffer[2]);
-
-    int currentButton=0;
-    uint8_t buttonArray[buttonNumber/8];
-    for (unsigned int i=0;i<buttonNumber/8;i++) {
-        buttonArray[i]=0;
-        for(unsigned int j=0;j<8;j++) {
-            bool buttonValue=button->Value(currentButton,0);
-            if(buttonValue) buttonArray[i]+=1<<j;
-            currentButton++;
-        }
-
-        dataSocket->HostToNetwork((char *)&buttonArray[i],sizeof(uint8_t));
-        memcpy(dataFrameBuffer+buttonOffset+i*sizeof(uint8_t),&buttonArray[i],sizeof(uint8_t));
-    }
-}
-
-HostEthController::DataSender::DataSender(Object *parent,HostEthController* _hostEthController,string name,uint8_t priority):Thread(parent,name,priority),hostEthController(_hostEthController) {
-
-}
+  // int16_t testValue[4]={-120,-43,27,98}; //0x 88 d5 1b 62
+  for (unsigned int i = 0; i < axisNumber; i++) {
+    // We shift value to always be positive (so that division/multiplication by
+    // power of 2 can easily be done with bit shifts)
+    uint16_t shiftedNativeAxisValue =
+        axis->Value(i, 0) + (1 << (nativeBitsPerAxis - 1));
+    // int16_t nativeAxisValue=testValue[i];
+    uint16_t scaledAxisValue;
+    if (bitsPerAxis > nativeBitsPerAxis) {
+      scaledAxisValue = shiftedNativeAxisValue
+                        << (bitsPerAxis - nativeBitsPerAxis);
+    } else {
+      scaledAxisValue =
+          shiftedNativeAxisValue >> (nativeBitsPerAxis - bitsPerAxis);
+    }
+    // Thread::Info("Debug: shiftedNativeAxisValue=%#x, scaled axis
+    // value=%#x\n",shiftedNativeAxisValue,scaledAxisValue);
+    unsigned int offsetInBits = i * bitsPerAxis;
+    writeBits(scaledAxisValue, bitsPerAxis, dataFrameBuffer, offsetInBits);
+  }
+  // Thread::Info("Buffer après: %x %x %x\n", dataFrameBuffer[0],
+  // dataFrameBuffer[1], dataFrameBuffer[2]);
+
+  int currentButton = 0;
+  uint8_t buttonArray[buttonNumber / 8];
+  for (unsigned int i = 0; i < buttonNumber / 8; i++) {
+    buttonArray[i] = 0;
+    for (unsigned int j = 0; j < 8; j++) {
+      bool buttonValue = button->Value(currentButton, 0);
+      if (buttonValue)
+        buttonArray[i] += 1 << j;
+      currentButton++;
+    }
+
+    dataSocket->HostToNetwork((char *)&buttonArray[i], sizeof(uint8_t));
+    memcpy(dataFrameBuffer + buttonOffset + i * sizeof(uint8_t),
+           &buttonArray[i], sizeof(uint8_t));
+  }
+}
+
+HostEthController::DataSender::DataSender(Object *parent,
+                                          HostEthController *_hostEthController,
+                                          string name, uint8_t priority)
+    : Thread(parent, name, priority), hostEthController(_hostEthController) {}
 
 void HostEthController::DataSender::Run() {
-    if(getFrameworkManager()->ErrorOccured()==true) {
-        SafeStop();
-    }
-
-    while(!ToBeStopped()) {
-        WaitPeriod();
-        if (hostEthController->meaningfulDataAvailable && hostEthController->ConnectedWithTarget()) {
-            //send the data
-            hostEthController->BuildDataFrame();
-            hostEthController->dataSocket->SendMessage(hostEthController->dataFrameBuffer,hostEthController->dataFrameSize);
-        }
-    }
+  if (getFrameworkManager()->ErrorOccured() == true) {
+    SafeStop();
+  }
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+    if (hostEthController->meaningfulDataAvailable &&
+        hostEthController->ConnectedWithTarget()) {
+      // send the data
+      hostEthController->BuildDataFrame();
+      hostEthController->dataSocket->SendMessage(
+          hostEthController->dataFrameBuffer, hostEthController->dataFrameSize);
+    }
+  }
 }
 
Index: trunk/lib/FlairSensorActuator/src/HostEthController.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/HostEthController.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/HostEthController.h	(revision 15)
@@ -11,5 +11,6 @@
 //  version:    $Id: $
 //
-//  purpose:    Base class for host side remote controls that talks to target side through ethernet connection
+//  purpose:    Base class for host side remote controls that talks to target
+//  side through ethernet connection
 //
 //
@@ -24,85 +25,97 @@
 
 namespace flair {
-    namespace core {
-        class FrameworkManager;
-        class cvmatrix;
-        class TcpSocket;
-        class Socket;
-        class Mutex;
-    }
-    namespace gui {
-        class Tab;
-        class TabWidget;
-        class DataPlot1D;
-    }
+namespace core {
+class FrameworkManager;
+class cvmatrix;
+class TcpSocket;
+class Socket;
+class Mutex;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class DataPlot1D;
+}
 }
 
-namespace flair { namespace sensor {
-    enum class ControllerAction;
+namespace flair {
+namespace sensor {
+enum class ControllerAction;
 
-    /*! \class HostEthController
-    *
-    * \brief Base Class for host side remote controls that talks to target side through ethernet connection
-    *
-    * There are 2 communication channels:
-    *   - 1 connection with the ground station to display the values. Output for analog sticks is normalized in the range [-1, 1] (float values)
-    *   - 1 connection with the target to send the controller values (and receive controller state modification requests)
-    */
-    class HostEthController : public core::Thread, public core::IODevice {
-    public:
-        HostEthController(const core::FrameworkManager* parent,std::string name,std::string address,int port,uint32_t period=10,uint32_t _bitsPerAxis=7,uint8_t priority=0);
-        ~HostEthController();
-        void DrawUserInterface();
-    protected:
-        std::string controllerName;
-        core::TcpSocket *controlSocket; //connection to the target
-        core::Socket *dataSocket;
-        std::string targetAddress;
-        int targetPort;
-        gui::Tab *tab;
-        gui::TabWidget *tabWidget;
-        virtual bool IsDataFrameReady() { return true;};
-        virtual void CompleteDataFrameGrab() {};
-//        int8_t *datas;
-//        uint8_t dataSize;
-        char *dataFrameBuffer;
-        size_t dataFrameSize;
-        virtual void ProcessMessage(core::Message *controllerAction) {};
+/*! \class HostEthController
+*
+* \brief Base Class for host side remote controls that talks to target side
+*through ethernet connection
+*
+* There are 2 communication channels:
+*   - 1 connection with the ground station to display the values. Output for
+*analog sticks is normalized in the range [-1, 1] (float values)
+*   - 1 connection with the target to send the controller values (and receive
+*controller state modification requests)
+*/
+class HostEthController : public core::Thread, public core::IODevice {
+public:
+  HostEthController(const core::FrameworkManager *parent, std::string name,
+                    std::string address, int port, uint32_t period = 10,
+                    uint32_t _bitsPerAxis = 7, uint8_t priority = 0);
+  ~HostEthController();
+  void DrawUserInterface();
 
-        virtual std::string GetAxisDescription(unsigned int axis);
-        virtual void GetAxisData()=0; //responsible for getting the axis data from the hardware
-        unsigned int axisNumber;
-        core::cvmatrix* axis;
-        gui::DataPlot1D **axisPlot;
-        uint32_t bitsPerAxis;
-        uint32_t nativeBitsPerAxis;
+protected:
+  std::string controllerName;
+  core::TcpSocket *controlSocket; // connection to the target
+  core::Socket *dataSocket;
+  std::string targetAddress;
+  int targetPort;
+  gui::Tab *tab;
+  gui::TabWidget *tabWidget;
+  virtual bool IsDataFrameReady() { return true; };
+  virtual void CompleteDataFrameGrab(){};
+  //        int8_t *datas;
+  //        uint8_t dataSize;
+  char *dataFrameBuffer;
+  size_t dataFrameSize;
+  virtual void ProcessMessage(core::Message *controllerAction){};
 
-        virtual std::string GetButtonDescription(unsigned int button);
-        virtual void GetButtonData()=0; //responsible for getting the button data from the hardware
-        unsigned int buttonNumber;
-        core::cvmatrix* button;
-        uint8_t buttonOffset;
-        bool meaningfulDataAvailable;
+  virtual std::string GetAxisDescription(unsigned int axis);
+  virtual void
+  GetAxisData() = 0; // responsible for getting the axis data from the hardware
+  unsigned int axisNumber;
+  core::cvmatrix *axis;
+  gui::DataPlot1D **axisPlot;
+  uint32_t bitsPerAxis;
+  uint32_t nativeBitsPerAxis;
 
-    private:
-        class DataSender : public core::Thread {
-        public:
-            DataSender(Object* parent,HostEthController* hostEthController,std::string name,uint8_t priority=0);
-            void Run();
-        private:
-            HostEthController* hostEthController;
-        };
-        DataSender *dataSender;
+  virtual std::string GetButtonDescription(unsigned int button);
+  virtual void GetButtonData() = 0; // responsible for getting the button data
+                                    // from the hardware
+  unsigned int buttonNumber;
+  core::cvmatrix *button;
+  uint8_t buttonOffset;
+  bool meaningfulDataAvailable;
 
-        bool ControllerInitialization();
-        bool ConnectedWithTarget();
-        void SendControllerInfo();
-        void Run();
-        void BuildDataFrame();
-        bool writeBits(uint16_t value,uint8_t valueSizeInBits,char *buffer,uint8_t offsetInBits);
-        core::Mutex *connectionEstablishedMutex;
-    };
+private:
+  class DataSender : public core::Thread {
+  public:
+    DataSender(Object *parent, HostEthController *hostEthController,
+               std::string name, uint8_t priority = 0);
+    void Run();
 
-}}
+  private:
+    HostEthController *hostEthController;
+  };
+  DataSender *dataSender;
+
+  bool ControllerInitialization();
+  bool ConnectedWithTarget();
+  void SendControllerInfo();
+  void Run();
+  void BuildDataFrame();
+  bool writeBits(uint16_t value, uint8_t valueSizeInBits, char *buffer,
+                 uint8_t offsetInBits);
+  core::Mutex *connectionEstablishedMutex;
+};
+}
+}
 
 #endif // HOSTETHCONTROLLER_H
Index: trunk/lib/FlairSensorActuator/src/Imu.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Imu.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Imu.cpp	(revision 15)
@@ -30,104 +30,100 @@
 using namespace flair::gui;
 
-namespace flair { namespace sensor {
+namespace flair {
+namespace sensor {
 
-Imu::Imu(const FrameworkManager* parent,string name) : IODevice(parent,name) {
-    imuData=new ImuData(this);
+Imu::Imu(const FrameworkManager *parent, string name) : IODevice(parent, name) {
+  imuData = new ImuData(this);
 
-    //station sol
-    mainTab=new Tab(parent->GetTabWidget(),name);
-    tab=new TabWidget(mainTab->NewRow(),name);
-    sensorTab=new Tab(tab,"Reglages");
-	setupGroupbox=new GroupBox(sensorTab->NewRow(),name);
-	rotation=new OneAxisRotation(sensorTab->NewRow(),"post rotation");
+  // station sol
+  mainTab = new Tab(parent->GetTabWidget(), name);
+  tab = new TabWidget(mainTab->NewRow(), name);
+  sensorTab = new Tab(tab, "Reglages");
+  setupGroupbox = new GroupBox(sensorTab->NewRow(), name);
+  rotation = new OneAxisRotation(sensorTab->NewRow(), "post rotation");
 }
 
-Imu::Imu(const IODevice* parent,std::string name) : IODevice(parent,name) {
-    imuData=new ImuData(this);
-    mainTab=NULL;
-    tab=NULL;
-    sensorTab=NULL;
-	setupGroupbox=NULL;
-	rotation=NULL;
+Imu::Imu(const IODevice *parent, std::string name) : IODevice(parent, name) {
+  imuData = new ImuData(this);
+  mainTab = NULL;
+  tab = NULL;
+  sensorTab = NULL;
+  setupGroupbox = NULL;
+  rotation = NULL;
 }
 
 Imu::~Imu() {
-    if(mainTab!=NULL) delete mainTab;
+  if (mainTab != NULL)
+    delete mainTab;
 }
 
-void Imu::GetDatas(ImuData **outImuData) const {
-    *outImuData=imuData;
-}
+void Imu::GetDatas(ImuData **outImuData) const { *outImuData = imuData; }
 void Imu::UpdateImu() {
-    if(rotation==NULL) {
-        Err("not applicable for simulation part.\n");
-        return;
-    }
-    Vector3D rawAcc,rawMag,rawGyr;
-    imuData->GetRawAccMagAndGyr(rawAcc,rawMag,rawGyr);
-    rotation->ComputeRotation(rawAcc);
-    rotation->ComputeRotation(rawGyr);
-    rotation->ComputeRotation(rawMag);
-    imuData->SetRawAccMagAndGyr(rawAcc,rawMag,rawGyr);
+  if (rotation == NULL) {
+    Err("not applicable for simulation part.\n");
+    return;
+  }
+  Vector3D rawAcc, rawMag, rawGyr;
+  imuData->GetRawAccMagAndGyr(rawAcc, rawMag, rawGyr);
+  rotation->ComputeRotation(rawAcc);
+  rotation->ComputeRotation(rawGyr);
+  rotation->ComputeRotation(rawMag);
+  imuData->SetRawAccMagAndGyr(rawAcc, rawMag, rawGyr);
 }
 
-GroupBox* Imu::GetGroupBox(void) const {
-    return setupGroupbox;
-}
+GroupBox *Imu::GetGroupBox(void) const { return setupGroupbox; }
 
-Layout* Imu::GetLayout(void) const {
-    return sensorTab;
-}
+Layout *Imu::GetLayout(void) const { return sensorTab; }
 
 void Imu::LockUserInterface(void) const {
-    if(sensorTab==NULL) {
-        Err("not applicable for simulation part.\n");
-        return;
-    }
-    sensorTab->setEnabled(false);
+  if (sensorTab == NULL) {
+    Err("not applicable for simulation part.\n");
+    return;
+  }
+  sensorTab->setEnabled(false);
 }
 
 void Imu::UnlockUserInterface(void) const {
-    if(sensorTab==NULL) {
-        Err("not applicable for simulation part.\n");
-        return;
-    }
-    sensorTab->setEnabled(true);
+  if (sensorTab == NULL) {
+    Err("not applicable for simulation part.\n");
+    return;
+  }
+  sensorTab->setEnabled(true);
 }
 
 void Imu::UseDefaultPlot(void) {
-    if(tab==NULL) {
-        Err("not applicable for simulation part.\n");
-        return;
-    }
+  if (tab == NULL) {
+    Err("not applicable for simulation part.\n");
+    return;
+  }
 
-    plotTab=new Tab(tab,"IMU");
-    axPlot=new DataPlot1D(plotTab->NewRow(),"acc_x",-10,10);
-    axPlot->AddCurve(imuData->Element(ImuData::RawAx));
-    ayPlot=new DataPlot1D(plotTab->LastRowLastCol(),"acc_y",-10,10);
-    ayPlot->AddCurve(imuData->Element(ImuData::RawAy));
-    azPlot=new DataPlot1D(plotTab->LastRowLastCol(),"acc_z",-10,10);
-    azPlot->AddCurve(imuData->Element(ImuData::RawAz));
+  plotTab = new Tab(tab, "IMU");
+  axPlot = new DataPlot1D(plotTab->NewRow(), "acc_x", -10, 10);
+  axPlot->AddCurve(imuData->Element(ImuData::RawAx));
+  ayPlot = new DataPlot1D(plotTab->LastRowLastCol(), "acc_y", -10, 10);
+  ayPlot->AddCurve(imuData->Element(ImuData::RawAy));
+  azPlot = new DataPlot1D(plotTab->LastRowLastCol(), "acc_z", -10, 10);
+  azPlot->AddCurve(imuData->Element(ImuData::RawAz));
 
-    if(plotTab==NULL) plotTab=new Tab(tab,"IMU");
-    gxPlot=new DataPlot1D(plotTab->NewRow(),"gyr_x",-500,500);
-    gxPlot->AddCurve(imuData->Element(ImuData::RawGxDeg));
-    gyPlot=new DataPlot1D(plotTab->LastRowLastCol(),"gyr_y",-500,500);
-    gyPlot->AddCurve(imuData->Element(ImuData::RawGyDeg));
-    gzPlot=new DataPlot1D(plotTab->LastRowLastCol(),"gyr_z",-500,500);
-    gzPlot->AddCurve(imuData->Element(ImuData::RawGzDeg));
+  if (plotTab == NULL)
+    plotTab = new Tab(tab, "IMU");
+  gxPlot = new DataPlot1D(plotTab->NewRow(), "gyr_x", -500, 500);
+  gxPlot->AddCurve(imuData->Element(ImuData::RawGxDeg));
+  gyPlot = new DataPlot1D(plotTab->LastRowLastCol(), "gyr_y", -500, 500);
+  gyPlot->AddCurve(imuData->Element(ImuData::RawGyDeg));
+  gzPlot = new DataPlot1D(plotTab->LastRowLastCol(), "gyr_z", -500, 500);
+  gzPlot->AddCurve(imuData->Element(ImuData::RawGzDeg));
 
-    if(plotTab==NULL)  plotTab=new Tab(tab,"IMU");
-    mxPlot=new DataPlot1D(plotTab->NewRow(),"mag_x",-500,500);
-    mxPlot->AddCurve(imuData->Element(ImuData::RawMx));
-    myPlot=new DataPlot1D(plotTab->LastRowLastCol(),"mag_y",-500,500);
-    myPlot->AddCurve(imuData->Element(ImuData::RawMy));
-    mzPlot=new DataPlot1D(plotTab->LastRowLastCol(),"mag_z",-500,500);
-    mzPlot->AddCurve(imuData->Element(ImuData::RawMz));
+  if (plotTab == NULL)
+    plotTab = new Tab(tab, "IMU");
+  mxPlot = new DataPlot1D(plotTab->NewRow(), "mag_x", -500, 500);
+  mxPlot->AddCurve(imuData->Element(ImuData::RawMx));
+  myPlot = new DataPlot1D(plotTab->LastRowLastCol(), "mag_y", -500, 500);
+  myPlot->AddCurve(imuData->Element(ImuData::RawMy));
+  mzPlot = new DataPlot1D(plotTab->LastRowLastCol(), "mag_z", -500, 500);
+  mzPlot->AddCurve(imuData->Element(ImuData::RawMz));
 }
 
-Tab* Imu::GetPlotTab(void) const {
-    return plotTab;
-}
+Tab *Imu::GetPlotTab(void) const { return plotTab; }
 
 } // end namespace sensor
Index: trunk/lib/FlairSensorActuator/src/Imu.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/Imu.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Imu.h	(revision 15)
@@ -17,126 +17,127 @@
 
 namespace flair {
-    namespace core {
-        class ImuData;
-        class OneAxisRotation;
-    }
-    namespace gui {
-        class Tab;
-        class TabWidget;
-        class GroupBox;
-        class Layout;
-        class DataPlot1D;
-    }
+namespace core {
+class ImuData;
+class OneAxisRotation;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class GroupBox;
+class Layout;
+class DataPlot1D;
+}
 }
 
 class Ahrs_impl;
 
-namespace flair { namespace sensor {
-    /*! \class Imu
-    *
-    * \brief Base class for Imu
-    *
-    * Use this class to define a custom Imu.
-    *
-    */
-    class Imu : public core::IODevice {
-        friend class ::Ahrs_impl;
+namespace flair {
+namespace sensor {
+/*! \class Imu
+*
+* \brief Base class for Imu
+*
+* Use this class to define a custom Imu.
+*
+*/
+class Imu : public core::IODevice {
+  friend class ::Ahrs_impl;
 
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct an Imu.
-            *
-            * \param parent parent
-            * \param name name
-            */
-            Imu(const core::FrameworkManager *parent,std::string name);
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct an Imu.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  Imu(const core::FrameworkManager *parent, std::string name);
 
-            /*!
-            * \brief Constructor
-            *
-            * Construct an Imu. \n
-            * This contructor must only be called for a simulated device.
-            *
-            * \param parent parent
-            * \param name name
-            */
-            Imu(const core::IODevice *parent,std::string name);
+  /*!
+  * \brief Constructor
+  *
+  * Construct an Imu. \n
+  * This contructor must only be called for a simulated device.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  Imu(const core::IODevice *parent, std::string name);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~Imu();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Imu();
 
-            /*!
-            * \brief Setup Layout
-            *
-            * \return setup Layout
-            */
-            gui::Layout *GetLayout(void) const;
+  /*!
+  * \brief Setup Layout
+  *
+  * \return setup Layout
+  */
+  gui::Layout *GetLayout(void) const;
 
-            /*!
-            * \brief Lock user interface
-            *
-            */
-            void LockUserInterface(void) const;
+  /*!
+  * \brief Lock user interface
+  *
+  */
+  void LockUserInterface(void) const;
 
-            /*!
-            * \brief Unlock user interface
-            *
-            */
-            void UnlockUserInterface(void) const;
+  /*!
+  * \brief Unlock user interface
+  *
+  */
+  void UnlockUserInterface(void) const;
 
-            /*!
-            * \brief Use default plot
-            *
-            */
-            void UseDefaultPlot(void);
+  /*!
+  * \brief Use default plot
+  *
+  */
+  void UseDefaultPlot(void);
 
-            /*!
-            * \brief Plot tab
-            *
-            * \return plot Tab
-            */
-            gui::Tab *GetPlotTab(void) const;
+  /*!
+  * \brief Plot tab
+  *
+  * \return plot Tab
+  */
+  gui::Tab *GetPlotTab(void) const;
 
-        protected:
-            /*!
-            * \brief Setup GroupBox
-            *
-            * \return setup GroupBox
-            */
-            gui::GroupBox *GetGroupBox(void) const;
+protected:
+  /*!
+  * \brief Setup GroupBox
+  *
+  * \return setup GroupBox
+  */
+  gui::GroupBox *GetGroupBox(void) const;
 
-            /*!
-            * \brief UpdateImu
-            *
-            * The reimplemented class must call this function as soon as IMU datas are available. \n
-            * It handles the data rotation if it was defined.
-            *
-            */
-            void UpdateImu();
+  /*!
+  * \brief UpdateImu
+  *
+  * The reimplemented class must call this function as soon as IMU datas are
+  *available. \n
+  * It handles the data rotation if it was defined.
+  *
+  */
+  void UpdateImu();
 
-            /*!
-            * \brief Get imu datas
-            *
-            * \param imuData imu datas
-            */
-            void GetDatas(core::ImuData **imuData) const;
+  /*!
+  * \brief Get imu datas
+  *
+  * \param imuData imu datas
+  */
+  void GetDatas(core::ImuData **imuData) const;
 
+private:
+  gui::Tab *mainTab, *sensorTab, *plotTab;
+  gui::TabWidget *tab;
+  gui::GroupBox *setupGroupbox;
+  core::OneAxisRotation *rotation;
+  core::ImuData *imuData;
 
-        private:
-            gui::Tab *mainTab,*sensorTab,*plotTab;
-            gui::TabWidget* tab;
-            gui::GroupBox *setupGroupbox;
-            core::OneAxisRotation* rotation;
-            core::ImuData *imuData;
-
-            gui::DataPlot1D *axPlot,*ayPlot,*azPlot;
-            gui::DataPlot1D *gxPlot,*gyPlot,*gzPlot;
-            gui::DataPlot1D *mxPlot,*myPlot,*mzPlot;
-    };
+  gui::DataPlot1D *axPlot, *ayPlot, *azPlot;
+  gui::DataPlot1D *gxPlot, *gyPlot, *gzPlot;
+  gui::DataPlot1D *mxPlot, *myPlot, *mzPlot;
+};
 } // end namespace sensor
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/LaserRangeFinder.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/LaserRangeFinder.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/LaserRangeFinder.cpp	(revision 15)
@@ -32,62 +32,48 @@
 using namespace flair::gui;
 
-namespace flair { namespace sensor {
+namespace flair {
+namespace sensor {
 
-LaserRangeFinder::LaserRangeFinder(const FrameworkManager* parent,string name) : IODevice(parent,name) {
-    cvmatrix_descriptor* desc=new cvmatrix_descriptor(360,1);
-    output=new cvmatrix(this,desc,floatType);
-    AddDataToLog(output);
+LaserRangeFinder::LaserRangeFinder(const FrameworkManager *parent, string name)
+    : IODevice(parent, name) {
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(360, 1);
+  output = new cvmatrix(this, desc, floatType);
+  AddDataToLog(output);
 
-    //station sol
-    main_tab=new Tab(parent->GetTabWidget(),name);
-    tab=new TabWidget(main_tab->NewRow(),name);
-    sensor_tab=new Tab(tab,"Reglages");
-    setup_groupbox=new GroupBox(sensor_tab->NewRow(),name);
-
+  // station sol
+  main_tab = new Tab(parent->GetTabWidget(), name);
+  tab = new TabWidget(main_tab->NewRow(), name);
+  sensor_tab = new Tab(tab, "Reglages");
+  setup_groupbox = new GroupBox(sensor_tab->NewRow(), name);
 }
 
-LaserRangeFinder::LaserRangeFinder(const IODevice* parent,std::string name) : IODevice(parent,name)
-{
-    plot_tab=NULL;
-    main_tab=NULL;
-    tab=NULL;
-    sensor_tab=NULL;
-    setup_groupbox=NULL;
+LaserRangeFinder::LaserRangeFinder(const IODevice *parent, std::string name)
+    : IODevice(parent, name) {
+  plot_tab = NULL;
+  main_tab = NULL;
+  tab = NULL;
+  sensor_tab = NULL;
+  setup_groupbox = NULL;
 
-    output=NULL;
+  output = NULL;
 }
 
-LaserRangeFinder::~LaserRangeFinder()
-{
+LaserRangeFinder::~LaserRangeFinder() {}
 
-}
+GroupBox *LaserRangeFinder::GetGroupBox(void) const { return setup_groupbox; }
 
+Layout *LaserRangeFinder::GetLayout(void) const { return sensor_tab; }
 
-GroupBox* LaserRangeFinder::GetGroupBox(void) const
-{
-return setup_groupbox;
-}
+RangeFinderPlot *LaserRangeFinder::GetPlot(void) const { return plot; }
 
-Layout* LaserRangeFinder::GetLayout(void) const
-{
-return sensor_tab;
-}
+void LaserRangeFinder::UseDefaultPlot(void) {
+  if (tab == NULL) {
+    Err("not applicable for simulation part.\n");
+    return;
+  }
 
-
-RangeFinderPlot* LaserRangeFinder::GetPlot(void) const
-{
-return plot;
-}
-
-void LaserRangeFinder::UseDefaultPlot(void)
-{
-    if(tab==NULL)
-    {
-        Err("not applicable for simulation part.\n");
-        return;
-    }
-
-    plot_tab=new Tab(tab,"Mesures");
-    plot=new RangeFinderPlot(plot_tab->NewRow(),"plot","x",-30,30,"y",-30,30,output,0,359,output->Rows());
+  plot_tab = new Tab(tab, "Mesures");
+  plot = new RangeFinderPlot(plot_tab->NewRow(), "plot", "x", -30, 30, "y", -30,
+                             30, output, 0, 359, output->Rows());
 }
 } // end namespace sensor
Index: trunk/lib/FlairSensorActuator/src/LaserRangeFinder.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/LaserRangeFinder.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/LaserRangeFinder.h	(revision 15)
@@ -16,124 +16,116 @@
 #include <IODevice.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class FrameworkManager;
-        class cvmatrix;
-
-    }
-    namespace gui
-    {
-        class Tab;
-        class TabWidget;
-        class GroupBox;
-        class Layout;
-        class RangeFinderPlot;
-    }
+namespace flair {
+namespace core {
+class FrameworkManager;
+class cvmatrix;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class GroupBox;
+class Layout;
+class RangeFinderPlot;
+}
 }
 
-namespace flair
-{
-namespace sensor
-{
-    /*! \class LaserRangeFinder
-    *
-    * \brief Classe generique intégrant les telemetres laser
-    */
-    class LaserRangeFinder : public core::IODevice
-    {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a Laser Range Finder.
-            *
-            * \param parent parent
-            * \param name name
-            */
-            LaserRangeFinder(const core::FrameworkManager* parent,std::string name);
-            /*!
-            * \brief Constructor
-            *
-            * Construct a UsRangeFinder. Simulation part.
-            *
-            * \param parent parent
-            * \param name name
-            */
-            LaserRangeFinder(const core::IODevice* parent,std::string name);
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~LaserRangeFinder();
+namespace flair {
+namespace sensor {
+/*! \class LaserRangeFinder
+*
+* \brief Classe generique intégrant les telemetres laser
+*/
+class LaserRangeFinder : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Laser Range Finder.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  LaserRangeFinder(const core::FrameworkManager *parent, std::string name);
+  /*!
+  * \brief Constructor
+  *
+  * Construct a UsRangeFinder. Simulation part.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  LaserRangeFinder(const core::IODevice *parent, std::string name);
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~LaserRangeFinder();
 
-            /*!
-            * \brief Use default plot
-            *
-            */
-            void UseDefaultPlot(void);
+  /*!
+  * \brief Use default plot
+  *
+  */
+  void UseDefaultPlot(void);
 
-            /*!
-            * \brief Plot
-            *
-            * \return DataPlot1D
-            */
-            gui::RangeFinderPlot* GetPlot(void) const;
+  /*!
+  * \brief Plot
+  *
+  * \return DataPlot1D
+  */
+  gui::RangeFinderPlot *GetPlot(void) const;
 
-            /*!
-            * \brief Setup Layout
-            *
-            * \return a Layout available
-            */
-            gui::Layout* GetLayout(void) const;
+  /*!
+  * \brief Setup Layout
+  *
+  * \return a Layout available
+  */
+  gui::Layout *GetLayout(void) const;
 
-            /*!
-            * \brief Plot tab
-            *
-            * \return plot Tab
-            */
-            gui::Tab* GetPlotTab(void) const;
+  /*!
+  * \brief Plot tab
+  *
+  * \return plot Tab
+  */
+  gui::Tab *GetPlotTab(void) const;
 
-            /*!
-            * \brief Value
-            *
-            * \return output value
-            */
-            float Value(void) const;
+  /*!
+  * \brief Value
+  *
+  * \return output value
+  */
+  float Value(void) const;
 
-        protected:
-        /*!
-            * \brief Output matrix
-            *
-            * \return output matrix
-            */
-            core::cvmatrix *output;
+protected:
+  /*!
+      * \brief Output matrix
+      *
+      * \return output matrix
+      */
+  core::cvmatrix *output;
 
-            /*!
-            * \brief Setup GroupBox
-            *
-            * \return a GroupBox available
-            */
-            gui::GroupBox* GetGroupBox(void) const;
+  /*!
+  * \brief Setup GroupBox
+  *
+  * \return a GroupBox available
+  */
+  gui::GroupBox *GetGroupBox(void) const;
 
-        private:
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data){};
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
 
-            gui::Tab* main_tab;
-            gui::TabWidget *tab;
-            gui::GroupBox* setup_groupbox;
-            gui::Tab* sensor_tab;
-            gui::RangeFinderPlot* plot;
-            gui::Tab* plot_tab;
-
-    };
+  gui::Tab *main_tab;
+  gui::TabWidget *tab;
+  gui::GroupBox *setup_groupbox;
+  gui::Tab *sensor_tab;
+  gui::RangeFinderPlot *plot;
+  gui::Tab *plot_tab;
+};
 } // end namespace sensor
 } // end namespace framewor
Index: trunk/lib/FlairSensorActuator/src/Mb800.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Mb800.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Mb800.cpp	(revision 15)
@@ -24,104 +24,94 @@
 using namespace flair::core;
 
-namespace flair
-{
-namespace sensor
-{
+namespace flair {
+namespace sensor {
 
-Mb800::Mb800(const FrameworkManager* parent,string name,SerialPort *serialport,Gps::NMEAFlags_t NMEAFlags,uint8_t priority) : Gps(parent,name,NMEAFlags), Thread(parent,name,priority)
-{
-    this->serialport=serialport;
-    serialport->SetRxTimeout(100000000);
+Mb800::Mb800(const FrameworkManager *parent, string name,
+             SerialPort *serialport, Gps::NMEAFlags_t NMEAFlags,
+             uint8_t priority)
+    : Gps(parent, name, NMEAFlags), Thread(parent, name, priority) {
+  this->serialport = serialport;
+  serialport->SetRxTimeout(100000000);
 }
 
-Mb800::~Mb800()
-{
-    SafeStop();
-    Join();
+Mb800::~Mb800() {
+  SafeStop();
+  Join();
 }
 
-void Mb800::Run(void)
-{
-    /** Debut init **/
-    char response[200] = {0};
-    int size;
+void Mb800::Run(void) {
+  /** Debut init **/
+  char response[200] = {0};
+  int size;
 
-    /** Fin init **/
+  /** Fin init **/
 
-    /** Debut config **/
-    char to_send[]="$PASHS,NME,ALL,A,OFF\r\n";
+  /** Debut config **/
+  char to_send[] = "$PASHS,NME,ALL,A,OFF\r\n";
+  serialport->Write(to_send, sizeof(to_send));
+
+  {
+    char to_send[] = "$PASHS,CPD,AFP,95.0\r\n";
     serialport->Write(to_send, sizeof(to_send));
+  }
+  {
+    char to_send[] = "$PASHS,DIF,PRT,C,RT3\r\n";
+    serialport->Write(to_send, sizeof(to_send));
+  }
 
-    {
-        char to_send[]="$PASHS,CPD,AFP,95.0\r\n";
-        serialport->Write(to_send, sizeof(to_send));
+  if ((NMEAFlags & GGA) != 0) {
+    char to_send[] = "$PASHS,NME,GGA,A,ON,0.05\r\n";
+    size = serialport->Write(to_send, sizeof(to_send));
+    // Printf("ecrit %i\n",size);
+  }
+  if ((NMEAFlags & VTG) != 0) {
+    char to_send[] = "$PASHS,NME,VTG,A,ON,0.05\r\n";
+    size = serialport->Write(to_send, sizeof(to_send));
+    // Printf("%i\n",size);
+  }
+  if ((NMEAFlags & GST) != 0) {
+    char to_send[] = "$PASHS,NME,GST,A,ON,0.05\r\n";
+    size = serialport->Write(to_send, sizeof(to_send));
+    // Printf("%i\n",size);
+  }
+
+  Sync();
+
+  /** Fin config **/
+
+  /** Debut running loop **/
+  WarnUponSwitches(true);
+
+  while (!ToBeStopped()) {
+    SleepMS(10);
+    size = 0;
+    while (!ToBeStopped()) {
+      ssize_t read = serialport->Read(&response[size], 1);
+      if (read < 0) {
+        Thread::Err("erreur Read (%s)\n", strerror(-read));
+      }
+
+      if (response[size] == 0x0a)
+        break;
+      size++;
     }
-    {
-        char to_send[]="$PASHS,DIF,PRT,C,RT3\r\n";
-        serialport->Write(to_send, sizeof(to_send));
-    }
-
-    if((NMEAFlags&GGA)!=0)
-    {
-        char to_send[]="$PASHS,NME,GGA,A,ON,0.05\r\n";
-        size=serialport->Write(to_send, sizeof(to_send));
-        //Printf("ecrit %i\n",size);
-    }
-    if((NMEAFlags&VTG)!=0)
-    {
-        char to_send[]="$PASHS,NME,VTG,A,ON,0.05\r\n";
-        size=serialport->Write(to_send, sizeof(to_send));
-        //Printf("%i\n",size);
-    }
-    if((NMEAFlags&GST)!=0)
-    {
-        char to_send[]="$PASHS,NME,GST,A,ON,0.05\r\n";
-        size=serialport->Write(to_send, sizeof(to_send));
-        //Printf("%i\n",size);
-    }
-
-    Sync();
-
-    /** Fin config **/
-
-    /** Debut running loop **/
-    WarnUponSwitches(true);
-
-    while(!ToBeStopped())
-    {
-        SleepMS(10);
-        size=0;
-        while(!ToBeStopped())
-        {
-            ssize_t read = serialport->Read(&response[size],1);
-            if(read<0)
-            {
-                Thread::Err("erreur Read (%s)\n",strerror(-read));
-            }
-
-            if(response[size]==0x0a) break;
-            size++;
-        }
-        size++;
-        parseFrame(response, size);
-    }
-    /** fin running loop **/
-    WarnUponSwitches(false);
+    size++;
+    parseFrame(response, size);
+  }
+  /** fin running loop **/
+  WarnUponSwitches(false);
 }
 
-void Mb800::Sync(void)
-{
-    char data=0;
-    ssize_t read = 0;
+void Mb800::Sync(void) {
+  char data = 0;
+  ssize_t read = 0;
 
-    //attente fin trame
-    while(data!=0x0a)
-    {
-        read = serialport->Read(&data,1);
-        if(read<0)
-        {
-            Thread::Err("erreur Read (%s)\n",strerror(-read));
-        }
+  // attente fin trame
+  while (data != 0x0a) {
+    read = serialport->Read(&data, 1);
+    if (read < 0) {
+      Thread::Err("erreur Read (%s)\n", strerror(-read));
     }
+  }
 }
 
Index: trunk/lib/FlairSensorActuator/src/Mb800.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/Mb800.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Mb800.h	(revision 15)
@@ -17,64 +17,61 @@
 #include <Gps.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class FrameworkManager;
-        class SerialPort;
-    }
+namespace flair {
+namespace core {
+class FrameworkManager;
+class SerialPort;
+}
 }
 
-namespace flair
-{
-namespace sensor
-{
-    /*! \class Mb800
-    *
-    * \brief Class for mb800 gps receiver
-    */
-    class Mb800 : public core::Thread, public Gps
-    {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a Mb800.
-            *
-            * \param parent parent
-            * \param name name
-            * \param serialport serialport
-            * \param NMEAFlags NMEA sentances to enable
-            * \param priority priority of the Thread
-            */
-            Mb800(const core::FrameworkManager* parent,std::string name,core::SerialPort *serialport,Gps::NMEAFlags_t NMEAFlags,uint8_t priority);
+namespace flair {
+namespace sensor {
+/*! \class Mb800
+*
+* \brief Class for mb800 gps receiver
+*/
+class Mb800 : public core::Thread, public Gps {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Mb800.
+  *
+  * \param parent parent
+  * \param name name
+  * \param serialport serialport
+  * \param NMEAFlags NMEA sentances to enable
+  * \param priority priority of the Thread
+  */
+  Mb800(const core::FrameworkManager *parent, std::string name,
+        core::SerialPort *serialport, Gps::NMEAFlags_t NMEAFlags,
+        uint8_t priority);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~Mb800();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Mb800();
 
-        private:
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data){};
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
 
-            /*!
-            * \brief Run function
-            *
-            * Reimplemented from Thread.
-            *
-            */
-            void Run(void);
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
 
-            void Sync(void);
-            core::SerialPort *serialport;
-    };
+  void Sync(void);
+  core::SerialPort *serialport;
+};
 } // end namespace sensor
 } // end namespace framewor
Index: trunk/lib/FlairSensorActuator/src/Novatel.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Novatel.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Novatel.cpp	(revision 15)
@@ -24,78 +24,69 @@
 using namespace flair::core;
 
-namespace flair
-{
-namespace sensor
-{
+namespace flair {
+namespace sensor {
 
-Novatel::Novatel(const FrameworkManager* parent,string name,SerialPort *serialport,Gps::NMEAFlags_t NMEAFlags,uint8_t priority) : Gps(parent,name,NMEAFlags), Thread(parent,name,priority)
-{
-    this->serialport=serialport;
+Novatel::Novatel(const FrameworkManager *parent, string name,
+                 SerialPort *serialport, Gps::NMEAFlags_t NMEAFlags,
+                 uint8_t priority)
+    : Gps(parent, name, NMEAFlags), Thread(parent, name, priority) {
+  this->serialport = serialport;
 }
 
-Novatel::~Novatel()
-{
-    SafeStop();
-    Join();
+Novatel::~Novatel() {
+  SafeStop();
+  Join();
 }
 
-void Novatel::Run(void)
-{
-    char response[200] = {0};
-    int size;
-    ssize_t written;
+void Novatel::Run(void) {
+  char response[200] = {0};
+  int size;
+  ssize_t written;
 
-    WarnUponSwitches(true);
+  WarnUponSwitches(true);
 
-    char to_send[]="log gpggalong ontime 0.05\n";
-    written=serialport->Write(to_send, sizeof(to_send));
-    if(written<0)
-    {
-        Thread::Err("erreur write (%s)\n",strerror(-written));
+  char to_send[] = "log gpggalong ontime 0.05\n";
+  written = serialport->Write(to_send, sizeof(to_send));
+  if (written < 0) {
+    Thread::Err("erreur write (%s)\n", strerror(-written));
+  }
+  char to_send2[] = "log gpvtg ontime 0.05\n";
+  written = serialport->Write(to_send2, sizeof(to_send2));
+  if (written < 0) {
+    Thread::Err("erreur write (%s)\n", strerror(-written));
+  }
+
+  Sync();
+
+  while (!ToBeStopped()) {
+    size = 0;
+    while (1) {
+      // ssize_t read = rt_dev_read(uart_fd, &response[size],1);
+      ssize_t Read = serialport->Read(&response[size], 1);
+      if (Read < 0) {
+        Thread::Err("erreur Read (%s)\n", strerror(-Read));
+      }
+      if (response[size] == 0x0a)
+        break;
+      size++;
     }
-    char to_send2[]="log gpvtg ontime 0.05\n";
-    written=serialport->Write(to_send2, sizeof(to_send2));
-    if(written<0)
-    {
-        Thread::Err("erreur write (%s)\n",strerror(-written));
-    }
+    size++;
+    parseFrame(response, size);
+  }
 
-    Sync();
-
-    while(!ToBeStopped())
-    {
-        size=0;
-        while(1)
-        {
-            //ssize_t read = rt_dev_read(uart_fd, &response[size],1);
-            ssize_t Read = serialport->Read(&response[size],1);
-            if(Read<0)
-            {
-                Thread::Err("erreur Read (%s)\n",strerror(-Read));
-            }
-            if(response[size]==0x0a) break;
-            size++;
-        }
-        size++;
-        parseFrame(response, size);
-    }
-
-    WarnUponSwitches(false);
+  WarnUponSwitches(false);
 }
 
-void Novatel::Sync(void)
-{
-    char data=0;
-    ssize_t Read = 0;
+void Novatel::Sync(void) {
+  char data = 0;
+  ssize_t Read = 0;
 
-    //attente fin trame
-    while(data!=0x0a)
-    {
-        Read = serialport->Read(&data,1);
-        if(Read<0)
-        {
-            Thread::Err("erreur Read (%s)\n",strerror(-Read));
-        }
+  // attente fin trame
+  while (data != 0x0a) {
+    Read = serialport->Read(&data, 1);
+    if (Read < 0) {
+      Thread::Err("erreur Read (%s)\n", strerror(-Read));
     }
+  }
 }
 
Index: trunk/lib/FlairSensorActuator/src/Novatel.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/Novatel.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Novatel.h	(revision 15)
@@ -17,64 +17,61 @@
 #include <Gps.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class FrameworkManager;
-        class SerialPort;
-    }
+namespace flair {
+namespace core {
+class FrameworkManager;
+class SerialPort;
+}
 }
 
-namespace flair
-{
-namespace sensor
-{
-    /*! \class Novatel
-    *
-    * \brief Class for Novatel gps receiver
-    */
-    class Novatel : public core::Thread, public Gps
-    {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a Novatel.
-            *
-            * \param parent parent
-            * \param name name
-            * \param serialport serialport
-            * \param NMEAFlags NMEA sentances to enable
-            * \param priority priority of the Thread
-            */
-            Novatel(const core::FrameworkManager* parent,std::string name,core::SerialPort *serialport,Gps::NMEAFlags_t NMEAFlags,uint8_t priority);
+namespace flair {
+namespace sensor {
+/*! \class Novatel
+*
+* \brief Class for Novatel gps receiver
+*/
+class Novatel : public core::Thread, public Gps {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Novatel.
+  *
+  * \param parent parent
+  * \param name name
+  * \param serialport serialport
+  * \param NMEAFlags NMEA sentances to enable
+  * \param priority priority of the Thread
+  */
+  Novatel(const core::FrameworkManager *parent, std::string name,
+          core::SerialPort *serialport, Gps::NMEAFlags_t NMEAFlags,
+          uint8_t priority);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~Novatel();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Novatel();
 
-        private:
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data){};
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
 
-            /*!
-            * \brief Run function
-            *
-            * Reimplemented from Thread.
-            *
-            */
-            void Run(void);
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
 
-            core::SerialPort *serialport;
-            void Sync(void);
-    };
+  core::SerialPort *serialport;
+  void Sync(void);
+};
 } // end namespace sensor
 } // end namespace framewor
Index: trunk/lib/FlairSensorActuator/src/Ps3Eye.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Ps3Eye.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Ps3Eye.cpp	(revision 15)
@@ -29,16 +29,13 @@
 using namespace flair::gui;
 
-namespace flair
-{
-namespace sensor
-{
+namespace flair {
+namespace sensor {
 
-Ps3Eye::Ps3Eye(const FrameworkManager* parent,string name,int camera_index,uint8_t priority)
-    : V4LCamera(parent,name,camera_index,320,240,cvimage::Type::Format::YUYV,priority) {
+Ps3Eye::Ps3Eye(const FrameworkManager *parent, string name, int camera_index,
+               uint8_t priority)
+    : V4LCamera(parent, name, camera_index, 320, 240,
+                cvimage::Type::Format::YUYV, priority) {}
 
-}
-
-Ps3Eye::~Ps3Eye() {
-}
+Ps3Eye::~Ps3Eye() {}
 
 } // end namespace sensor
Index: trunk/lib/FlairSensorActuator/src/Ps3Eye.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/Ps3Eye.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Ps3Eye.h	(revision 15)
@@ -16,51 +16,46 @@
 #include "V4LCamera.h"
 
-namespace flair
-{
-    namespace core
-    {
-        class cvimage;
-        class FrameworkManager;
-    }
-    namespace gui
-    {
-        class GridLayout;
-        class DoubleSpinBox;
-        class CheckBox;
-    }
+namespace flair {
+namespace core {
+class cvimage;
+class FrameworkManager;
+}
+namespace gui {
+class GridLayout;
+class DoubleSpinBox;
+class CheckBox;
+}
 }
 
-namespace flair
-{
-namespace sensor
-{
-    /*! \class Ps3Eye
-    *
-    * \brief Class for Ps3Eye camera
-    */
-    class Ps3Eye : public V4LCamera
-    {
+namespace flair {
+namespace sensor {
+/*! \class Ps3Eye
+*
+* \brief Class for Ps3Eye camera
+*/
+class Ps3Eye : public V4LCamera {
 
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a Ps3Eye.
-            *
-            * \param parent parent
-            * \param name name
-            * \param camera_index index of the camera, ie /dev/videox
-            * \param priority priority of the Thread
-            */
-            Ps3Eye(const core::FrameworkManager* parent,std::string name,int camera_index,uint8_t priority);
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Ps3Eye.
+  *
+  * \param parent parent
+  * \param name name
+  * \param camera_index index of the camera, ie /dev/videox
+  * \param priority priority of the Thread
+  */
+  Ps3Eye(const core::FrameworkManager *parent, std::string name,
+         int camera_index, uint8_t priority);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~Ps3Eye();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Ps3Eye();
 
-        private:
-    };
+private:
+};
 } // end namespace sensor
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/RadioReceiver.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/RadioReceiver.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/RadioReceiver.cpp	(revision 15)
@@ -28,59 +28,44 @@
 using namespace flair::gui;
 
-namespace flair
-{
-namespace sensor
-{
+namespace flair {
+namespace sensor {
 
-RadioReceiver::RadioReceiver(const FrameworkManager* parent,string name,unsigned int nb_channels) : IODevice(parent,name)
-{
-    is_connected=false;
-    this->nb_channels=nb_channels;
+RadioReceiver::RadioReceiver(const FrameworkManager *parent, string name,
+                             unsigned int nb_channels)
+    : IODevice(parent, name) {
+  is_connected = false;
+  this->nb_channels = nb_channels;
 
-    //init matrix
-    cvmatrix_descriptor* desc=new cvmatrix_descriptor(nb_channels,1);
-    for(int i=0;i<nb_channels;i++)
-    {
-        ostringstream channel_name;
-        channel_name << "channel " << i;
-        desc->SetElementName(i,0,channel_name.str());
-    }
-    output=new cvmatrix(this,desc,floatType,name);
+  // init matrix
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(nb_channels, 1);
+  for (int i = 0; i < nb_channels; i++) {
+    ostringstream channel_name;
+    channel_name << "channel " << i;
+    desc->SetElementName(i, 0, channel_name.str());
+  }
+  output = new cvmatrix(this, desc, floatType, name);
 
-     //station sol
-    main_tab=new Tab(parent->GetTabWidget(),name);
-    tab=new TabWidget(main_tab->NewRow(),name);
-    setup_tab=new Tab(tab,"Setup");
+  // station sol
+  main_tab = new Tab(parent->GetTabWidget(), name);
+  tab = new TabWidget(main_tab->NewRow(), name);
+  setup_tab = new Tab(tab, "Setup");
 
-    AddDataToLog(output);
+  AddDataToLog(output);
 }
 
-RadioReceiver::~RadioReceiver()
-{
-    delete main_tab;
+RadioReceiver::~RadioReceiver() { delete main_tab; }
+
+Layout *RadioReceiver::GetLayout(void) const { return setup_tab; }
+
+float RadioReceiver::ChannelValue(unsigned int id) const {
+  if (id < nb_channels) {
+    return output->Value(id, 0);
+  } else {
+    Err("channel %i/%i is out of bound\n", id, nb_channels);
+    return -1;
+  }
 }
 
-Layout* RadioReceiver::GetLayout(void) const
-{
-    return setup_tab;
-}
-
-float RadioReceiver::ChannelValue(unsigned int id) const
-{
-    if(id<nb_channels)
-    {
-        return output->Value(id,0);
-    }
-    else
-    {
-        Err("channel %i/%i is out of bound\n",id,nb_channels);
-        return -1;
-    }
-}
-
-bool RadioReceiver::IsConnected(void) const
-{
-    return is_connected;
-}
+bool RadioReceiver::IsConnected(void) const { return is_connected; }
 
 } // end namespace sensor
Index: trunk/lib/FlairSensorActuator/src/RadioReceiver.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/RadioReceiver.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/RadioReceiver.h	(revision 15)
@@ -17,87 +17,82 @@
 #include <stdint.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class FrameworkManager;
-        class cvmatrix;
-    }
-    namespace gui
-    {
-        class Tab;
-        class TabWidget;
-        class Layout;
-    }
+namespace flair {
+namespace core {
+class FrameworkManager;
+class cvmatrix;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class Layout;
+}
 }
 
-namespace flair
-{
-namespace sensor
-{
-    /*! \class RadioReceiver
-    *
-    * \brief Base class for radio receiver
-    */
-    class RadioReceiver : public core::IODevice
-    {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a RadioReceiver.
-            *
-            * \param parent parent
-            * \param name name
-            * \param nb_channels number of supported channels
-            */
-            RadioReceiver(const core::FrameworkManager* parent,std::string name,unsigned int nb_channels);
+namespace flair {
+namespace sensor {
+/*! \class RadioReceiver
+*
+* \brief Base class for radio receiver
+*/
+class RadioReceiver : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a RadioReceiver.
+  *
+  * \param parent parent
+  * \param name name
+  * \param nb_channels number of supported channels
+  */
+  RadioReceiver(const core::FrameworkManager *parent, std::string name,
+                unsigned int nb_channels);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~RadioReceiver();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~RadioReceiver();
 
-            /*!
-            * \brief get channel value
-            *
-            * \param id channel id
-            * \return value of the channel, between 0 and 1.
-            *  Returns -1 if channel is out of bound
-            */
-            float ChannelValue(unsigned int id) const;
+  /*!
+  * \brief get channel value
+  *
+  * \param id channel id
+  * \return value of the channel, between 0 and 1.
+  *  Returns -1 if channel is out of bound
+  */
+  float ChannelValue(unsigned int id) const;
 
-            /*!
-            * \brief Is transmitter connected?
-            *
-            * \return true if transmitter is connected
-            */
-            bool IsConnected(void) const;
+  /*!
+  * \brief Is transmitter connected?
+  *
+  * \return true if transmitter is connected
+  */
+  bool IsConnected(void) const;
 
-            /*!
-            * \brief Setup Layout
-            *
-            * \return a Layout available
-            */
-            gui::Layout* GetLayout(void) const;
+  /*!
+  * \brief Setup Layout
+  *
+  * \return a Layout available
+  */
+  gui::Layout *GetLayout(void) const;
 
-        private:
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data){};
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
 
-            core::cvmatrix *output;
-            bool is_connected;
-            unsigned int nb_channels;
-            gui::Tab* main_tab;
-            gui::TabWidget* tab;
-            gui::Tab* setup_tab;
-    };
+  core::cvmatrix *output;
+  bool is_connected;
+  unsigned int nb_channels;
+  gui::Tab *main_tab;
+  gui::TabWidget *tab;
+  gui::Tab *setup_tab;
+};
 } // end namespace sensor
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/SimuBldc.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuBldc.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/SimuBldc.cpp	(revision 15)
@@ -29,52 +29,58 @@
 using namespace flair::gui;
 
-namespace flair
-{
-namespace actuator
-{
+namespace flair {
+namespace actuator {
 
-SimuBldc::SimuBldc(const IODevice* parent,Layout* layout,string name,uint8_t motors_count,uint32_t dev_id) :Bldc(parent,layout,name,motors_count)
-{
-    ostringstream dev_name;
-    dev_name << "simu_bldc_" << dev_id;
-    shmem=new SharedMem(this,dev_name.str().c_str(),motors_count*sizeof(float));
+SimuBldc::SimuBldc(const IODevice *parent, Layout *layout, string name,
+                   uint8_t motors_count, uint32_t dev_id)
+    : Bldc(parent, layout, name, motors_count) {
+  ostringstream dev_name;
+  dev_name << "simu_bldc_" << dev_id;
+  shmem =
+      new SharedMem(this, dev_name.str().c_str(), motors_count * sizeof(float));
 
-    GroupBox *groupbox=new GroupBox(layout->NewRow(),"simubldc");
-    k=new DoubleSpinBox(groupbox->NewRow(),"k driver:",0,10000,1);
+  GroupBox *groupbox = new GroupBox(layout->NewRow(), "simubldc");
+  k = new DoubleSpinBox(groupbox->NewRow(), "k driver:", 0, 10000, 1);
 }
 
-SimuBldc::SimuBldc(const Object* parent,string name,uint8_t motors_count,uint32_t dev_id) :Bldc(parent,name,motors_count) {
-    ostringstream dev_name;
-    dev_name << "simu_bldc_" << dev_id;
-    shmem=new SharedMem(this,dev_name.str().c_str(),motors_count*sizeof(float));
+SimuBldc::SimuBldc(const Object *parent, string name, uint8_t motors_count,
+                   uint32_t dev_id)
+    : Bldc(parent, name, motors_count) {
+  ostringstream dev_name;
+  dev_name << "simu_bldc_" << dev_id;
+  shmem =
+      new SharedMem(this, dev_name.str().c_str(), motors_count * sizeof(float));
 
-    //reset values
-    float values[motors_count];
-    for(int i=0;i<motors_count;i++) values[i]=0;
+  // reset values
+  float values[motors_count];
+  for (int i = 0; i < motors_count; i++)
+    values[i] = 0;
 
-    shmem->Write((char*)&values,motors_count*sizeof(float));
+  shmem->Write((char *)&values, motors_count * sizeof(float));
 }
 
-SimuBldc::~SimuBldc() {
+SimuBldc::~SimuBldc() {}
+
+void SimuBldc::SetMotors(float *value) {
+  float values[MotorsCount()];
+
+  for (int i = 0; i < MotorsCount(); i++)
+    values[i] = k->Value() * value[i];
+
+  shmem->Write((char *)&values, MotorsCount() * sizeof(float));
+
+  // on prend une fois pour toute le mutex et on fait des accès directs
+  output->GetMutex();
+  for (int i = 0; i < MotorsCount(); i++)
+    output->SetValueNoMutex(i, 0, values[i]);
+  output->ReleaseMutex();
 }
 
-void SimuBldc::SetMotors(float* value) {
-    float values[MotorsCount()];
+void SimuBldc::GetSpeeds(float *value) const {
+  float values[MotorsCount()];
+  shmem->Read((char *)&values, MotorsCount() * sizeof(float));
 
-    for(int i=0;i<MotorsCount();i++) values[i]=k->Value()*value[i];
-
-    shmem->Write((char*)&values,MotorsCount()*sizeof(float));
-
-    //on prend une fois pour toute le mutex et on fait des accès directs
-    output->GetMutex();
-    for(int i=0;i<MotorsCount();i++) output->SetValueNoMutex(i,0,values[i]);
-    output->ReleaseMutex();
-}
-
-void SimuBldc::GetSpeeds(float* value) const {
-    float values[MotorsCount()];
-    shmem->Read((char*)&values,MotorsCount()*sizeof(float));
-
-    for(int i=0;i<MotorsCount();i++) value[i]=values[i];
+  for (int i = 0; i < MotorsCount(); i++)
+    value[i] = values[i];
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuBldc.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuBldc.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/SimuBldc.h	(revision 15)
@@ -16,103 +16,99 @@
 #include <Bldc.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class SharedMem;
-        class IODevice;
-        class cvmatrix;
-    }
-    namespace gui
-    {
-        class DoubleSpinBox;
-        class Layout;
-    }
+namespace flair {
+namespace core {
+class SharedMem;
+class IODevice;
+class cvmatrix;
+}
+namespace gui {
+class DoubleSpinBox;
+class Layout;
+}
 }
 
-namespace flair
-{
-namespace actuator
-{
-    /*! \class SimuBldc
-    *
-    * \brief Class for a simulation bldc
-    *
-    */
-    class SimuBldc : public Bldc
-    {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a SimuBldc. Control part.
-            *
-            * \param parent parent
-            * \param layout layout
-            * \param name name
-            * \param motors_count number of motors
-            * \param dev_id device id
-            */
-            SimuBldc(const core::IODevice* parent,gui::Layout* layout,std::string name,uint8_t motors_count,uint32_t dev_id);
+namespace flair {
+namespace actuator {
+/*! \class SimuBldc
+*
+* \brief Class for a simulation bldc
+*
+*/
+class SimuBldc : public Bldc {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuBldc. Control part.
+  *
+  * \param parent parent
+  * \param layout layout
+  * \param name name
+  * \param motors_count number of motors
+  * \param dev_id device id
+  */
+  SimuBldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
+           uint8_t motors_count, uint32_t dev_id);
 
-            /*!
-            * \brief Constructor
-            *
-            * Construct a SimuBldc. Simulation part.
-            *
-            * \param parent parent
-            * \param name name
-            * \param motors_count number of motors
-            * \param dev_id device id
-            */
-            SimuBldc(const core::Object* parent,std::string name,uint8_t motors_count,uint32_t dev_id);
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuBldc. Simulation part.
+  *
+  * \param parent parent
+  * \param name name
+  * \param motors_count number of motors
+  * \param dev_id device id
+  */
+  SimuBldc(const core::Object *parent, std::string name, uint8_t motors_count,
+           uint32_t dev_id);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~SimuBldc();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimuBldc();
 
-            /*!
-            * \brief Get motors speeds.
-            *
-            * This function should only be used for the simulation part.
-            *
-            * \param value array to store motors speeds
-            */
-            void GetSpeeds(float* value) const;
+  /*!
+  * \brief Get motors speeds.
+  *
+  * This function should only be used for the simulation part.
+  *
+  * \param value array to store motors speeds
+  */
+  void GetSpeeds(float *value) const;
 
-            /*!
-            * \brief Has speed measurement
-            *
-            * Reimplemented from Bldc. \n
-            *
-            * \return true if it has speed measurement
-            */
-            bool HasSpeedMeasurement(void) const{return false;};
+  /*!
+  * \brief Has speed measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has speed measurement
+  */
+  bool HasSpeedMeasurement(void) const { return false; };
 
-            /*!
-            * \brief Has current measurement
-            *
-            * Reimplemented from Bldc. \n
-            *
-            * \return true if it has current measurement
-            */
-            bool HasCurrentMeasurement(void) const{return false;};
+  /*!
+  * \brief Has current measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has current measurement
+  */
+  bool HasCurrentMeasurement(void) const { return false; };
 
-        private:
-            /*!
-            * \brief Set motors values
-            *
-            * Reimplemented from Bldc. \n
-            * Values size must be the same as MotorsCount()
-            *
-            * \param values motor values
-            */
-            void SetMotors(float* value);
+private:
+  /*!
+  * \brief Set motors values
+  *
+  * Reimplemented from Bldc. \n
+  * Values size must be the same as MotorsCount()
+  *
+  * \param values motor values
+  */
+  void SetMotors(float *value);
 
-            core::SharedMem *shmem;
-            gui::DoubleSpinBox *k;
-    };
+  core::SharedMem *shmem;
+  gui::DoubleSpinBox *k;
+};
 } // end namespace actuator
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/SimuCamera.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuCamera.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/SimuCamera.cpp	(revision 15)
@@ -29,55 +29,66 @@
 using namespace flair::gui;
 
-namespace flair { namespace sensor {
+namespace flair {
+namespace sensor {
 
-SimuCamera::SimuCamera(const FrameworkManager* parent,string name,uint16_t width,uint16_t height,uint8_t channels,uint32_t dev_id,uint8_t priority) :Thread(parent,name,priority),Camera(parent,name,width,height,cvimage::Type::Format::BGR) {
-    data_rate=new SpinBox(GetGroupBox()->NewRow(),"data rate"," Hz",1,100,1,50);
+SimuCamera::SimuCamera(const FrameworkManager *parent, string name,
+                       uint16_t width, uint16_t height, uint8_t channels,
+                       uint32_t dev_id, uint8_t priority)
+    : Thread(parent, name, priority),
+      Camera(parent, name, width, height, cvimage::Type::Format::BGR) {
+  data_rate =
+      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 100, 1, 50);
 
-    buf_size=width*height*channels;
+  buf_size = width * height * channels;
 
-    img=cvCreateImage(cvSize(width,height),IPL_DEPTH_8U,3);
-    output->img->imageData=img->imageData;
+  img = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 3);
+  output->img->imageData = img->imageData;
 
-    ostringstream dev_name;
-    dev_name << "simu_cam_" << dev_id;
-    shmem=new SharedMem((Thread*)this,dev_name.str().c_str(),buf_size);
+  ostringstream dev_name;
+  dev_name << "simu_cam_" << dev_id;
+  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(), buf_size);
 }
 
-SimuCamera::SimuCamera(const IODevice* parent,string name,uint16_t width,uint16_t height,uint8_t channels,uint32_t dev_id) : Thread(parent,name,0),Camera(parent,name) {
-    data_rate=NULL;
+SimuCamera::SimuCamera(const IODevice *parent, string name, uint16_t width,
+                       uint16_t height, uint8_t channels, uint32_t dev_id)
+    : Thread(parent, name, 0), Camera(parent, name) {
+  data_rate = NULL;
 
-    ostringstream dev_name;
-    dev_name << "simu_cam_" << dev_id;
-    shmem=new SharedMem((Thread*)this,dev_name.str().c_str(),width*height*channels);
+  ostringstream dev_name;
+  dev_name << "simu_cam_" << dev_id;
+  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
+                        width * height * channels);
 }
 
 SimuCamera::~SimuCamera() {
-    SafeStop();
-    Join();
+  SafeStop();
+  Join();
 }
 
 void SimuCamera::Run(void) {
-    if(data_rate==NULL) {
-        Thread::Err("not applicable for simulation part.\n");
-        return;
+  if (data_rate == NULL) {
+    Thread::Err("not applicable for simulation part.\n");
+    return;
+  }
+
+  SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    if (data_rate->ValueChanged() == true) {
+      SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
     }
 
-    SetPeriodUS((uint32_t)(1000000./data_rate->Value()));
+    output->GetMutex();
+    shmem->Read((char *)img->imageData, buf_size); // remplacer copie par
+                                                   // échange de pointeur sur
+                                                   // double buffering
+    output->ReleaseMutex();
 
-    while(!ToBeStopped()) {
-        WaitPeriod();
+    output->SetDataTime(GetTime());
 
-        if(data_rate->ValueChanged()==true) {
-            SetPeriodUS((uint32_t)(1000000./data_rate->Value()));
-        }
-
-        output->GetMutex();
-        shmem->Read((char*)img->imageData,buf_size); // remplacer copie par échange de pointeur sur double buffering
-        output->ReleaseMutex();
-
-        output->SetDataTime(GetTime());
-
-        ProcessUpdate(output);
-    }
+    ProcessUpdate(output);
+  }
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuCamera.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuCamera.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/SimuCamera.h	(revision 15)
@@ -18,92 +18,89 @@
 #include <cxcore.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class SharedMem;
-    }
-    namespace gui
-    {
-        class SpinBox;
-    }
+namespace flair {
+namespace core {
+class SharedMem;
+}
+namespace gui {
+class SpinBox;
+}
 }
 
-namespace flair
-{
-namespace sensor
-{
-    /*! \class SimuCamera
-    *
-    * \brief Class for a simulation camera
-    */
-    class SimuCamera : public core::Thread, public Camera
-    {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a SimuCamera. Control part.
-            *
-            * \param parent parent
-            * \param name name
-            * \param width width
-            * \param height height
-            * \param channels number of channels
-            * \param dev_id device id
-            * \param priority priority of the Thread
-            */
-            SimuCamera(const core::FrameworkManager* parent,std::string name,uint16_t width,uint16_t height,uint8_t channels,uint32_t dev_id,uint8_t priority);
+namespace flair {
+namespace sensor {
+/*! \class SimuCamera
+*
+* \brief Class for a simulation camera
+*/
+class SimuCamera : public core::Thread, public Camera {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuCamera. Control part.
+  *
+  * \param parent parent
+  * \param name name
+  * \param width width
+  * \param height height
+  * \param channels number of channels
+  * \param dev_id device id
+  * \param priority priority of the Thread
+  */
+  SimuCamera(const core::FrameworkManager *parent, std::string name,
+             uint16_t width, uint16_t height, uint8_t channels, uint32_t dev_id,
+             uint8_t priority);
 
-            /*!
-            * \brief Constructor
-            *
-            * Construct a SimuCamera. Simulation part.\n
-            * The Thread of this class should not be run.
-            *
-            * \param parent parent
-            * \param name name
-            * \param width width
-            * \param height height
-            * \param channels number of channels
-            * \param dev_id device id
-            */
-            SimuCamera(const core::IODevice* parent,std::string name,uint16_t width,uint16_t height,uint8_t channels,uint32_t dev_id);
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuCamera. Simulation part.\n
+  * The Thread of this class should not be run.
+  *
+  * \param parent parent
+  * \param name name
+  * \param width width
+  * \param height height
+  * \param channels number of channels
+  * \param dev_id device id
+  */
+  SimuCamera(const core::IODevice *parent, std::string name, uint16_t width,
+             uint16_t height, uint8_t channels, uint32_t dev_id);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~SimuCamera();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimuCamera();
 
-        protected:
-            /*!
-            * \brief SharedMem to access datas
-            *
-            */
-            core::SharedMem *shmem;
+protected:
+  /*!
+  * \brief SharedMem to access datas
+  *
+  */
+  core::SharedMem *shmem;
 
-        private:
-            /*!
-            * \brief Run function
-            *
-            * Reimplemented from Thread.
-            *
-            */
-            void Run(void);
+private:
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
 
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data){};
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
 
-            gui::SpinBox *data_rate;
-            size_t buf_size;
-            IplImage* img;
-    };
+  gui::SpinBox *data_rate;
+  size_t buf_size;
+  IplImage *img;
+};
 } // end namespace sensor
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/SimuGps.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuGps.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/SimuGps.cpp	(revision 15)
@@ -24,38 +24,31 @@
 using namespace flair::core;
 
-namespace flair
-{
-namespace sensor
-{
+namespace flair {
+namespace sensor {
 
-SimuGps::SimuGps(const FrameworkManager* parent,string name,Gps::NMEAFlags_t NMEAFlags,uint8_t priority) : Thread(parent,name,priority), Gps(parent,name,NMEAFlags)
-{
+SimuGps::SimuGps(const FrameworkManager *parent, string name,
+                 Gps::NMEAFlags_t NMEAFlags, uint8_t priority)
+    : Thread(parent, name, priority), Gps(parent, name, NMEAFlags) {}
+
+SimuGps::~SimuGps() {
+  SafeStop();
+  Join();
 }
 
-SimuGps::~SimuGps()
-{
-    SafeStop();
-    Join();
+void SimuGps::Run(void) {
+  char response[200] = {0};
+  int size, result;
+  // double lat=0;
+  SetPeriodMS(500);
+  WarnUponSwitches(true);
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+    position->SetCoordinates(49.402313, 2.795463, 0);
+    //      lat+=.5;
+  }
+
+  WarnUponSwitches(false);
 }
-
-void SimuGps::Run(void)
-{
-    char response[200] = {0};
-    int size,result;
-//double lat=0;
-    SetPeriodMS(500);
-    WarnUponSwitches(true);
-
-    while(!ToBeStopped())
-    {
-        WaitPeriod();
-        position->SetCoordinates(49.402313, 2.795463,0);
-  //      lat+=.5;
-    }
-
-
-    WarnUponSwitches(false);
-}
-
 
 } // end namespace sensor
Index: trunk/lib/FlairSensorActuator/src/SimuGps.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuGps.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/SimuGps.h	(revision 15)
@@ -17,59 +17,55 @@
 #include <Gps.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class FrameworkManager;
-    }
+namespace flair {
+namespace core {
+class FrameworkManager;
+}
 }
 
-namespace flair
-{
-namespace sensor
-{
-    /*! \class SimuGps
-    *
-    * \brief Class for a simulation GPS
-    */
-    class SimuGps : public core::Thread, public Gps
-    {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a Novatel.
-            *
-            * \param parent parent
-            * \param name name
-            * \param NMEAFlags NMEA sentances to enable
-            * \param priority priority of the Thread
-            */
-            SimuGps(const core::FrameworkManager* parent,std::string name,Gps::NMEAFlags_t NMEAFlags,uint8_t priority);
+namespace flair {
+namespace sensor {
+/*! \class SimuGps
+*
+* \brief Class for a simulation GPS
+*/
+class SimuGps : public core::Thread, public Gps {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Novatel.
+  *
+  * \param parent parent
+  * \param name name
+  * \param NMEAFlags NMEA sentances to enable
+  * \param priority priority of the Thread
+  */
+  SimuGps(const core::FrameworkManager *parent, std::string name,
+          Gps::NMEAFlags_t NMEAFlags, uint8_t priority);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~SimuGps();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimuGps();
 
-        private:
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data){};
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
 
-            /*!
-            * \brief Run function
-            *
-            * Reimplemented from Thread.
-            *
-            */
-            void Run(void);
-    };
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+};
 } // end namespace sensor
 } // end namespace framewor
Index: trunk/lib/FlairSensorActuator/src/SimuImu.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuImu.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/SimuImu.cpp	(revision 15)
@@ -31,76 +31,84 @@
 using namespace flair::gui;
 
-namespace flair { namespace sensor {
+namespace flair {
+namespace sensor {
 
-SimuImu::SimuImu(const FrameworkManager* parent,string name,uint32_t dev_id,uint8_t priority) :Imu(parent,name),Thread(parent,name,priority) {
-    data_rate=new SpinBox(GetGroupBox()->NewRow(),"data rate"," Hz",1,500,1,200);
-    ahrsData=new AhrsData((Imu*)this);
+SimuImu::SimuImu(const FrameworkManager *parent, string name, uint32_t dev_id,
+                 uint8_t priority)
+    : Imu(parent, name), Thread(parent, name, priority) {
+  data_rate =
+      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 200);
+  ahrsData = new AhrsData((Imu *)this);
 
-    ostringstream dev_name;
-    dev_name << "simu_imu_" << dev_id;
-    shmem=new SharedMem((Thread*)this,dev_name.str().c_str(),sizeof(imu_states_t));
+  ostringstream dev_name;
+  dev_name << "simu_imu_" << dev_id;
+  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
+                        sizeof(imu_states_t));
 }
 
-SimuImu::SimuImu(const IODevice* parent,string name,uint32_t dev_id) :Imu(parent,name),Thread(parent,name,0) {
-    data_rate=NULL;
+SimuImu::SimuImu(const IODevice *parent, string name, uint32_t dev_id)
+    : Imu(parent, name), Thread(parent, name, 0) {
+  data_rate = NULL;
 
-    ostringstream dev_name;
-    dev_name << "simu_imu_" << dev_id;
-    shmem=new SharedMem((Thread*)this,dev_name.str().c_str(),sizeof(imu_states_t));
+  ostringstream dev_name;
+  dev_name << "simu_imu_" << dev_id;
+  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
+                        sizeof(imu_states_t));
 }
 
 SimuImu::~SimuImu() {
-    SafeStop();
-    Join();
+  SafeStop();
+  Join();
 }
 
 void SimuImu::UpdateFrom(const io_data *data) {
-    if(data!=NULL) {
-        cvmatrix *input=(cvmatrix*)data;
-        imu_states_t state;
+  if (data != NULL) {
+    cvmatrix *input = (cvmatrix *)data;
+    imu_states_t state;
 
-        input->GetMutex();
-        state.q0=input->ValueNoMutex(0,0);
-        state.q1=input->ValueNoMutex(1,0);
-        state.q2=input->ValueNoMutex(2,0);
-        state.q3=input->ValueNoMutex(3,0);
-        state.wx=input->ValueNoMutex(7,0);
-        state.wy=input->ValueNoMutex(8,0);
-        state.wz=input->ValueNoMutex(9,0);
-        input->ReleaseMutex();
+    input->GetMutex();
+    state.q0 = input->ValueNoMutex(0, 0);
+    state.q1 = input->ValueNoMutex(1, 0);
+    state.q2 = input->ValueNoMutex(2, 0);
+    state.q3 = input->ValueNoMutex(3, 0);
+    state.wx = input->ValueNoMutex(7, 0);
+    state.wy = input->ValueNoMutex(8, 0);
+    state.wz = input->ValueNoMutex(9, 0);
+    input->ReleaseMutex();
 
-        shmem->Write((char*)&state,sizeof(imu_states_t));
-    }
+    shmem->Write((char *)&state, sizeof(imu_states_t));
+  }
 }
 
 void SimuImu::Run(void) {
-    imu_states_t state;
-    ImuData* imuData;
-    GetDatas(&imuData);
+  imu_states_t state;
+  ImuData *imuData;
+  GetDatas(&imuData);
 
-    if(data_rate==NULL) {
-        Thread::Err("not applicable for simulation part.\n");
-        return;
+  if (data_rate == NULL) {
+    Thread::Err("not applicable for simulation part.\n");
+    return;
+  }
+
+  SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    if (data_rate->ValueChanged() == true) {
+      SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
     }
 
-    SetPeriodUS((uint32_t)(1000000./data_rate->Value()));
+    shmem->Read((char *)&state, sizeof(imu_states_t));
+    ahrsData->SetQuaternionAndAngularRates(
+        Quaternion(state.q0, state.q1, state.q2, state.q3),
+        Vector3D(state.wx, state.wy, state.wz));
 
-    while(!ToBeStopped()) {
-        WaitPeriod();
+    imuData->SetDataTime(GetTime());
+    ahrsData->SetDataTime(GetTime());
 
-        if(data_rate->ValueChanged()==true) {
-            SetPeriodUS((uint32_t)(1000000./data_rate->Value()));
-        }
-
-        shmem->Read((char*)&state,sizeof(imu_states_t));
-        ahrsData->SetQuaternionAndAngularRates(Quaternion(state.q0,state.q1,state.q2,state.q3)
-                                               ,Vector3D(state.wx,state.wy,state.wz));
-
-        imuData->SetDataTime(GetTime());
-        ahrsData->SetDataTime(GetTime());
-
-        UpdateImu();
-        ProcessUpdate(ahrsData);
-    }
+    UpdateImu();
+    ProcessUpdate(ahrsData);
+  }
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuImu.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuImu.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/SimuImu.h	(revision 15)
@@ -18,81 +18,83 @@
 
 namespace flair {
-    namespace core     {
-        class SharedMem;
-        class AhrsData;
-    }
-    namespace gui {
-        class SpinBox;
-    }
+namespace core {
+class SharedMem;
+class AhrsData;
+}
+namespace gui {
+class SpinBox;
+}
 }
 
-namespace flair { namespace sensor {
-    /*! \class SimuImu
-    *
-    * \brief Class for a simulation Imu
-    */
-    class SimuImu : public Imu, public core::Thread {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a SimuImu. Control part.
-            *
-            * \param parent parent
-            * \param name name
-            * \param dev_id device id
-            * \param priority priority of the Thread
-            */
-            SimuImu(const core::FrameworkManager* parent,std::string name,uint32_t dev_id,uint8_t priority);
+namespace flair {
+namespace sensor {
+/*! \class SimuImu
+*
+* \brief Class for a simulation Imu
+*/
+class SimuImu : public Imu, public core::Thread {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuImu. Control part.
+  *
+  * \param parent parent
+  * \param name name
+  * \param dev_id device id
+  * \param priority priority of the Thread
+  */
+  SimuImu(const core::FrameworkManager *parent, std::string name,
+          uint32_t dev_id, uint8_t priority);
 
-            /*!
-            * \brief Constructor
-            *
-            * Construct a SimuImu. Simulation part.\n
-            * The Thread of this class should not be run.
-            *
-            * \param parent parent
-            * \param name name
-            * \param dev_id device id
-            */
-            SimuImu(const core::IODevice* parent,std::string name,uint32_t dev_id);
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuImu. Simulation part.\n
+  * The Thread of this class should not be run.
+  *
+  * \param parent parent
+  * \param name name
+  * \param dev_id device id
+  */
+  SimuImu(const core::IODevice *parent, std::string name, uint32_t dev_id);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~SimuImu();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimuImu();
 
-        private:
-            /*!
-            * \brief Run function
-            *
-            * Reimplemented from Thread.
-            *
-            */
-            void Run(void);
+private:
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
 
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data);
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data);
 
-            typedef struct {
-                float q0;
-                float q1;
-                float q2;
-                float q3;
-                float wx;
-                float wy;
-                float wz;
-            } imu_states_t;
-            gui::SpinBox *data_rate;
-            core::SharedMem *shmem;
-            core::AhrsData *ahrsData;
-    };
+  typedef struct {
+    float q0;
+    float q1;
+    float q2;
+    float q3;
+    float wx;
+    float wy;
+    float wz;
+  } imu_states_t;
+  gui::SpinBox *data_rate;
+  core::SharedMem *shmem;
+  core::AhrsData *ahrsData;
+};
 } // end namespace sensor
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/SimuLaser.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuLaser.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/SimuLaser.cpp	(revision 15)
@@ -29,62 +29,58 @@
 using namespace flair::gui;
 
-namespace flair
-{
-namespace sensor
-{
+namespace flair {
+namespace sensor {
 
-SimuLaser::SimuLaser(const FrameworkManager* parent,string name,uint32_t dev_id,uint8_t priority) : Thread(parent,name,priority), LaserRangeFinder(parent,name)
-{
-    data_rate=new SpinBox(GetGroupBox()->NewRow(),"data rate"," Hz",1,500,1,50);
+SimuLaser::SimuLaser(const FrameworkManager *parent, string name,
+                     uint32_t dev_id, uint8_t priority)
+    : Thread(parent, name, priority), LaserRangeFinder(parent, name) {
+  data_rate =
+      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 50);
 
-    ostringstream dev_name;
-    dev_name << "simu_Laser_" << dev_id;
-    shmem=new SharedMem((Thread*)this,dev_name.str().c_str(),360*sizeof(float)); //****
+  ostringstream dev_name;
+  dev_name << "simu_Laser_" << dev_id;
+  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
+                        360 * sizeof(float)); //****
 }
 
-SimuLaser::SimuLaser(const IODevice* parent,string name,uint32_t dev_id) : Thread(parent,name,0), LaserRangeFinder(parent,name)
-{
-    data_rate=NULL;
+SimuLaser::SimuLaser(const IODevice *parent, string name, uint32_t dev_id)
+    : Thread(parent, name, 0), LaserRangeFinder(parent, name) {
+  data_rate = NULL;
 
-    ostringstream dev_name;
-    dev_name << "simu_Laser_" << dev_id;
-    shmem=new SharedMem((Thread*)this,dev_name.str().c_str(),360*sizeof(float));
+  ostringstream dev_name;
+  dev_name << "simu_Laser_" << dev_id;
+  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
+                        360 * sizeof(float));
 }
 
-SimuLaser::~SimuLaser()
-{
-    SafeStop();
-    Join();
+SimuLaser::~SimuLaser() {
+  SafeStop();
+  Join();
 }
 
-void SimuLaser::Run(void)
-{
-    float z[360];
+void SimuLaser::Run(void) {
+  float z[360];
 
-    if(data_rate==NULL)
-    {
-        Thread::Err("not applicable for simulation part.\n");
-        return;
+  if (data_rate == NULL) {
+    Thread::Err("not applicable for simulation part.\n");
+    return;
+  }
+
+  SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    shmem->Read((char *)z, 360 * sizeof(float));
+
+    if (data_rate->ValueChanged() == true) {
+      SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
     }
-
-    SetPeriodUS((uint32_t)(1000000./data_rate->Value()));
-
-    while(!ToBeStopped())
-    {
-        WaitPeriod();
-
-        shmem->Read((char*)z,360*sizeof(float));
-
-        if(data_rate->ValueChanged()==true)
-        {
-            SetPeriodUS((uint32_t)(1000000./data_rate->Value()));
-        }
-        for(int i=0; i<360; i++)
-        {
-            output->SetValue(i,0,z[i]); //*******
-        }
-        output->SetDataTime(GetTime());
-        ProcessUpdate(output);
+    for (int i = 0; i < 360; i++) {
+      output->SetValue(i, 0, z[i]); //*******
     }
+    output->SetDataTime(GetTime());
+    ProcessUpdate(output);
+  }
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuLaser.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuLaser.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/SimuLaser.h	(revision 15)
@@ -17,84 +17,79 @@
 #include <Thread.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class SharedMem;
-    }
-    namespace gui
-    {
-        class SpinBox;
-    }
+namespace flair {
+namespace core {
+class SharedMem;
+}
+namespace gui {
+class SpinBox;
+}
 }
 
-namespace flair
-{
-namespace sensor
-{
-    /*! \class SimuUs
-    *
-    * \brief Class for a simulation UsRangeFinder
-    */
-    class SimuLaser : public core::Thread, public LaserRangeFinder
-    {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a SimuUs. Control part.
-            *
-            * \param parent parent
-            * \param name name
-            * \param dev_id device id
-            * \param priority priority of the Thread
-            */
-            SimuLaser(const core::FrameworkManager* parent,std::string name,uint32_t dev_id,uint8_t priority);
+namespace flair {
+namespace sensor {
+/*! \class SimuUs
+*
+* \brief Class for a simulation UsRangeFinder
+*/
+class SimuLaser : public core::Thread, public LaserRangeFinder {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuUs. Control part.
+  *
+  * \param parent parent
+  * \param name name
+  * \param dev_id device id
+  * \param priority priority of the Thread
+  */
+  SimuLaser(const core::FrameworkManager *parent, std::string name,
+            uint32_t dev_id, uint8_t priority);
 
-            /*!
-            * \brief Constructor
-            *
-            * Construct a SimuUs. Simulation part.\n
-            * The Thread of this class should not be run.
-            *
-            * \param parent parent
-            * \param name name
-            * \param dev_id device id
-            */
-            SimuLaser(const core::IODevice* parent,std::string name,uint32_t dev_id);
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuUs. Simulation part.\n
+  * The Thread of this class should not be run.
+  *
+  * \param parent parent
+  * \param name name
+  * \param dev_id device id
+  */
+  SimuLaser(const core::IODevice *parent, std::string name, uint32_t dev_id);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~SimuLaser();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimuLaser();
 
-        protected:
-            /*!
-            * \brief SharedMem to access datas
-            *
-            */
-            core::SharedMem *shmem;
+protected:
+  /*!
+  * \brief SharedMem to access datas
+  *
+  */
+  core::SharedMem *shmem;
 
-        private:
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data){};
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
 
-            /*!
-            * \brief Run function
-            *
-            * Reimplemented from Thread.
-            *
-            */
-            void Run(void);
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
 
-            gui::SpinBox *data_rate;
-    };
+  gui::SpinBox *data_rate;
+};
 } // end namespace sensor
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/SimuUs.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuUs.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/SimuUs.cpp	(revision 15)
@@ -29,60 +29,55 @@
 using namespace flair::gui;
 
-namespace flair
-{
-namespace sensor
-{
+namespace flair {
+namespace sensor {
 
-SimuUs::SimuUs(const FrameworkManager* parent,string name,uint32_t dev_id,uint8_t priority) : Thread(parent,name,priority), UsRangeFinder(parent,name)
-{
-    data_rate=new SpinBox(GetGroupBox()->NewRow(),"data rate"," Hz",1,500,1,50);
+SimuUs::SimuUs(const FrameworkManager *parent, string name, uint32_t dev_id,
+               uint8_t priority)
+    : Thread(parent, name, priority), UsRangeFinder(parent, name) {
+  data_rate =
+      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 50);
 
-    ostringstream dev_name;
-    dev_name << "simu_us_" << dev_id;
-    shmem=new SharedMem((Thread*)this,dev_name.str().c_str(),sizeof(float));
+  ostringstream dev_name;
+  dev_name << "simu_us_" << dev_id;
+  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(), sizeof(float));
 }
 
-SimuUs::SimuUs(const IODevice* parent,string name,uint32_t dev_id) : Thread(parent,name,0), UsRangeFinder(parent,name)
-{
-    data_rate=NULL;
+SimuUs::SimuUs(const IODevice *parent, string name, uint32_t dev_id)
+    : Thread(parent, name, 0), UsRangeFinder(parent, name) {
+  data_rate = NULL;
 
-    ostringstream dev_name;
-    dev_name << "simu_us_" << dev_id;
-    shmem=new SharedMem((Thread*)this,dev_name.str().c_str(),sizeof(float));
+  ostringstream dev_name;
+  dev_name << "simu_us_" << dev_id;
+  shmem = new SharedMem((Thread *)this, dev_name.str().c_str(), sizeof(float));
 }
 
-SimuUs::~SimuUs()
-{
-    SafeStop();
-    Join();
+SimuUs::~SimuUs() {
+  SafeStop();
+  Join();
 }
 
-void SimuUs::Run(void)
-{
-    float z;
+void SimuUs::Run(void) {
+  float z;
 
-    if(data_rate==NULL)
-    {
-        Thread::Err("not applicable for simulation part.\n");
-        return;
+  if (data_rate == NULL) {
+    Thread::Err("not applicable for simulation part.\n");
+    return;
+  }
+
+  SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    shmem->Read((char *)&z, sizeof(float));
+
+    if (data_rate->ValueChanged() == true) {
+      SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
     }
 
-    SetPeriodUS((uint32_t)(1000000./data_rate->Value()));
-
-    while(!ToBeStopped())
-    {
-        WaitPeriod();
-
-        shmem->Read((char*)&z,sizeof(float));
-
-        if(data_rate->ValueChanged()==true)
-        {
-            SetPeriodUS((uint32_t)(1000000./data_rate->Value()));
-        }
-
-        output->SetValue(0,0,z);
-        output->SetDataTime(GetTime());
-        ProcessUpdate(output);
-    }
+    output->SetValue(0, 0, z);
+    output->SetDataTime(GetTime());
+    ProcessUpdate(output);
+  }
 }
 
Index: trunk/lib/FlairSensorActuator/src/SimuUs.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuUs.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/SimuUs.h	(revision 15)
@@ -17,84 +17,79 @@
 #include <Thread.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class SharedMem;
-    }
-    namespace gui
-    {
-        class SpinBox;
-    }
+namespace flair {
+namespace core {
+class SharedMem;
+}
+namespace gui {
+class SpinBox;
+}
 }
 
-namespace flair
-{
-namespace sensor
-{
-    /*! \class SimuUs
-    *
-    * \brief Class for a simulation UsRangeFinder
-    */
-    class SimuUs : public core::Thread, public UsRangeFinder
-    {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a SimuUs. Control part.
-            *
-            * \param parent parent
-            * \param name name
-            * \param dev_id device id
-            * \param priority priority of the Thread
-            */
-            SimuUs(const core::FrameworkManager* parent,std::string name,uint32_t dev_id,uint8_t priority);
+namespace flair {
+namespace sensor {
+/*! \class SimuUs
+*
+* \brief Class for a simulation UsRangeFinder
+*/
+class SimuUs : public core::Thread, public UsRangeFinder {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuUs. Control part.
+  *
+  * \param parent parent
+  * \param name name
+  * \param dev_id device id
+  * \param priority priority of the Thread
+  */
+  SimuUs(const core::FrameworkManager *parent, std::string name,
+         uint32_t dev_id, uint8_t priority);
 
-            /*!
-            * \brief Constructor
-            *
-            * Construct a SimuUs. Simulation part.\n
-            * The Thread of this class should not be run.
-            *
-            * \param parent parent
-            * \param name name
-            * \param dev_id device id
-            */
-            SimuUs(const core::IODevice* parent,std::string name,uint32_t dev_id);
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuUs. Simulation part.\n
+  * The Thread of this class should not be run.
+  *
+  * \param parent parent
+  * \param name name
+  * \param dev_id device id
+  */
+  SimuUs(const core::IODevice *parent, std::string name, uint32_t dev_id);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~SimuUs();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimuUs();
 
-        protected:
-            /*!
-            * \brief SharedMem to access datas
-            *
-            */
-            core::SharedMem *shmem;
+protected:
+  /*!
+  * \brief SharedMem to access datas
+  *
+  */
+  core::SharedMem *shmem;
 
-        private:
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data){};
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
 
-            /*!
-            * \brief Run function
-            *
-            * Reimplemented from Thread.
-            *
-            */
-            void Run(void);
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
 
-            gui::SpinBox *data_rate;
-    };
+  gui::SpinBox *data_rate;
+};
 } // end namespace sensor
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/Srf08.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/Srf08.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Srf08.cpp	(revision 15)
@@ -30,215 +30,189 @@
 using namespace flair::gui;
 
-namespace flair
-{
-namespace sensor
-{
-
-Srf08::Srf08(const FrameworkManager* parent,string name,I2cPort* i2cport,uint16_t address,uint8_t priority) : Thread(parent,name,priority), UsRangeFinder(parent,name)
-{
-    is_init=false;
-
-    //default values
-    //range 46*43+43=2021mm max (2m)
-    //7:gain=118
-    //range=46;
-    //gain=7;
-
-    this->i2cport=i2cport;
-	this->address=address;
-
-    //station sol
-    gain=new SpinBox(GetGroupBox()->NewRow(),"gain:",0,255,1,8);
-    range=new SpinBox(GetGroupBox()->LastRowLastCol(),"range:",0,255,1,46);
-
-
-    SetRange();
-    SetMaxGain();
-}
-
-Srf08::~Srf08()
-{
-    SafeStop();
-    Join();
-}
-
-void Srf08::Run(void)
-{
-    WarnUponSwitches(true);
-
-    //init srf
+namespace flair {
+namespace sensor {
+
+Srf08::Srf08(const FrameworkManager *parent, string name, I2cPort *i2cport,
+             uint16_t address, uint8_t priority)
+    : Thread(parent, name, priority), UsRangeFinder(parent, name) {
+  is_init = false;
+
+  // default values
+  // range 46*43+43=2021mm max (2m)
+  // 7:gain=118
+  // range=46;
+  // gain=7;
+
+  this->i2cport = i2cport;
+  this->address = address;
+
+  // station sol
+  gain = new SpinBox(GetGroupBox()->NewRow(), "gain:", 0, 255, 1, 8);
+  range = new SpinBox(GetGroupBox()->LastRowLastCol(), "range:", 0, 255, 1, 46);
+
+  SetRange();
+  SetMaxGain();
+}
+
+Srf08::~Srf08() {
+  SafeStop();
+  Join();
+}
+
+void Srf08::Run(void) {
+  WarnUponSwitches(true);
+
+  // init srf
+  SendEcho();
+
+  SetPeriodMS(20);
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    if (range->ValueChanged() == true)
+      SetRange();
+    if (gain->ValueChanged() == true)
+      SetMaxGain();
+
+    GetEcho();
     SendEcho();
-
-    SetPeriodMS(20);
-
-    while(!ToBeStopped())
-    {
-        WaitPeriod();
-
-        if(range->ValueChanged()==true) SetRange();
-        if(gain->ValueChanged()==true) SetMaxGain();
-
-        GetEcho();
-        SendEcho();
+  }
+
+  WarnUponSwitches(false);
+}
+
+void Srf08::SendEcho(void) {
+  ssize_t written;
+  uint8_t tx[2];
+
+  tx[0] = 0;  // command register
+  tx[1] = 82; // ranging mode in usec
+
+  i2cport->GetMutex();
+
+  i2cport->SetSlave(address);
+  written = i2cport->Write(tx, 2);
+  echo_time = GetTime();
+
+  i2cport->ReleaseMutex();
+
+  if (written < 0) {
+    Thread::Err("erreur rt_dev_write (%s)\n", strerror(-written));
+  } else if (written != 2) {
+    Thread::Err("erreur rt_dev_write %i/2\n", written);
+  }
+}
+
+void Srf08::GetEcho(void) {
+  float z = 0;
+  ssize_t written, read;
+  uint8_t tx, rx[2];
+  tx = 2;
+  uint8_t nb_err = 0;
+
+  // si l'us est bloqué, on attend 1ms de plus
+  while (1) {
+    i2cport->GetMutex();
+    i2cport->SetSlave(address);
+    written = i2cport->Write(&tx, 1);
+
+    if (written < 0) {
+      i2cport->ReleaseMutex();
+      Thread::Err("erreur rt_dev_write (%s)\n", strerror(-written));
+      nb_err++;
+      if (nb_err == 20) {
+        Thread::Err("erreur rt_dev_write (%s), too many errors\n",
+                    strerror(-written));
+        return;
+      }
+      SleepMS(1);
+    } else {
+      read = i2cport->Read(rx, 2);
+      i2cport->ReleaseMutex();
+      // rt_printf("%i %i\n",rx[0],rx[1]);
+      if (read < 0) {
+        if (read != -ETIMEDOUT)
+          Thread::Err("erreur rt_dev_read (%s) %i\n", strerror(-written), read);
+        nb_err++;
+        if (nb_err == 20) {
+          Thread::Err("erreur rt_dev_read (%s), too many errors\n",
+                      strerror(-written));
+          return;
+        }
+        SleepMS(1);
+      } else if (read != 2) {
+        Thread::Err("erreur rt_dev_read %i/2\n", read);
+        return;
+      } else if (read == 2) {
+        break;
+      }
     }
-
-    WarnUponSwitches(false);
-}
-
-void Srf08::SendEcho(void)
-{
-    ssize_t written;
-    uint8_t tx[2];
-
-    tx[0]=0;//command register
-    tx[1]=82;//ranging mode in usec
-
-    i2cport->GetMutex();
-
-    i2cport->SetSlave(address);
-    written = i2cport->Write(tx, 2);
-    echo_time=GetTime();
-
-    i2cport->ReleaseMutex();
-
-    if(written<0)
-    {
-        Thread::Err("erreur rt_dev_write (%s)\n",strerror(-written));
+  }
+
+  // if(z!=-1)
+  // revoir ce filtrage!!!
+  {
+    z = 0.000001 * (float)(rx[0] * 256 + rx[1]) * 344 /
+        2; // d=v*t; v=344m/s, t=t usec/2 (aller retour)
+    // if(z>1) rt_printf("%i %i %f\n",rx[0],rx[1],z);
+    // on ne permet pas 2 mesures consecutives + grandes de 10cm
+    if (fabs(z - z_1) > 0.5 && is_init == true) {
+      Printf("z %f (anc %f) %lld\n", z, z_1, echo_time);
+      Printf("a revoir on suppose le sol plan\n");
+      z = z_1 + (z_1 - z_2); // on suppose que l'on continue a la meme vitesse
     }
-    else if (written != 2)
-    {
-        Thread::Err("erreur rt_dev_write %i/2\n",written);
-    }
-
-}
-
-void Srf08::GetEcho(void)
-{
-    float z=0;
-    ssize_t written,read;
-    uint8_t tx,rx[2];
-    tx=2;
-    uint8_t nb_err=0;
-
-    //si l'us est bloqué, on attend 1ms de plus
-    while(1)
-    {
-        i2cport->GetMutex();
-        i2cport->SetSlave(address);
-        written = i2cport->Write(&tx, 1);
-
-        if(written<0)
-        {
-            i2cport->ReleaseMutex();
-            Thread::Err("erreur rt_dev_write (%s)\n",strerror(-written));
-            nb_err++;
-            if(nb_err==20)
-            {
-                Thread::Err("erreur rt_dev_write (%s), too many errors\n",strerror(-written));
-                return;
-            }
-            SleepMS(1);
-        }
-        else
-        {
-            read = i2cport->Read(rx, 2);
-            i2cport->ReleaseMutex();
-        //rt_printf("%i %i\n",rx[0],rx[1]);
-            if(read<0)
-            {
-                if(read!=-ETIMEDOUT) Thread::Err("erreur rt_dev_read (%s) %i\n",strerror(-written),read);
-                nb_err++;
-                if(nb_err==20)
-                {
-                    Thread::Err("erreur rt_dev_read (%s), too many errors\n",strerror(-written));
-                    return;
-                }
-                SleepMS(1);
-            }
-            else if (read != 2)
-            {
-                Thread::Err("erreur rt_dev_read %i/2\n",read);
-                return;
-            }
-            else if(read==2)
-            {
-                break;
-            }
-        }
-    }
-
-    //if(z!=-1)
-    //revoir ce filtrage!!!
-    {
-        z=0.000001*(float)(rx[0]*256+rx[1])*344/2;//d=v*t; v=344m/s, t=t usec/2 (aller retour)
-//if(z>1) rt_printf("%i %i %f\n",rx[0],rx[1],z);
-        //on ne permet pas 2 mesures consecutives + grandes de 10cm
-        if(fabs(z-z_1)>0.5 && is_init==true)
-        {
-            Printf("z %f (anc %f) %lld\n",z,z_1,echo_time);
-            Printf("a revoir on suppose le sol plan\n");
-            z=z_1+(z_1-z_2);//on suppose que l'on continue a la meme vitesse
-        }
-        output->SetValue(0,0,z);
-        output->SetDataTime(echo_time+(rx[0]*256+rx[1])*1000);
-        ProcessUpdate(output);
-        z_2=z_1;
-        z_1=z;
-        is_init=true;
-    }
-}
-
-
-void Srf08::SetRange(void)
-{
-    ssize_t written;
-    uint8_t tx[2];
-
-    tx[0]=2;//range register
-    tx[1]=range->Value();//range*43+43=dist max en mm
-
-    i2cport->GetMutex();
-
-    i2cport->SetSlave(address);
-    written = i2cport->Write(tx, 2);
-
-    i2cport->ReleaseMutex();
-
-    if(written<0)
-    {
-        Thread::Err("erreur rt_dev_write (%s)\n",strerror(-written));
-    }
-    else if (written != 2)
-    {
-        Thread::Err("erreur rt_dev_write %i/2\n",written);
-    }
-
-}
-
-void Srf08::SetMaxGain(void)
-{
-    ssize_t written;
-    uint8_t tx[2];
-
-    //rt_printf("Srf08::SetMaxGain: %s ->%i\n",IODevice::ObjectName().c_str(),gain->Value());
-
-    tx[0]=1;//max gain register
-    tx[1]=gain->Value();
-
-    i2cport->GetMutex();
-
-    i2cport->SetSlave(address);
-    written = i2cport->Write(tx, 2);
-
-    i2cport->ReleaseMutex();
-
-    if(written<0)
-    {
-        Thread::Err("erreur write (%s)\n",strerror(-written));
-    }
-    else if (written != 2)
-    {
-        Thread::Err("erreur write %i/2\n",written);
-    }
+    output->SetValue(0, 0, z);
+    output->SetDataTime(echo_time + (rx[0] * 256 + rx[1]) * 1000);
+    ProcessUpdate(output);
+    z_2 = z_1;
+    z_1 = z;
+    is_init = true;
+  }
+}
+
+void Srf08::SetRange(void) {
+  ssize_t written;
+  uint8_t tx[2];
+
+  tx[0] = 2;              // range register
+  tx[1] = range->Value(); // range*43+43=dist max en mm
+
+  i2cport->GetMutex();
+
+  i2cport->SetSlave(address);
+  written = i2cport->Write(tx, 2);
+
+  i2cport->ReleaseMutex();
+
+  if (written < 0) {
+    Thread::Err("erreur rt_dev_write (%s)\n", strerror(-written));
+  } else if (written != 2) {
+    Thread::Err("erreur rt_dev_write %i/2\n", written);
+  }
+}
+
+void Srf08::SetMaxGain(void) {
+  ssize_t written;
+  uint8_t tx[2];
+
+  // rt_printf("Srf08::SetMaxGain: %s
+  // ->%i\n",IODevice::ObjectName().c_str(),gain->Value());
+
+  tx[0] = 1; // max gain register
+  tx[1] = gain->Value();
+
+  i2cport->GetMutex();
+
+  i2cport->SetSlave(address);
+  written = i2cport->Write(tx, 2);
+
+  i2cport->ReleaseMutex();
+
+  if (written < 0) {
+    Thread::Err("erreur write (%s)\n", strerror(-written));
+  } else if (written != 2) {
+    Thread::Err("erreur write %i/2\n", written);
+  }
 }
 
Index: trunk/lib/FlairSensorActuator/src/Srf08.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/Srf08.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/Srf08.h	(revision 15)
@@ -17,90 +17,86 @@
 #include <UsRangeFinder.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class FrameworkManager;
-        class I2cPort;
-    }
-    namespace gui
-    {
-        class SpinBox;;
-    }
+namespace flair {
+namespace core {
+class FrameworkManager;
+class I2cPort;
+}
+namespace gui {
+class SpinBox;
+;
+}
 }
 
-namespace flair
-{
-namespace sensor
-{
-    /*! \class Srf08
-    *
-    * \brief Class for ultra sonic SRF08
-    */
-    class Srf08 : public core::Thread, public UsRangeFinder
-    {
+namespace flair {
+namespace sensor {
+/*! \class Srf08
+*
+* \brief Class for ultra sonic SRF08
+*/
+class Srf08 : public core::Thread, public UsRangeFinder {
 
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a SimuUs. Control part.
-            *
-            * \param parent parent
-            * \param name name
-            * \param i2cport i2c port
-            * \param address i2c slave address
-            * \param priority priority of the Thread
-            */
-            Srf08(const core::FrameworkManager* parent,std::string name,core::I2cPort* i2cport,uint16_t address,uint8_t priority);
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimuUs. Control part.
+  *
+  * \param parent parent
+  * \param name name
+  * \param i2cport i2c port
+  * \param address i2c slave address
+  * \param priority priority of the Thread
+  */
+  Srf08(const core::FrameworkManager *parent, std::string name,
+        core::I2cPort *i2cport, uint16_t address, uint8_t priority);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~Srf08();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~Srf08();
 
-            /*!
-            * \brief Set Range
-            *
-            * check datasheet for values
-            */
-            void SetRange(void);
+  /*!
+  * \brief Set Range
+  *
+  * check datasheet for values
+  */
+  void SetRange(void);
 
-            /*!
-            * \brief Set Max Gain
-            *
-            * check datasheet for values
-            */
-            void SetMaxGain(void);
+  /*!
+  * \brief Set Max Gain
+  *
+  * check datasheet for values
+  */
+  void SetMaxGain(void);
 
-        private:
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data){};
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
 
-            /*!
-            * \brief Run function
-            *
-            * Reimplemented from Thread.
-            *
-            */
-            void Run(void);
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
 
-            void SendEcho(void);
-            void GetEcho(void);
+  void SendEcho(void);
+  void GetEcho(void);
 
-            bool is_init;
-            core::Time echo_time;
-            float z_1,z_2;
-            gui::SpinBox *gain,*range;
-            uint16_t address;
-            core::I2cPort* i2cport;
-    };
+  bool is_init;
+  core::Time echo_time;
+  float z_1, z_2;
+  gui::SpinBox *gain, *range;
+  uint16_t address;
+  core::I2cPort *i2cport;
+};
 } // end namespace sensor
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/TargetController.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/TargetController.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/TargetController.cpp	(revision 15)
@@ -31,123 +31,132 @@
 using std::string;
 
-namespace flair
-{
-namespace sensor
-{
+namespace flair {
+namespace sensor {
 
-TargetController::TargetController(const FrameworkManager* parent,string name,uint8_t priority) :
-    Thread(parent,name,priority),IODevice(parent,name) {
-    main_tab=new Tab(getFrameworkManager()->GetTabWidget(),name);
-    TabWidget* tab=new TabWidget(main_tab->NewRow(),name);
-    setup_tab=new Tab(tab,"Reglages");
-
+TargetController::TargetController(const FrameworkManager *parent, string name,
+                                   uint8_t priority)
+    : Thread(parent, name, priority), IODevice(parent, name) {
+  main_tab = new Tab(getFrameworkManager()->GetTabWidget(), name);
+  TabWidget *tab = new TabWidget(main_tab->NewRow(), name);
+  setup_tab = new Tab(tab, "Reglages");
 }
 
 TargetController::~TargetController() {
-    SafeStop();
-    Join();
+  SafeStop();
+  Join();
 }
 
 std::string TargetController::GetAxisName(unsigned int axisId) const {
-    return string("axis")+std::to_string(axisId);
+  return string("axis") + std::to_string(axisId);
 }
 
 std::string TargetController::GetButtonName(unsigned int buttonId) const {
-    return string("button")+std::to_string(buttonId);
+  return string("button") + std::to_string(buttonId);
 }
 
 bool TargetController::SetLedOn(unsigned int ledId) {
-    if (!IsControllerActionSupported(ControllerAction::SetLedOn)) return false;
-    SwitchLedMessage *msgLed=new SwitchLedMessage(true,ledId);
-    changeStateQueue.push(msgLed);
-    return true;
+  if (!IsControllerActionSupported(ControllerAction::SetLedOn))
+    return false;
+  SwitchLedMessage *msgLed = new SwitchLedMessage(true, ledId);
+  changeStateQueue.push(msgLed);
+  return true;
 }
 
 bool TargetController::SetLedOff(unsigned int ledId) {
-    if (!IsControllerActionSupported(ControllerAction::SetLedOn)) return false;
-    SwitchLedMessage *msgLed=new SwitchLedMessage(false,ledId);
-    changeStateQueue.push(msgLed);
-    return true;
+  if (!IsControllerActionSupported(ControllerAction::SetLedOn))
+    return false;
+  SwitchLedMessage *msgLed = new SwitchLedMessage(false, ledId);
+  changeStateQueue.push(msgLed);
+  return true;
 }
 
-bool TargetController::Rumble(unsigned int leftForce,unsigned int leftTimeout,unsigned int rightForce,unsigned int rightTimeout) {
-    if (!IsControllerActionSupported(ControllerAction::Rumble)) return false;
-    RumbleMessage *msgRumble=new RumbleMessage(leftForce,leftTimeout,rightForce,rightTimeout);
-    changeStateQueue.push(msgRumble);
-    return true;
+bool TargetController::Rumble(unsigned int leftForce, unsigned int leftTimeout,
+                              unsigned int rightForce,
+                              unsigned int rightTimeout) {
+  if (!IsControllerActionSupported(ControllerAction::Rumble))
+    return false;
+  RumbleMessage *msgRumble =
+      new RumbleMessage(leftForce, leftTimeout, rightForce, rightTimeout);
+  changeStateQueue.push(msgRumble);
+  return true;
 }
 
-bool TargetController::FlashLed(unsigned int ledId,unsigned int onTimeout,unsigned int offTimeout){
-    if (!IsControllerActionSupported(ControllerAction::FlashLed)) return false;
-    FlashLedMessage *msgFlashLed=new FlashLedMessage(ledId,onTimeout,offTimeout);
-    changeStateQueue.push(msgFlashLed);
-    return true;
+bool TargetController::FlashLed(unsigned int ledId, unsigned int onTimeout,
+                                unsigned int offTimeout) {
+  if (!IsControllerActionSupported(ControllerAction::FlashLed))
+    return false;
+  FlashLedMessage *msgFlashLed =
+      new FlashLedMessage(ledId, onTimeout, offTimeout);
+  changeStateQueue.push(msgFlashLed);
+  return true;
 }
 
-float TargetController::GetAxisValue(unsigned int axisId) const{
-    //TODO we'd better throw an exception here
-    if (axis==NULL) return 0;
+float TargetController::GetAxisValue(unsigned int axisId) const {
+  // TODO we'd better throw an exception here
+  if (axis == NULL)
+    return 0;
 
-    axis->GetMutex();
-    float axisValue=axis->Value(axisId, 0);
-    axis->ReleaseMutex();
-    return axisValue;
+  axis->GetMutex();
+  float axisValue = axis->Value(axisId, 0);
+  axis->ReleaseMutex();
+  return axisValue;
 }
 
-bool TargetController::IsButtonPressed(unsigned int buttonId) const{
-    //TODO we'd better throw an exception here
-    if (button==NULL) return false;
+bool TargetController::IsButtonPressed(unsigned int buttonId) const {
+  // TODO we'd better throw an exception here
+  if (button == NULL)
+    return false;
 
-    button->GetMutex();
-    bool buttonValue=button->Value(buttonId, 0);
-    button->ReleaseMutex();
-    return buttonValue;
+  button->GetMutex();
+  bool buttonValue = button->Value(buttonId, 0);
+  button->ReleaseMutex();
+  return buttonValue;
 }
 
 void TargetController::Run() {
-    Message *message;
+  Message *message;
 
-    if(getFrameworkManager()->ErrorOccured()||!ControllerInitialization()) {
+  if (getFrameworkManager()->ErrorOccured() || !ControllerInitialization()) {
+    SafeStop();
+    Thread::Err("An error occured, we don't proceed with the loop.\n");
+  } else {
+
+    axis = new cvmatrix((IODevice *)this, axisNumber, 1, floatType);
+    button =
+        new cvmatrix((IODevice *)this, buttonNumber, 1, SignedIntegerType(8));
+
+    while (!ToBeStopped()) {
+      // Thread::Info("Debug: entering acquisition loop\n");
+      if (getFrameworkManager()->ConnectionLost() == true)
         SafeStop();
-        Thread::Err("An error occured, we don't proceed with the loop.\n");
-    } else {
 
-        axis=new cvmatrix((IODevice *)this,axisNumber,1,floatType);
-        button=new cvmatrix((IODevice *)this,buttonNumber,1,SignedIntegerType(8));
+      if (IsDataFrameReady()) {
+        // Thread::Info("Debug: data frame is ready\n");
 
-        while(!ToBeStopped()) {
-            //Thread::Info("Debug: entering acquisition loop\n");
-            if(getFrameworkManager()->ConnectionLost()==true) SafeStop();
+        AcquireAxisData(*axis);
+        AcquireButtonData(*button);
 
-            if (IsDataFrameReady()) {
-                //Thread::Info("Debug: data frame is ready\n");
+        // send the data
+        axis->SetDataTime(GetTime());
+        ProcessUpdate(axis);
 
-                AcquireAxisData(*axis);
-                AcquireButtonData(*button);
+        // send pending controller state change request(s)
 
-                //send the data
-                axis->SetDataTime(GetTime());
-                ProcessUpdate(axis);
-
-                //send pending controller state change request(s)
-
-                while(changeStateQueue.size()!=0) {
-                    message=changeStateQueue.front();
-                    if (ProcessMessage(message)) {
-                        changeStateQueue.pop();
-                        delete message;
-                    }
-                }
-            } else {
-                //Thread::Info("Debug: relax...\n");
-                usleep(20000); //20ms
-            }
+        while (changeStateQueue.size() != 0) {
+          message = changeStateQueue.front();
+          if (ProcessMessage(message)) {
+            changeStateQueue.pop();
+            delete message;
+          }
         }
+      } else {
+        // Thread::Info("Debug: relax...\n");
+        usleep(20000); // 20ms
+      }
     }
+  }
 }
 
-Tab* TargetController::GetTab() const {
-    return setup_tab;
-}
+Tab *TargetController::GetTab() const { return setup_tab; }
 
 } // end namespace sensor
Index: trunk/lib/FlairSensorActuator/src/TargetController.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/TargetController.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/TargetController.h	(revision 15)
@@ -25,72 +25,87 @@
 
 namespace flair {
-    namespace core {
-        class FrameworkManager;
-        class cvmatrix;
-        class Socket;
-        class io_data;
-    }
-    namespace gui {
-        class Tab;
-        class TabWidget;
-        class DataPlot1D;
-    }
+namespace core {
+class FrameworkManager;
+class cvmatrix;
+class Socket;
+class io_data;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class DataPlot1D;
+}
 }
 
-namespace flair { namespace sensor {
-    enum class ControllerAction;
+namespace flair {
+namespace sensor {
+enum class ControllerAction;
 
-    /*! \class TargetController
-    *
-    * \brief Base Class for target side remote controls
-    *
-    */
-    class TargetController : public core::Thread, public core::IODevice {
-    public:
-        TargetController(const core::FrameworkManager* parent,std::string name,uint8_t priority=0);
-        ~TargetController();
-        //void DrawUserInterface();
-        virtual bool IsConnected() const=0;
-        virtual bool IsDataFrameReady()=0;
-        //axis stuff
-        unsigned int GetAxisNumber() const;
-        virtual std::string GetAxisName(unsigned int axisId) const;
-        float GetAxisValue(unsigned int axisId) const;// always in the range [-1.0,1.0]
-        //button stuff
-        unsigned int GetButtonNumber() const;
-        bool IsButtonPressed(unsigned int buttonId) const;
-        virtual std::string GetButtonName(unsigned int axisId) const;
-        //controller state stuff
-        virtual bool IsControllerActionSupported(ControllerAction action) const {return false;};
-        bool SetLedOn(unsigned int ledId);
-        bool SetLedOff(unsigned int ledId);
-        bool Rumble(unsigned int left_force,unsigned int left_timeout,unsigned int right_force,unsigned int right_timeout);
-        bool FlashLed(unsigned int ledId,unsigned int on_timeout,unsigned int off_timeout);
-        void UpdateFrom(const core::io_data *data){}; //TODO
-        gui::Tab* GetTab(void) const;
+/*! \class TargetController
+*
+* \brief Base Class for target side remote controls
+*
+*/
+class TargetController : public core::Thread, public core::IODevice {
+public:
+  TargetController(const core::FrameworkManager *parent, std::string name,
+                   uint8_t priority = 0);
+  ~TargetController();
+  // void DrawUserInterface();
+  virtual bool IsConnected() const = 0;
+  virtual bool IsDataFrameReady() = 0;
+  // axis stuff
+  unsigned int GetAxisNumber() const;
+  virtual std::string GetAxisName(unsigned int axisId) const;
+  float
+  GetAxisValue(unsigned int axisId) const; // always in the range [-1.0,1.0]
+  // button stuff
+  unsigned int GetButtonNumber() const;
+  bool IsButtonPressed(unsigned int buttonId) const;
+  virtual std::string GetButtonName(unsigned int axisId) const;
+  // controller state stuff
+  virtual bool IsControllerActionSupported(ControllerAction action) const {
+    return false;
+  };
+  bool SetLedOn(unsigned int ledId);
+  bool SetLedOff(unsigned int ledId);
+  bool Rumble(unsigned int left_force, unsigned int left_timeout,
+              unsigned int right_force, unsigned int right_timeout);
+  bool FlashLed(unsigned int ledId, unsigned int on_timeout,
+                unsigned int off_timeout);
+  void UpdateFrom(const core::io_data *data){}; // TODO
+  gui::Tab *GetTab(void) const;
 
-    protected:
-        virtual bool ProcessMessage(core::Message *msg)=0;
-        void QueueMessage(core::Message msg);
-        virtual bool ControllerInitialization()=0;// {return true;};
-        //axis stuff
-        unsigned int axisNumber;
-        core::cvmatrix* axis=NULL;
-        virtual void AcquireAxisData(core::cvmatrix &axis)=0; //responsible for getting the axis data from the hardware
-        uint16_t bitsPerAxis;
-        //button stuff
-        unsigned int buttonNumber;
-        core::cvmatrix* button=NULL;
-        virtual void AcquireButtonData(core::cvmatrix &button)=0; //responsible for getting the button data from the hardware
-        //controller state stuff
-        unsigned int ledNumber;
-    private:
-        void Run();
-        std::queue<core::Message *> changeStateQueue;
-        flair::gui::Tab* main_tab;
-        flair::gui::Tab* setup_tab;
-    };
+protected:
+  virtual bool ProcessMessage(core::Message *msg) = 0;
+  void QueueMessage(core::Message msg);
+  virtual bool ControllerInitialization() = 0; // {return true;};
+  // axis stuff
+  unsigned int axisNumber;
+  core::cvmatrix *axis = NULL;
+  virtual void AcquireAxisData(core::cvmatrix &axis) = 0; // responsible for
+                                                          // getting the axis
+                                                          // data from the
+                                                          // hardware
+  uint16_t bitsPerAxis;
+  // button stuff
+  unsigned int buttonNumber;
+  core::cvmatrix *button = NULL;
+  virtual void AcquireButtonData(core::cvmatrix &button) = 0; // responsible for
+                                                              // getting the
+                                                              // button data
+                                                              // from the
+                                                              // hardware
+  // controller state stuff
+  unsigned int ledNumber;
 
-}}
+private:
+  void Run();
+  std::queue<core::Message *> changeStateQueue;
+  flair::gui::Tab *main_tab;
+  flair::gui::Tab *setup_tab;
+};
+}
+}
 
 #endif // TARGETCONTROLLER_H
Index: trunk/lib/FlairSensorActuator/src/TargetEthController.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/TargetEthController.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/TargetEthController.cpp	(revision 15)
@@ -12,5 +12,6 @@
 //
 //  purpose:    class that gets remote controls through an ethernet connection.
-//              Typical use case: a remote control is plugged in a workstation and sends remote control
+//              Typical use case: a remote control is plugged in a workstation
+//              and sends remote control
 //              data to a distant target (this class) through Wifi//
 //
@@ -32,300 +33,331 @@
 using std::string;
 
-namespace flair
-{
-namespace sensor
-{
-
-TargetEthController::TargetEthController(const FrameworkManager* parent,string name,uint16_t _port,uint8_t priority) :
-    TargetController(parent,name,priority),listeningPort(_port),receiveCurrentPosition(0) {
-    const bool blocking=true;
-    listeningSocket=new TcpSocket(parent,"TEC_listening_socket",blocking,blocking);
-    dataSocket=new Socket(parent,"TEC_data_socket",_port+1); //receiving side
+namespace flair {
+namespace sensor {
+
+TargetEthController::TargetEthController(const FrameworkManager *parent,
+                                         string name, uint16_t _port,
+                                         uint8_t priority)
+    : TargetController(parent, name, priority), listeningPort(_port),
+      receiveCurrentPosition(0) {
+  const bool blocking = true;
+  listeningSocket =
+      new TcpSocket(parent, "TEC_listening_socket", blocking, blocking);
+  dataSocket =
+      new Socket(parent, "TEC_data_socket", _port + 1); // receiving side
 }
 
 TargetEthController::~TargetEthController() {
-    //We are (currently) the server side. We must ask the client side to initiate tcp connexion closing to avoid the server socket
-    //to get stuck in TIME_WAIT state
-    Message msg(32);
-    if (controlSocket) {
-        Message cancelAcquisition(sizeof(ControllerAction));
-        ControllerAction exit=ControllerAction::Exit;
-        memcpy(cancelAcquisition.buffer,&exit,sizeof(ControllerAction));
-        controlSocket->SendMessage(cancelAcquisition.buffer,cancelAcquisition.bufferSize);
-        //We don't expect any more data from the client, we're just waiting for the socket to be closed by the client
-        controlSocket->RecvMessage(msg.buffer,msg.bufferSize);
-    }
-
-    //TargetController calls TargetEthController methods in its run
-    //we must stop the thread now
-    SafeStop();
-    Join();
+  // We are (currently) the server side. We must ask the client side to initiate
+  // tcp connexion closing to avoid the server socket
+  // to get stuck in TIME_WAIT state
+  Message msg(32);
+  if (controlSocket) {
+    Message cancelAcquisition(sizeof(ControllerAction));
+    ControllerAction exit = ControllerAction::Exit;
+    memcpy(cancelAcquisition.buffer, &exit, sizeof(ControllerAction));
+    controlSocket->SendMessage(cancelAcquisition.buffer,
+                               cancelAcquisition.bufferSize);
+    // We don't expect any more data from the client, we're just waiting for the
+    // socket to be closed by the client
+    controlSocket->RecvMessage(msg.buffer, msg.bufferSize);
+  }
+
+  // TargetController calls TargetEthController methods in its run
+  // we must stop the thread now
+  SafeStop();
+  Join();
 }
 
 bool TargetEthController::IsConnected() const {
-    //TODO
-}
-
-bool TargetEthController::IsDataFrameReady(){
-    //read up to the last data
-    ssize_t received;
-    size_t bytesToReceive=dataFrameSize-receiveCurrentPosition;
-    bool fullDatagramReceived=false;
-
-    do {
-        received=dataSocket->RecvMessage(receiveFrameBuffer+receiveCurrentPosition,bytesToReceive,TIME_NONBLOCK);
-        if (received>0) {
-            bytesToReceive-=received;
-            if (bytesToReceive==0) {
-                //a full datagram has been read in receiveFrameBuffer
-                fullDatagramReceived=true;
-                receiveCurrentPosition=0;
-                //we swap the data and reception buffers to avoid copy
-                char *swapFrameBuffer=dataFrameBuffer;
-                dataFrameBuffer=receiveFrameBuffer;
-                receiveFrameBuffer=swapFrameBuffer;
-            }
-        }
-    } while (!received<0);
-
-    return fullDatagramReceived;
-}
-
-uint8_t TargetEthController::getByteOrNull(char *buffer,int byte,size_t bufferSize) {
-    if (byte<bufferSize) return buffer[byte];
-    else return 0;
-}
-
-uint32_t TargetEthController::charBufferToUint32(char *buffer, size_t bufferSize) {
-    union {
-        uint32_t int32;
-        char byte[4];
-    } bitField;
-    if (!IsBigEndian()) {
-        bitField.byte[0]=getByteOrNull(buffer,3,bufferSize);
-        bitField.byte[1]=getByteOrNull(buffer,2,bufferSize);
-        bitField.byte[2]=getByteOrNull(buffer,1,bufferSize);
-        bitField.byte[3]=getByteOrNull(buffer,0,bufferSize);
-    } else {
-        bitField.byte[0]=getByteOrNull(buffer,0,bufferSize);
-        bitField.byte[1]=getByteOrNull(buffer,1,bufferSize);
-        bitField.byte[2]=getByteOrNull(buffer,2,bufferSize);
-        bitField.byte[3]=getByteOrNull(buffer,3,bufferSize);
-    }
-    return bitField.int32;
-}
-
-//read _up_to_16_bits_ in a buffer
-uint16_t TargetEthController::readBits(uint8_t offsetInBits,uint8_t valueSizeInBits,char *buffer,size_t bufferSize) {
-    //parameters check
-    if (valueSizeInBits>16) throw std::range_error("bitfield should be at max 16bits wide");
-    size_t minBufferSize=(offsetInBits+valueSizeInBits)/8;
-    if ((offsetInBits+valueSizeInBits)%8!=0) minBufferSize++;
-    if (bufferSize<minBufferSize) throw std::range_error("buffer too small");
-    //skip first bytes
-    size_t bytesToSkip=offsetInBits/8;
-    buffer+=bytesToSkip;
-    bufferSize-=bytesToSkip;
-    offsetInBits-=bytesToSkip*8;
-    //take care of endianness
-    uint32_t value=charBufferToUint32(buffer,bufferSize);
-    value>>=32-offsetInBits-valueSizeInBits;
-    value&=(1<<valueSizeInBits)-1;
-    return (uint16_t)value;
+  // TODO
+}
+
+bool TargetEthController::IsDataFrameReady() {
+  // read up to the last data
+  ssize_t received;
+  size_t bytesToReceive = dataFrameSize - receiveCurrentPosition;
+  bool fullDatagramReceived = false;
+
+  do {
+    received =
+        dataSocket->RecvMessage(receiveFrameBuffer + receiveCurrentPosition,
+                                bytesToReceive, TIME_NONBLOCK);
+    if (received > 0) {
+      bytesToReceive -= received;
+      if (bytesToReceive == 0) {
+        // a full datagram has been read in receiveFrameBuffer
+        fullDatagramReceived = true;
+        receiveCurrentPosition = 0;
+        // we swap the data and reception buffers to avoid copy
+        char *swapFrameBuffer = dataFrameBuffer;
+        dataFrameBuffer = receiveFrameBuffer;
+        receiveFrameBuffer = swapFrameBuffer;
+      }
+    }
+  } while (!received < 0);
+
+  return fullDatagramReceived;
+}
+
+uint8_t TargetEthController::getByteOrNull(char *buffer, int byte,
+                                           size_t bufferSize) {
+  if (byte < bufferSize)
+    return buffer[byte];
+  else
+    return 0;
+}
+
+uint32_t TargetEthController::charBufferToUint32(char *buffer,
+                                                 size_t bufferSize) {
+  union {
+    uint32_t int32;
+    char byte[4];
+  } bitField;
+  if (!IsBigEndian()) {
+    bitField.byte[0] = getByteOrNull(buffer, 3, bufferSize);
+    bitField.byte[1] = getByteOrNull(buffer, 2, bufferSize);
+    bitField.byte[2] = getByteOrNull(buffer, 1, bufferSize);
+    bitField.byte[3] = getByteOrNull(buffer, 0, bufferSize);
+  } else {
+    bitField.byte[0] = getByteOrNull(buffer, 0, bufferSize);
+    bitField.byte[1] = getByteOrNull(buffer, 1, bufferSize);
+    bitField.byte[2] = getByteOrNull(buffer, 2, bufferSize);
+    bitField.byte[3] = getByteOrNull(buffer, 3, bufferSize);
+  }
+  return bitField.int32;
+}
+
+// read _up_to_16_bits_ in a buffer
+uint16_t TargetEthController::readBits(uint8_t offsetInBits,
+                                       uint8_t valueSizeInBits, char *buffer,
+                                       size_t bufferSize) {
+  // parameters check
+  if (valueSizeInBits > 16)
+    throw std::range_error("bitfield should be at max 16bits wide");
+  size_t minBufferSize = (offsetInBits + valueSizeInBits) / 8;
+  if ((offsetInBits + valueSizeInBits) % 8 != 0)
+    minBufferSize++;
+  if (bufferSize < minBufferSize)
+    throw std::range_error("buffer too small");
+  // skip first bytes
+  size_t bytesToSkip = offsetInBits / 8;
+  buffer += bytesToSkip;
+  bufferSize -= bytesToSkip;
+  offsetInBits -= bytesToSkip * 8;
+  // take care of endianness
+  uint32_t value = charBufferToUint32(buffer, bufferSize);
+  value >>= 32 - offsetInBits - valueSizeInBits;
+  value &= (1 << valueSizeInBits) - 1;
+  return (uint16_t)value;
 }
 
 void TargetEthController::AcquireAxisData(core::cvmatrix &axis) {
-    axis.GetMutex();
-//char testFrameBuffer[3]={(char)0x09,(char)0x59,(char)0xB8};
-    for (unsigned int i=0;i<axisNumber;i++) {
-        uint16_t rawAxisValue=readBits(i*bitsPerAxis,bitsPerAxis,dataFrameBuffer,dataFrameSize);
-//        uint16_t rawAxisValue=readBits(i*bitsPerAxis,bitsPerAxis,testFrameBuffer);
-        uint16_t scale=1<<(bitsPerAxis-1);
-//Thread::Info("RawAxisValue=%d, scale=%d => scaled rawValue=%d, float value)%f\n",rawAxisValue,scale,rawAxisValue-scale,(rawAxisValue-scale)/(float)scale);
-        axis.SetValueNoMutex(i,0,(rawAxisValue-scale)/(float)scale);
-    }
-    axis.ReleaseMutex();
+  axis.GetMutex();
+  // char testFrameBuffer[3]={(char)0x09,(char)0x59,(char)0xB8};
+  for (unsigned int i = 0; i < axisNumber; i++) {
+    uint16_t rawAxisValue =
+        readBits(i * bitsPerAxis, bitsPerAxis, dataFrameBuffer, dataFrameSize);
+    //        uint16_t
+    //        rawAxisValue=readBits(i*bitsPerAxis,bitsPerAxis,testFrameBuffer);
+    uint16_t scale = 1 << (bitsPerAxis - 1);
+    // Thread::Info("RawAxisValue=%d, scale=%d => scaled rawValue=%d, float
+    // value)%f\n",rawAxisValue,scale,rawAxisValue-scale,(rawAxisValue-scale)/(float)scale);
+    axis.SetValueNoMutex(i, 0, (rawAxisValue - scale) / (float)scale);
+  }
+  axis.ReleaseMutex();
 }
 
 void TargetEthController::AcquireButtonData(core::cvmatrix &button) {
-    uint8_t buttonValue;
-    int currentButton=0;
-    button.GetMutex();
-    /*
-    for (unsigned int i=0;i<buttonNumber;i++) {
-        memcpy(&buttonValue,buttonOffset+i*sizeof(bool),sizeof(bool));
-        dataSocket->NetworkToHost((char*)&buttonValue,sizeof(bool));
-        button.SetValueNoMutex(i,0,buttonValue);
-//        if (buttonValue) Thread::Info("Debug: button '%s' pressed\n", GetButtonName(i).c_str());
-    }*/
-    for (unsigned int i=0;i<buttonNumber/8;i++) {
-        memcpy(&buttonValue,dataFrameBuffer+buttonOffset+i*sizeof(uint8_t),sizeof(uint8_t));
-//        dataSocket->NetworkToHost((char*)&buttonValue,sizeof(uint8_t));
-        for(unsigned int j=0;j<8;j++) {
-            button.SetValueNoMutex(currentButton,0,(buttonValue>>j)&0x01);
-            currentButton++;
-        }
-    }
-    button.ReleaseMutex();
-}
-
-string TargetEthController::GetAxisName(unsigned int axisId) const{
-    //TODO: should throw an exception if axisName==NULL or axisId>axisNumber
-    return axisName[axisId];
-}
-
-string TargetEthController::GetButtonName(unsigned int buttonId) const{
-    //TODO: should throw an exception if buttonName==NULL or buttonId>buttonNumber
-    return buttonName[buttonId];
+  uint8_t buttonValue;
+  int currentButton = 0;
+  button.GetMutex();
+  /*
+  for (unsigned int i=0;i<buttonNumber;i++) {
+      memcpy(&buttonValue,buttonOffset+i*sizeof(bool),sizeof(bool));
+      dataSocket->NetworkToHost((char*)&buttonValue,sizeof(bool));
+      button.SetValueNoMutex(i,0,buttonValue);
+//        if (buttonValue) Thread::Info("Debug: button '%s' pressed\n",
+GetButtonName(i).c_str());
+  }*/
+  for (unsigned int i = 0; i < buttonNumber / 8; i++) {
+    memcpy(&buttonValue, dataFrameBuffer + buttonOffset + i * sizeof(uint8_t),
+           sizeof(uint8_t));
+    //        dataSocket->NetworkToHost((char*)&buttonValue,sizeof(uint8_t));
+    for (unsigned int j = 0; j < 8; j++) {
+      button.SetValueNoMutex(currentButton, 0, (buttonValue >> j) & 0x01);
+      currentButton++;
+    }
+  }
+  button.ReleaseMutex();
+}
+
+string TargetEthController::GetAxisName(unsigned int axisId) const {
+  // TODO: should throw an exception if axisName==NULL or axisId>axisNumber
+  return axisName[axisId];
+}
+
+string TargetEthController::GetButtonName(unsigned int buttonId) const {
+  // TODO: should throw an exception if buttonName==NULL or
+  // buttonId>buttonNumber
+  return buttonName[buttonId];
 }
 
 bool TargetEthController::ProcessMessage(Message *msg) {
-    return !(controlSocket->SendMessage(msg->buffer,msg->bufferSize,0)<0);
-}
-
-bool TargetEthController::IsControllerActionSupported(ControllerAction action) const {
-    //TODO: here we should ask the remote side (host). Probably through the control socket
-    switch(action) {
-    case ControllerAction::SetLedOn:
-        return true;
-    case ControllerAction::SetLedOff:
-        return true;
-    case ControllerAction::Rumble:
-        return true;
-    case ControllerAction::FlashLed:
-        return true;
-    default:
+  return !(controlSocket->SendMessage(msg->buffer, msg->bufferSize, 0) < 0);
+}
+
+bool TargetEthController::IsControllerActionSupported(
+    ControllerAction action) const {
+  // TODO: here we should ask the remote side (host). Probably through the
+  // control socket
+  switch (action) {
+  case ControllerAction::SetLedOn:
+    return true;
+  case ControllerAction::SetLedOff:
+    return true;
+  case ControllerAction::Rumble:
+    return true;
+  case ControllerAction::FlashLed:
+    return true;
+  default:
+    return false;
+  }
+}
+
+bool TargetEthController::ControllerInitialization() {
+  char message[1024];
+  ssize_t received;
+  bool connected = false;
+  bool mustReadMore;
+
+  listeningSocket->Listen(listeningPort);
+  Thread::Info("Debug: Listening to port %d\n", listeningPort);
+  // accept incoming connection
+  bool connectionAccepted = false;
+  while (!connectionAccepted) {
+    controlSocket = listeningSocket->Accept(10);
+    if (controlSocket == nullptr) {
+      // Timeout (or error btw)
+      if (ToBeStopped())
         return false;
-    }
-}
-
-bool TargetEthController::ControllerInitialization() {
-    char message[1024];
-    ssize_t received;
-    bool connected=false;
-    bool mustReadMore;
-
-    listeningSocket->Listen(listeningPort);
-    Thread::Info("Debug: Listening to port %d\n",listeningPort);
-                 //accept incoming connection
-    bool connectionAccepted=false;
-    while (!connectionAccepted) {
-        controlSocket=listeningSocket->Accept(10);
-        if (controlSocket==nullptr) {
-            //Timeout (or error btw)
-            if (ToBeStopped()) return false;
-        } else connectionAccepted=true;
-    }
-    Thread::Info("Debug: Connexion accepted\n");
-
-    //get axis stuff
-    bool axisNumberRead=false;
-    while (!axisNumberRead) {
-        try {
-            axisNumber=controlSocket->ReadUInt32(10);
-            //Thread::Info("Debug: axisNumber %d\n", axisNumber);
-            axisNumberRead=true;
-        }
-        catch (std::runtime_error e) {
-            //timeout
-            if (ToBeStopped()) return false;
-        }
-    }
-    bool bitsPerAxisRead=false;
-    while (!bitsPerAxisRead) {
-        try {
-            bitsPerAxis=controlSocket->ReadUInt32(10);
-            //Thread::Info("Debug: bits per axis %d\n", bitsPerAxis);
-            bitsPerAxisRead=true;
-        }
-        catch (std::runtime_error e) {
-            //timeout
-            if (ToBeStopped()) return false;
-        }
-    }
-    axisName=new string[axisNumber];
-    for (unsigned int i=0;i<axisNumber;i++) {
-        //read string size
-        int stringSize;
-        bool stringSizeRead=false;
-        while (!stringSizeRead) {
-            try {
-                stringSize=controlSocket->ReadUInt32(10);
-                stringSizeRead=true;
-            }
-            catch (std::runtime_error e) {
-                //timeout
-                if (ToBeStopped()) return false;
-            }
-        }
-        //read string
-        bool axisNameRead=false;
-        while (!axisNameRead) {
-            try {
-                axisName[i]=controlSocket->ReadString(stringSize,10);
-                axisNameRead=true;
-            }
-            catch (std::runtime_error e) {
-                //timeout
-                if (ToBeStopped()) return false;
-            }
-        }
-        //Thread::Info("Debug: axisName for axis %d %s\n", i, axisName[i].c_str());
-    }
-
-    //get button stuff
-    bool buttonNumberRead=false;
-    while (!buttonNumberRead) {
-        try {
-            buttonNumber=controlSocket->ReadUInt32(10);
-            buttonNumberRead=true;
-        }
-        catch (std::runtime_error e) {
-            //timeout
-            if (ToBeStopped()) return false;
-        }
-    }
-    //Thread::Info("Debug: buttonNumber %d\n", buttonNumber);
-    buttonName=new string[buttonNumber];
-    for (unsigned int i=0;i<buttonNumber;i++) {
-        //read string size
-        int stringSize;
-        bool stringSizeRead=false;
-        while (!stringSizeRead) {
-            try {
-                stringSize=controlSocket->ReadUInt32(10);
-                stringSizeRead=true;
-            }
-            catch (std::runtime_error e) {
-                //timeout
-                if (ToBeStopped()) return false;
-            }
-        }
-        //read string
-        bool buttonNameRead=false;
-        while (!buttonNameRead) {
-            try {
-                buttonName[i]=controlSocket->ReadString(stringSize,10);
-                buttonNameRead=true;
-            }
-            catch (std::runtime_error e) {
-                //timeout
-                if (ToBeStopped()) return false;
-            }
-        }
-        //Thread::Info("Debug: buttonName for button %d %s\n", i, buttonName[i].c_str());
-    }
-
-//    dataFrameSize=axisNumber*sizeof(float)+buttonNumber/8*sizeof(uint8_t);
-    buttonOffset=(axisNumber*bitsPerAxis)/8;
-    if ((axisNumber*bitsPerAxis)%8!=0) buttonOffset++;
-    dataFrameSize=buttonOffset+(buttonNumber/8)*sizeof(uint8_t);
-    if ((buttonNumber%8)!=0) dataFrameSize++;
-    dataFrameBuffer=new char[dataFrameSize];
-    receiveFrameBuffer=new char[dataFrameSize];
-
-    Thread::Info("Controller connected with host side\n");
-    if(buttonNumber%8!=0) Thread::Err("Button number is not multiple of 8\n");
-    return true;
+    } else
+      connectionAccepted = true;
+  }
+  Thread::Info("Debug: Connexion accepted\n");
+
+  // get axis stuff
+  bool axisNumberRead = false;
+  while (!axisNumberRead) {
+    try {
+      axisNumber = controlSocket->ReadUInt32(10);
+      // Thread::Info("Debug: axisNumber %d\n", axisNumber);
+      axisNumberRead = true;
+    } catch (std::runtime_error e) {
+      // timeout
+      if (ToBeStopped())
+        return false;
+    }
+  }
+  bool bitsPerAxisRead = false;
+  while (!bitsPerAxisRead) {
+    try {
+      bitsPerAxis = controlSocket->ReadUInt32(10);
+      // Thread::Info("Debug: bits per axis %d\n", bitsPerAxis);
+      bitsPerAxisRead = true;
+    } catch (std::runtime_error e) {
+      // timeout
+      if (ToBeStopped())
+        return false;
+    }
+  }
+  axisName = new string[axisNumber];
+  for (unsigned int i = 0; i < axisNumber; i++) {
+    // read string size
+    int stringSize;
+    bool stringSizeRead = false;
+    while (!stringSizeRead) {
+      try {
+        stringSize = controlSocket->ReadUInt32(10);
+        stringSizeRead = true;
+      } catch (std::runtime_error e) {
+        // timeout
+        if (ToBeStopped())
+          return false;
+      }
+    }
+    // read string
+    bool axisNameRead = false;
+    while (!axisNameRead) {
+      try {
+        axisName[i] = controlSocket->ReadString(stringSize, 10);
+        axisNameRead = true;
+      } catch (std::runtime_error e) {
+        // timeout
+        if (ToBeStopped())
+          return false;
+      }
+    }
+    // Thread::Info("Debug: axisName for axis %d %s\n", i, axisName[i].c_str());
+  }
+
+  // get button stuff
+  bool buttonNumberRead = false;
+  while (!buttonNumberRead) {
+    try {
+      buttonNumber = controlSocket->ReadUInt32(10);
+      buttonNumberRead = true;
+    } catch (std::runtime_error e) {
+      // timeout
+      if (ToBeStopped())
+        return false;
+    }
+  }
+  // Thread::Info("Debug: buttonNumber %d\n", buttonNumber);
+  buttonName = new string[buttonNumber];
+  for (unsigned int i = 0; i < buttonNumber; i++) {
+    // read string size
+    int stringSize;
+    bool stringSizeRead = false;
+    while (!stringSizeRead) {
+      try {
+        stringSize = controlSocket->ReadUInt32(10);
+        stringSizeRead = true;
+      } catch (std::runtime_error e) {
+        // timeout
+        if (ToBeStopped())
+          return false;
+      }
+    }
+    // read string
+    bool buttonNameRead = false;
+    while (!buttonNameRead) {
+      try {
+        buttonName[i] = controlSocket->ReadString(stringSize, 10);
+        buttonNameRead = true;
+      } catch (std::runtime_error e) {
+        // timeout
+        if (ToBeStopped())
+          return false;
+      }
+    }
+    // Thread::Info("Debug: buttonName for button %d %s\n", i,
+    // buttonName[i].c_str());
+  }
+
+  //    dataFrameSize=axisNumber*sizeof(float)+buttonNumber/8*sizeof(uint8_t);
+  buttonOffset = (axisNumber * bitsPerAxis) / 8;
+  if ((axisNumber * bitsPerAxis) % 8 != 0)
+    buttonOffset++;
+  dataFrameSize = buttonOffset + (buttonNumber / 8) * sizeof(uint8_t);
+  if ((buttonNumber % 8) != 0)
+    dataFrameSize++;
+  dataFrameBuffer = new char[dataFrameSize];
+  receiveFrameBuffer = new char[dataFrameSize];
+
+  Thread::Info("Controller connected with host side\n");
+  if (buttonNumber % 8 != 0)
+    Thread::Err("Button number is not multiple of 8\n");
+  return true;
 }
 
Index: trunk/lib/FlairSensorActuator/src/TargetEthController.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/TargetEthController.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/TargetEthController.h	(revision 15)
@@ -12,5 +12,6 @@
 //
 //  purpose:    class that gets remote controls through an ethernet connection.
-//              Typical use case: a remote control is plugged in a workstation and sends remote control
+//              Typical use case: a remote control is plugged in a workstation
+//              and sends remote control
 //              data to a distant target (this class) through Wifi
 //
@@ -24,62 +25,68 @@
 
 namespace flair {
-    namespace core {
-        class FrameworkManager;
-        class cvmatrix;
-        class TcpSocket;
-        class Socket;
-    }
-    namespace gui {
-        class Tab;
-        class TabWidget;
-        class DataPlot1D;
-    }
+namespace core {
+class FrameworkManager;
+class cvmatrix;
+class TcpSocket;
+class Socket;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class DataPlot1D;
+}
 }
 
-namespace flair { namespace sensor {
-    /*! \class TargetController
-    *
-    * \brief Base Class for target side remote controls
-    *
-    */
-    class TargetEthController : public TargetController {
-    public:
-        TargetEthController(const core::FrameworkManager* parent,std::string name,uint16_t port,uint8_t priority=0);
-        ~TargetEthController();
-        //void DrawUserInterface();
-    protected:
-        bool IsConnected() const;
-        //axis stuff
-        std::string GetAxisName(unsigned int axisId) const;
-        //button stuff
-        std::string GetButtonName(unsigned int axisId) const;
-        //controller state stuff
-        bool ProcessMessage(core::Message *msg);
-        bool IsControllerActionSupported(ControllerAction action) const;
+namespace flair {
+namespace sensor {
+/*! \class TargetController
+*
+* \brief Base Class for target side remote controls
+*
+*/
+class TargetEthController : public TargetController {
+public:
+  TargetEthController(const core::FrameworkManager *parent, std::string name,
+                      uint16_t port, uint8_t priority = 0);
+  ~TargetEthController();
+  // void DrawUserInterface();
+protected:
+  bool IsConnected() const;
+  // axis stuff
+  std::string GetAxisName(unsigned int axisId) const;
+  // button stuff
+  std::string GetButtonName(unsigned int axisId) const;
+  // controller state stuff
+  bool ProcessMessage(core::Message *msg);
+  bool IsControllerActionSupported(ControllerAction action) const;
 
-        bool IsDataFrameReady();
-        void AcquireAxisData(core::cvmatrix &axis); //responsible for getting the axis data from the hardware
-        void AcquireButtonData(core::cvmatrix &button); //responsible for getting the button data from the hardware
+  bool IsDataFrameReady();
+  void AcquireAxisData(core::cvmatrix &axis); // responsible for getting the
+                                              // axis data from the hardware
+  void AcquireButtonData(core::cvmatrix &button); // responsible for getting the
+                                                  // button data from the
+                                                  // hardware
 
-        bool ControllerInitialization();
+  bool ControllerInitialization();
 
-    private:
-        uint16_t readBits(uint8_t offsetInBits,uint8_t valueSizeInBits,char *buffer,size_t bufferSize);
-        uint8_t getByteOrNull(char *buffer,int byte,size_t bufferSize);
-        uint32_t charBufferToUint32(char *buffer, size_t bufferSize);
-        core::TcpSocket *listeningSocket;
-        int listeningPort;
-        core::TcpSocket *controlSocket=NULL;
-        core::Socket *dataSocket;
-        std::string *axisName=NULL;
-        std::string *buttonName=NULL;
-        size_t dataFrameSize;
-        char *dataFrameBuffer;
-        char *receiveFrameBuffer;
-        size_t receiveCurrentPosition;
-        uint8_t buttonOffset;
-    };
-
-}}
+private:
+  uint16_t readBits(uint8_t offsetInBits, uint8_t valueSizeInBits, char *buffer,
+                    size_t bufferSize);
+  uint8_t getByteOrNull(char *buffer, int byte, size_t bufferSize);
+  uint32_t charBufferToUint32(char *buffer, size_t bufferSize);
+  core::TcpSocket *listeningSocket;
+  int listeningPort;
+  core::TcpSocket *controlSocket = NULL;
+  core::Socket *dataSocket;
+  std::string *axisName = NULL;
+  std::string *buttonName = NULL;
+  size_t dataFrameSize;
+  char *dataFrameBuffer;
+  char *receiveFrameBuffer;
+  size_t receiveCurrentPosition;
+  uint8_t buttonOffset;
+};
+}
+}
 
 #endif // TARGETCONTROLLER_H
Index: trunk/lib/FlairSensorActuator/src/UsRangeFinder.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/UsRangeFinder.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/UsRangeFinder.cpp	(revision 15)
@@ -29,88 +29,67 @@
 using namespace flair::gui;
 
-namespace flair
-{
-namespace sensor
-{
+namespace flair {
+namespace sensor {
 
-UsRangeFinder::UsRangeFinder(const FrameworkManager* parent,string name) : IODevice(parent,name)
-{
-    plot_tab=NULL;
+UsRangeFinder::UsRangeFinder(const FrameworkManager *parent, string name)
+    : IODevice(parent, name) {
+  plot_tab = NULL;
 
-    cvmatrix_descriptor* desc=new cvmatrix_descriptor(1,1);
-    desc->SetElementName(0,0,name);
-    output=new cvmatrix(this,desc,floatType);
-    AddDataToLog(output);
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(1, 1);
+  desc->SetElementName(0, 0, name);
+  output = new cvmatrix(this, desc, floatType);
+  AddDataToLog(output);
 
-    //station sol
-    main_tab=new Tab(parent->GetTabWidget(),name);
-    tab=new TabWidget(main_tab->NewRow(),name);
-	sensor_tab=new Tab(tab,"Reglages");
-	setup_groupbox=new GroupBox(sensor_tab->NewRow(),name);
+  // station sol
+  main_tab = new Tab(parent->GetTabWidget(), name);
+  tab = new TabWidget(main_tab->NewRow(), name);
+  sensor_tab = new Tab(tab, "Reglages");
+  setup_groupbox = new GroupBox(sensor_tab->NewRow(), name);
 }
 
-UsRangeFinder::UsRangeFinder(const IODevice* parent,std::string name) : IODevice(parent,name)
-{
-    plot_tab=NULL;
-    main_tab=NULL;
-    tab=NULL;
-	sensor_tab=NULL;
-	setup_groupbox=NULL;
+UsRangeFinder::UsRangeFinder(const IODevice *parent, std::string name)
+    : IODevice(parent, name) {
+  plot_tab = NULL;
+  main_tab = NULL;
+  tab = NULL;
+  sensor_tab = NULL;
+  setup_groupbox = NULL;
 
-    output=NULL;
+  output = NULL;
 }
 
-UsRangeFinder::~UsRangeFinder()
-{
-    if(main_tab!=NULL) delete main_tab;
+UsRangeFinder::~UsRangeFinder() {
+  if (main_tab != NULL)
+    delete main_tab;
 }
 
-GroupBox* UsRangeFinder::GetGroupBox(void) const
-{
-    return setup_groupbox;
+GroupBox *UsRangeFinder::GetGroupBox(void) const { return setup_groupbox; }
+
+Layout *UsRangeFinder::GetLayout(void) const { return sensor_tab; }
+
+DataPlot1D *UsRangeFinder::GetPlot(void) const { return plot; }
+
+Tab *UsRangeFinder::GetPlotTab(void) const { return plot_tab; }
+
+void UsRangeFinder::UseDefaultPlot(void) {
+  if (tab == NULL) {
+    Err("not applicable for simulation part.\n");
+    return;
+  }
+
+  plot_tab = new Tab(tab, "Mesures");
+  plot = new DataPlot1D(plot_tab->NewRow(), ObjectName(), 0, 2);
+  plot->AddCurve(output->Element(0));
 }
 
-Layout* UsRangeFinder::GetLayout(void) const
-{
-    return sensor_tab;
+void UsRangeFinder::LockUserInterface(void) const {
+  setup_groupbox->setEnabled(false);
 }
 
-DataPlot1D* UsRangeFinder::GetPlot(void) const
-{
-    return plot;
+void UsRangeFinder::UnlockUserInterface(void) const {
+  setup_groupbox->setEnabled(true);
 }
 
-Tab* UsRangeFinder::GetPlotTab(void) const
-{
-    return plot_tab;
-}
-
-void UsRangeFinder::UseDefaultPlot(void)
-{
-    if(tab==NULL)
-    {
-        Err("not applicable for simulation part.\n");
-        return;
-    }
-
-    plot_tab=new Tab(tab,"Mesures");
-        plot=new DataPlot1D(plot_tab->NewRow(),ObjectName(),0,2);
-            plot->AddCurve(output->Element(0));
-}
-
-void UsRangeFinder::LockUserInterface(void) const
-{
-    setup_groupbox->setEnabled(false);
-}
-
-void UsRangeFinder::UnlockUserInterface(void) const
-{
-    setup_groupbox->setEnabled(true);
-}
-
-float UsRangeFinder::Value(void) const
-{
-    return output->Value(0,0);
-}
+float UsRangeFinder::Value(void) const { return output->Value(0, 0); }
 
 } // end namespace sensor
Index: trunk/lib/FlairSensorActuator/src/UsRangeFinder.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/UsRangeFinder.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/UsRangeFinder.h	(revision 15)
@@ -16,139 +16,133 @@
 #include <IODevice.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class cvmatrix;
-    }
-    namespace gui
-    {
-        class Tab;
-        class TabWidget;
-        class GroupBox;
-        class Layout;
-        class DataPlot1D;
-    }
+namespace flair {
+namespace core {
+class cvmatrix;
+}
+namespace gui {
+class Tab;
+class TabWidget;
+class GroupBox;
+class Layout;
+class DataPlot1D;
+}
 }
 
-namespace flair
-{
-namespace sensor
-{
-    /*! \class UsRangeFinder
-    *
-    * \brief Base class for UsRangeFinder
-    *
-    * Use this class to define a custom UsRangeFinder.
-    *
-    */
-    class UsRangeFinder : public core::IODevice
-    {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a UsRangeFinder. Control part.
-            *
-            * \param parent parent
-            * \param name name
-            */
-            UsRangeFinder(const core::FrameworkManager* parent,std::string name);
+namespace flair {
+namespace sensor {
+/*! \class UsRangeFinder
+*
+* \brief Base class for UsRangeFinder
+*
+* Use this class to define a custom UsRangeFinder.
+*
+*/
+class UsRangeFinder : public core::IODevice {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a UsRangeFinder. Control part.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  UsRangeFinder(const core::FrameworkManager *parent, std::string name);
 
-            /*!
-            * \brief Constructor
-            *
-            * Construct a UsRangeFinder. Simulation part.
-            *
-            * \param parent parent
-            * \param name name
-            */
-            UsRangeFinder(const core::IODevice* parent,std::string name);
+  /*!
+  * \brief Constructor
+  *
+  * Construct a UsRangeFinder. Simulation part.
+  *
+  * \param parent parent
+  * \param name name
+  */
+  UsRangeFinder(const core::IODevice *parent, std::string name);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~UsRangeFinder();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~UsRangeFinder();
 
-            /*!
-            * \brief Lock user interface
-            *
-            */
-            void LockUserInterface(void) const;
+  /*!
+  * \brief Lock user interface
+  *
+  */
+  void LockUserInterface(void) const;
 
-            /*!
-            * \brief Unlock user interface
-            *
-            */
-            void UnlockUserInterface(void) const;
+  /*!
+  * \brief Unlock user interface
+  *
+  */
+  void UnlockUserInterface(void) const;
 
-            /*!
-            * \brief Use default plot
-            *
-            * Should no be used for the simulation part.
-            */
-            void UseDefaultPlot(void);
+  /*!
+  * \brief Use default plot
+  *
+  * Should no be used for the simulation part.
+  */
+  void UseDefaultPlot(void);
 
-            /*!
-            * \brief Plot
-            *
-            * \return DataPlot1D
-            */
-            gui::DataPlot1D* GetPlot(void) const;
+  /*!
+  * \brief Plot
+  *
+  * \return DataPlot1D
+  */
+  gui::DataPlot1D *GetPlot(void) const;
 
-            /*!
-            * \brief Setup Layout
-            *
-            * \return a Layout available
-            */
-            gui::Layout* GetLayout(void) const;
+  /*!
+  * \brief Setup Layout
+  *
+  * \return a Layout available
+  */
+  gui::Layout *GetLayout(void) const;
 
-            /*!
-            * \brief Plot tab
-            *
-            * \return plot Tab
-            */
-            gui::Tab* GetPlotTab(void) const;
+  /*!
+  * \brief Plot tab
+  *
+  * \return plot Tab
+  */
+  gui::Tab *GetPlotTab(void) const;
 
-            /*!
-            * \brief Value
-            *
-            * \return output value
-            */
-            float Value(void) const;
+  /*!
+  * \brief Value
+  *
+  * \return output value
+  */
+  float Value(void) const;
 
-        protected:
-            /*!
-            * \brief Output matrix
-            *
-            * \return output matrix
-            */
-            core::cvmatrix *output;
+protected:
+  /*!
+  * \brief Output matrix
+  *
+  * \return output matrix
+  */
+  core::cvmatrix *output;
 
-            /*!
-            * \brief Setup GroupBox
-            *
-            * \return a GroupBox available
-            */
-            gui::GroupBox* GetGroupBox(void) const;
+  /*!
+  * \brief Setup GroupBox
+  *
+  * \return a GroupBox available
+  */
+  gui::GroupBox *GetGroupBox(void) const;
 
-        private:
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data){};
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
 
-            gui::Tab* main_tab;
-            gui::TabWidget *tab;
-            gui::GroupBox* setup_groupbox;
-            gui::Tab* sensor_tab;
-            gui::DataPlot1D* plot;
-            gui::Tab* plot_tab;
-    };
+  gui::Tab *main_tab;
+  gui::TabWidget *tab;
+  gui::GroupBox *setup_groupbox;
+  gui::Tab *sensor_tab;
+  gui::DataPlot1D *plot;
+  gui::Tab *plot_tab;
+};
 } // end namespace sensor
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/V4LCamera.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/V4LCamera.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/V4LCamera.cpp	(revision 15)
@@ -30,172 +30,167 @@
 using namespace flair::gui;
 
-namespace flair
-{
-namespace sensor
-{
+namespace flair {
+namespace sensor {
 
-V4LCamera::V4LCamera(const FrameworkManager* parent,string name,uint8_t camera_index,uint16_t width,uint16_t height,cvimage::Type::Format format,uint8_t priority) : Thread(parent,name,priority), Camera(parent,name,width,height,format)
-{
-    capture = cvCaptureFromCAM(camera_index);//a mettre apres l'init dsp
+V4LCamera::V4LCamera(const FrameworkManager *parent, string name,
+                     uint8_t camera_index, uint16_t width, uint16_t height,
+                     cvimage::Type::Format format, uint8_t priority)
+    : Thread(parent, name, priority),
+      Camera(parent, name, width, height, format) {
+  capture = cvCaptureFromCAM(camera_index); // a mettre apres l'init dsp
 
-    if(capture<0) Thread::Err("cvCaptureFromCAM error\n");
+  if (capture < 0)
+    Thread::Err("cvCaptureFromCAM error\n");
 
-    if(cvSetCaptureProperty(capture,CV_CAP_PROP_FRAME_WIDTH,width)<0) Thread::Err("cvSetCaptureProperty error\n");
-    if(cvSetCaptureProperty(capture,CV_CAP_PROP_FRAME_HEIGHT,height)<0) Thread::Err("cvSetCaptureProperty error\n");
+  if (cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, width) < 0)
+    Thread::Err("cvSetCaptureProperty error\n");
+  if (cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, height) < 0)
+    Thread::Err("cvSetCaptureProperty error\n");
 
-    if(format==cvimage::Type::Format::UYVY)
-    {
-        if(cvSetCaptureProperty(capture,CV_CAP_PROP_FORMAT,V4L2_PIX_FMT_UYVY)<0) Thread::Err("cvSetCaptureProperty error\n");
-    }
-    else if(format==cvimage::Type::Format::YUYV)
-    {
-        if(cvSetCaptureProperty(capture,CV_CAP_PROP_FORMAT,V4L2_PIX_FMT_YUYV)<0) Thread::Err("cvSetCaptureProperty error\n");
-    }
-    else
-    {
-        Thread::Err("format not supported\n");
+  if (format == cvimage::Type::Format::UYVY) {
+    if (cvSetCaptureProperty(capture, CV_CAP_PROP_FORMAT, V4L2_PIX_FMT_UYVY) <
+        0)
+      Thread::Err("cvSetCaptureProperty error\n");
+  } else if (format == cvimage::Type::Format::YUYV) {
+    if (cvSetCaptureProperty(capture, CV_CAP_PROP_FORMAT, V4L2_PIX_FMT_YUYV) <
+        0)
+      Thread::Err("cvSetCaptureProperty error\n");
+  } else {
+    Thread::Err("format not supported\n");
+  }
+
+  // station sol
+  gain = new DoubleSpinBox(GetGroupBox()->NewRow(), "gain:", 0, 1, 0.1);
+  exposure = new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "exposure:", 0,
+                               1, 0.1);
+  bright =
+      new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "bright:", 0, 1, 0.1);
+  contrast = new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "contrast:", 0,
+                               1, 0.1);
+  hue = new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "hue:", 0, 1, 0.1);
+  sharpness = new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "sharpness:",
+                                0, 1, 0.1);
+  sat = new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "saturation:", 0, 1,
+                          0.1);
+  autogain = new CheckBox(GetGroupBox()->NewRow(), "autogain:");
+  autoexposure = new CheckBox(GetGroupBox()->LastRowLastCol(), "autoexposure:");
+  awb = new CheckBox(GetGroupBox()->LastRowLastCol(), "awb:");
+  fps = new Label(GetGroupBox()->NewRow(), "fps");
+}
+
+V4LCamera::~V4LCamera() {
+  SafeStop();
+  Join();
+}
+
+void V4LCamera::Run(void) {
+  Time cam_time, new_time, fpsNow, fpsPrev;
+  IplImage *img; // raw image
+  int fpsCounter = 0;
+
+  // init image old
+  if (!cvGrabFrame(capture)) {
+    Printf("Could not grab a frame\n");
+  }
+  cam_time = GetTime();
+  fpsPrev = cam_time;
+
+  while (!ToBeStopped()) {
+    // fps counter
+    fpsCounter++;
+    if (fpsCounter == 100) {
+      fpsNow = GetTime();
+      fps->SetText("fps: %.1f",
+                   fpsCounter / ((float)(fpsNow - fpsPrev) / 1000000000.));
+      fpsCounter = 0;
+      fpsPrev = fpsNow;
     }
 
-    //station sol
-    gain=new DoubleSpinBox(GetGroupBox()->NewRow(),"gain:",0,1,0.1);
-    exposure=new DoubleSpinBox(GetGroupBox()->LastRowLastCol(),"exposure:",0,1,0.1);
-    bright=new DoubleSpinBox(GetGroupBox()->LastRowLastCol(),"bright:",0,1,0.1);
-    contrast=new DoubleSpinBox(GetGroupBox()->LastRowLastCol(),"contrast:",0,1,0.1);
-    hue=new DoubleSpinBox(GetGroupBox()->LastRowLastCol(),"hue:",0,1,0.1);
-    sharpness=new DoubleSpinBox(GetGroupBox()->LastRowLastCol(),"sharpness:",0,1,0.1);
-    sat=new DoubleSpinBox(GetGroupBox()->LastRowLastCol(),"saturation:",0,1,0.1);
-    autogain=new CheckBox(GetGroupBox()->NewRow(),"autogain:");
-    autoexposure=new CheckBox(GetGroupBox()->LastRowLastCol(),"autoexposure:");
-    awb=new CheckBox(GetGroupBox()->LastRowLastCol(),"awb:");
-    fps=new Label(GetGroupBox()->NewRow(),"fps");
+    // cam properties
+    if (gain->ValueChanged() == true && autogain->Value() == false)
+      SetGain(gain->Value());
+    if (exposure->ValueChanged() == true && autoexposure->Value() == false)
+      SetExposure(exposure->Value());
+    if (bright->ValueChanged() == true)
+      SetBrightness(bright->Value());
+    if (sat->ValueChanged() == true)
+      SetSaturation(sat->Value());
+    if (contrast->ValueChanged() == true)
+      SetContrast(contrast->Value());
+    if (hue->ValueChanged() == true)
+      SetHue(hue->Value());
+    if (sharpness->ValueChanged() == true)
+      cvSetCaptureProperty(capture, CV_CAP_PROP_SHARPNESS, sharpness->Value());
+    if (autogain->ValueChanged() == true) {
+      if (autogain->Value() == true) {
+        gain->setEnabled(false);
+      } else {
+        gain->setEnabled(true);
+        SetGain(gain->Value());
+      }
+      SetAutoGain(autogain->Value());
+    }
+    if (autoexposure->ValueChanged() == true) {
+      if (autoexposure->Value() == true) {
+        exposure->setEnabled(false);
+      } else {
+        exposure->setEnabled(true);
+        SetExposure(exposure->Value());
+      }
+      SetAutoExposure(autoexposure->Value());
+    }
+    if (awb->ValueChanged() == true)
+      cvSetCaptureProperty(capture, CV_CAP_PROP_AWB, awb->Value());
+
+    // cam pictures
+    img = cvRetrieveRawFrame(capture);
+    if (!cvGrabFrame(capture)) {
+      Printf("Could not grab a frame\n");
+    }
+    new_time = GetTime();
+
+    output->GetMutex();
+    output->img->imageData = img->imageData;
+    output->ReleaseMutex();
+
+    output->SetDataTime(cam_time);
+    ProcessUpdate(output);
+
+    cam_time = new_time;
+  }
+
+  cvReleaseCapture(&capture);
 }
 
-V4LCamera::~V4LCamera()
-{
-    SafeStop();
-    Join();
+void V4LCamera::SetAutoGain(bool value) {
+  cvSetCaptureProperty(capture, CV_CAP_PROP_AUTOGAIN, value);
 }
 
-void V4LCamera::Run(void)
-{
-    Time cam_time,new_time,fpsNow,fpsPrev;
-    IplImage* img;//raw image
-    int fpsCounter=0;
-
-    //init image old
-    if(!cvGrabFrame(capture))
-    {
-        Printf("Could not grab a frame\n");
-    }
-    cam_time=GetTime();
-    fpsPrev = cam_time;
-
-    while(!ToBeStopped())
-    {
-        //fps counter
-        fpsCounter++;
-        if(fpsCounter==100) {
-            fpsNow = GetTime();
-            fps->SetText("fps: %.1f",fpsCounter/((float)(fpsNow - fpsPrev)/1000000000.));
-            fpsCounter=0;
-            fpsPrev=fpsNow;
-        }
-
-        //cam properties
-        if(gain->ValueChanged()==true && autogain->Value()==false) SetGain(gain->Value());
-        if(exposure->ValueChanged()==true && autoexposure->Value()==false) SetExposure(exposure->Value());
-        if(bright->ValueChanged()==true) SetBrightness(bright->Value());
-        if(sat->ValueChanged()==true) SetSaturation(sat->Value());
-        if(contrast->ValueChanged()==true) SetContrast(contrast->Value());
-        if(hue->ValueChanged()==true) SetHue(hue->Value());
-        if(sharpness->ValueChanged()==true) cvSetCaptureProperty(capture,CV_CAP_PROP_SHARPNESS,sharpness->Value());
-        if(autogain->ValueChanged()==true)
-        {
-            if(autogain->Value()==true)
-            {
-                gain->setEnabled(false);
-            }
-            else
-            {
-                gain->setEnabled(true);
-                SetGain(gain->Value());
-            }
-            SetAutoGain(autogain->Value());
-        }
-        if(autoexposure->ValueChanged()==true)
-        {
-            if(autoexposure->Value()==true)
-            {
-                exposure->setEnabled(false);
-            }
-            else
-            {
-                exposure->setEnabled(true);
-                SetExposure(exposure->Value());
-            }
-            SetAutoExposure(autoexposure->Value());
-        }
-        if(awb->ValueChanged()==true) cvSetCaptureProperty(capture,CV_CAP_PROP_AWB,awb->Value());
-
-
-        //cam pictures
-        img=cvRetrieveRawFrame(capture);
-        if(!cvGrabFrame(capture))
-        {
-            Printf("Could not grab a frame\n");
-        }
-        new_time=GetTime();
-
-        output->GetMutex();
-        output->img->imageData=img->imageData;
-        output->ReleaseMutex();
-
-        output->SetDataTime(cam_time);
-        ProcessUpdate(output);
-
-        cam_time=new_time;
-    }
-
-    cvReleaseCapture(&capture);
+void V4LCamera::SetAutoExposure(bool value) {
+  Thread::Warn("not implemented in opencv\n");
 }
 
-void V4LCamera::SetAutoGain(bool value)
-{
-    cvSetCaptureProperty(capture,CV_CAP_PROP_AUTOGAIN,value);
+void V4LCamera::SetGain(float value) {
+  cvSetCaptureProperty(capture, CV_CAP_PROP_GAIN, value);
 }
 
-void V4LCamera::SetAutoExposure(bool value)
-{
-    Thread::Warn("not implemented in opencv\n");
+void V4LCamera::SetExposure(float value) {
+  cvSetCaptureProperty(capture, CV_CAP_PROP_EXPOSURE, value);
 }
 
-void V4LCamera::SetGain(float value)
-{
-    cvSetCaptureProperty(capture,CV_CAP_PROP_GAIN,value);
+void V4LCamera::SetBrightness(float value) {
+  cvSetCaptureProperty(capture, CV_CAP_PROP_BRIGHTNESS, value);
 }
 
-void V4LCamera::SetExposure(float value)
-{
-    cvSetCaptureProperty(capture,CV_CAP_PROP_EXPOSURE,value);
+void V4LCamera::SetSaturation(float value) {
+  cvSetCaptureProperty(capture, CV_CAP_PROP_SATURATION, value);
 }
 
-void V4LCamera::SetBrightness(float value)
-{
-    cvSetCaptureProperty(capture,CV_CAP_PROP_BRIGHTNESS,value);
+void V4LCamera::SetHue(float value) {
+  cvSetCaptureProperty(capture, CV_CAP_PROP_HUE, value);
 }
 
-void V4LCamera::SetSaturation(float value)
-{
-    cvSetCaptureProperty(capture,CV_CAP_PROP_SATURATION,value);
-}
-
-void V4LCamera::SetHue(float value)
-{
-    cvSetCaptureProperty(capture,CV_CAP_PROP_HUE,value);
-}
-
-void V4LCamera::SetContrast(float value)
-{
-    cvSetCaptureProperty(capture,CV_CAP_PROP_CONTRAST,value);
+void V4LCamera::SetContrast(float value) {
+  cvSetCaptureProperty(capture, CV_CAP_PROP_CONTRAST, value);
 }
 
Index: trunk/lib/FlairSensorActuator/src/V4LCamera.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/V4LCamera.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/V4LCamera.h	(revision 15)
@@ -18,134 +18,131 @@
 #include <highgui.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class cvimage;
-        class FrameworkManager;
-    }
-    namespace gui
-    {
-        class GridLayout;
-        class DoubleSpinBox;
-        class CheckBox;
-        class Label;
-    }
+namespace flair {
+namespace core {
+class cvimage;
+class FrameworkManager;
+}
+namespace gui {
+class GridLayout;
+class DoubleSpinBox;
+class CheckBox;
+class Label;
+}
 }
 
-namespace flair
-{
-namespace sensor
-{
-    /*! \class V4LCamera
-    *
-    * \brief Base class for V4l camera
-    */
-    class V4LCamera : public core::Thread, public Camera
-    {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a Camera.
-            *
-            * \param parent parent
-            * \param name name
-            * \param camera_index camera index
-            * \param width width
-            * \param height height
-            * \param format image format
-            * \param priority priority of the Thread
-            */
-            V4LCamera(const core::FrameworkManager* parent,std::string name,uint8_t camera_index,uint16_t width,uint16_t height,core::cvimage::Type::Format format,uint8_t priority);
+namespace flair {
+namespace sensor {
+/*! \class V4LCamera
+*
+* \brief Base class for V4l camera
+*/
+class V4LCamera : public core::Thread, public Camera {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a Camera.
+  *
+  * \param parent parent
+  * \param name name
+  * \param camera_index camera index
+  * \param width width
+  * \param height height
+  * \param format image format
+  * \param priority priority of the Thread
+  */
+  V4LCamera(const core::FrameworkManager *parent, std::string name,
+            uint8_t camera_index, uint16_t width, uint16_t height,
+            core::cvimage::Type::Format format, uint8_t priority);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~V4LCamera();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~V4LCamera();
 
-        protected:
-            /*!
-            * \brief Set Gain
-            *
-            * \param value value between 0 and 1
-            */
-            virtual void SetGain(float value);
+protected:
+  /*!
+  * \brief Set Gain
+  *
+  * \param value value between 0 and 1
+  */
+  virtual void SetGain(float value);
 
-            /*!
-            * \brief Set Auto Gain
-            *
-            * \param value value
-            */
-            virtual void SetAutoGain(bool value);
+  /*!
+  * \brief Set Auto Gain
+  *
+  * \param value value
+  */
+  virtual void SetAutoGain(bool value);
 
-            /*!
-            * \brief Set Exposure
-            *
-            * \param value value between 0 and 1
-            */
-            virtual void SetExposure(float value);
+  /*!
+  * \brief Set Exposure
+  *
+  * \param value value between 0 and 1
+  */
+  virtual void SetExposure(float value);
 
-            /*!
-            * \brief Set Auto Exposure
-            *
-            * \param value value
-            */
-            virtual void SetAutoExposure(bool value);
+  /*!
+  * \brief Set Auto Exposure
+  *
+  * \param value value
+  */
+  virtual void SetAutoExposure(bool value);
 
-            /*!
-            * \brief Set Brightness
-            *
-            * \param value value between 0 and 1
-            */
-            virtual void SetBrightness(float value);
+  /*!
+  * \brief Set Brightness
+  *
+  * \param value value between 0 and 1
+  */
+  virtual void SetBrightness(float value);
 
-            /*!
-            * \brief Set Saturation
-            *
-            * \param value value between 0 and 1
-            */
-            virtual void SetSaturation(float value);
+  /*!
+  * \brief Set Saturation
+  *
+  * \param value value between 0 and 1
+  */
+  virtual void SetSaturation(float value);
 
-            /*!
-            * \brief Set Hue
-            *
-            * \param value value between 0 and 1
-            */
-            virtual void SetHue(float value);
+  /*!
+  * \brief Set Hue
+  *
+  * \param value value between 0 and 1
+  */
+  virtual void SetHue(float value);
 
-            /*!
-            * \brief Set Contrast
-            *
-            * \param value value between 0 and 1
-            */
-            virtual void SetContrast(float value);
+  /*!
+  * \brief Set Contrast
+  *
+  * \param value value between 0 and 1
+  */
+  virtual void SetContrast(float value);
 
-        private:
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data){};
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
 
-            /*!
-            * \brief Run function
-            *
-            * Reimplemented from Thread.
-            *
-            */
-            void Run(void);
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
 
-            CvCapture* capture;
+  CvCapture *capture;
 
-            gui::Tab* sensor_tab;
-            gui::DoubleSpinBox *bright,*exposure,*gain,*contrast,*hue,*sharpness,*sat;
-            gui::CheckBox *autogain,*awb,*autoexposure;
-            gui::Label *fps;
-    };
+  gui::Tab *sensor_tab;
+  gui::DoubleSpinBox *bright, *exposure, *gain, *contrast, *hue, *sharpness,
+      *sat;
+  gui::CheckBox *autogain, *awb, *autoexposure;
+  gui::Label *fps;
+};
 } // end namespace sensor
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/VrpnClient.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/VrpnClient.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/VrpnClient.cpp	(revision 15)
@@ -26,46 +26,36 @@
 using namespace flair::gui;
 
-namespace flair
-{
-namespace sensor
-{
+namespace flair {
+namespace sensor {
 
-VrpnClient::VrpnClient(const FrameworkManager* parent,string name,string address,uint16_t us_period,uint8_t priority): Thread(parent,name,priority)
-{
-    pimpl_=new VrpnClient_impl(this,name,address,us_period);
+VrpnClient::VrpnClient(const FrameworkManager *parent, string name,
+                       string address, uint16_t us_period, uint8_t priority)
+    : Thread(parent, name, priority) {
+  pimpl_ = new VrpnClient_impl(this, name, address, us_period);
 }
 
-VrpnClient::VrpnClient(const FrameworkManager* parent,string name,SerialPort* serialport,uint16_t us_period,uint8_t priority): Thread(parent,name,priority)
-{
-    pimpl_=new VrpnClient_impl(this,name,serialport,us_period);
+VrpnClient::VrpnClient(const FrameworkManager *parent, string name,
+                       SerialPort *serialport, uint16_t us_period,
+                       uint8_t priority)
+    : Thread(parent, name, priority) {
+  pimpl_ = new VrpnClient_impl(this, name, serialport, us_period);
 }
 
-VrpnClient::~VrpnClient()
-{
-    SafeStop();
-    Join();
+VrpnClient::~VrpnClient() {
+  SafeStop();
+  Join();
 
-    delete pimpl_;
+  delete pimpl_;
 }
 
-Layout* VrpnClient::GetLayout(void) const
-{
-    return (Layout*)(pimpl_->setup_tab);
+Layout *VrpnClient::GetLayout(void) const {
+  return (Layout *)(pimpl_->setup_tab);
 }
 
-TabWidget* VrpnClient::GetTabWidget(void) const
-{
-    return pimpl_->tab;
-}
+TabWidget *VrpnClient::GetTabWidget(void) const { return pimpl_->tab; }
 
-bool VrpnClient::UseXbee(void) const
-{
-    return pimpl_->UseXbee();
-}
+bool VrpnClient::UseXbee(void) const { return pimpl_->UseXbee(); }
 
-void VrpnClient::Run(void)
-{
-    pimpl_->Run();
-}
+void VrpnClient::Run(void) { pimpl_->Run(); }
 
 } // end namespace sensor
Index: trunk/lib/FlairSensorActuator/src/VrpnClient.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/VrpnClient.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/VrpnClient.h	(revision 15)
@@ -6,5 +6,6 @@
  * \file VrpnClient.h
  * \brief Class to connect to a Vrpn server
- * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS
+ * 7253
  * \date 2013/04/03
  * \version 4.0
@@ -16,16 +17,13 @@
 #include <Thread.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class FrameworkManager;
-        class SerialPort;
-    }
-    namespace gui
-    {
-        class TabWidget;
-        class Layout;
-    }
+namespace flair {
+namespace core {
+class FrameworkManager;
+class SerialPort;
+}
+namespace gui {
+class TabWidget;
+class Layout;
+}
 }
 
@@ -33,81 +31,81 @@
 class VrpnObject_impl;
 
-namespace flair
-{
-namespace sensor
-{
-    /*! \class VrpnClient
-    *
-    * \brief Class to connect to a Vrpn server
-    */
-    class VrpnClient:public core::Thread
-    {
-        friend class ::VrpnObject_impl;
+namespace flair {
+namespace sensor {
+/*! \class VrpnClient
+*
+* \brief Class to connect to a Vrpn server
+*/
+class VrpnClient : public core::Thread {
+  friend class ::VrpnObject_impl;
 
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a VrpnClient. Connection is done by IP.
-            *
-            * \param parent parent
-            * \param name name
-            * \param address server address
-            * \param us_period Thread period in us
-            * \param priority priority of the Thread
-            */
-            VrpnClient(const core::FrameworkManager* parent,std::string name,std::string address,uint16_t us_period,uint8_t priority);
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a VrpnClient. Connection is done by IP.
+  *
+  * \param parent parent
+  * \param name name
+  * \param address server address
+  * \param us_period Thread period in us
+  * \param priority priority of the Thread
+  */
+  VrpnClient(const core::FrameworkManager *parent, std::string name,
+             std::string address, uint16_t us_period, uint8_t priority);
 
-            /*!
-            * \brief Constructor
-            *
-            * Construct a VrpnClient. Connection is done by XBee modem.
-            *
-            * \param parent parent
-            * \param name name
-            * \param serialport SerialPort for XBee modem
-            * \param us_period Xbee RX timeout in us
-            * \param priority priority of the Thread
-            */
-            VrpnClient(const core::FrameworkManager* parent,std::string name,core::SerialPort* serialport,uint16_t us_period,uint8_t priority);
+  /*!
+  * \brief Constructor
+  *
+  * Construct a VrpnClient. Connection is done by XBee modem.
+  *
+  * \param parent parent
+  * \param name name
+  * \param serialport SerialPort for XBee modem
+  * \param us_period Xbee RX timeout in us
+  * \param priority priority of the Thread
+  */
+  VrpnClient(const core::FrameworkManager *parent, std::string name,
+             core::SerialPort *serialport, uint16_t us_period,
+             uint8_t priority);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~VrpnClient();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~VrpnClient();
 
-            /*!
-            * \brief Setup Layout
-            *
-            * \return a Layout available
-            */
-            gui::Layout* GetLayout(void) const;
+  /*!
+  * \brief Setup Layout
+  *
+  * \return a Layout available
+  */
+  gui::Layout *GetLayout(void) const;
 
-            /*!
-            * \brief Setup Tab
-            *
-            * \return a Tab available
-            */
-            gui::TabWidget* GetTabWidget(void) const;
+  /*!
+  * \brief Setup Tab
+  *
+  * \return a Tab available
+  */
+  gui::TabWidget *GetTabWidget(void) const;
 
-            /*!
-            * \brief Is XBee used?
-            *
-            * \return true if connection is based on XBee modem
-            */
-            bool UseXbee(void) const;
+  /*!
+  * \brief Is XBee used?
+  *
+  * \return true if connection is based on XBee modem
+  */
+  bool UseXbee(void) const;
 
-        private:
-            /*!
-            * \brief Run function
-            *
-            * Reimplemented from Thread.
-            *
-            */
-            void Run(void);
+private:
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
 
-            class VrpnClient_impl* pimpl_;
-    };
+  class VrpnClient_impl *pimpl_;
+};
 } // end namespace sensor
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/VrpnClient_impl.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/VrpnClient_impl.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/VrpnClient_impl.cpp	(revision 15)
@@ -41,206 +41,182 @@
 using namespace flair::sensor;
 
-VrpnClient_impl::VrpnClient_impl(VrpnClient* self,std::string name,std::string address,uint16_t us_period)
-{
-    this->us_period=us_period;
-    this->self=self;
-    serialport=NULL;
-
-    mutex=new Mutex(self,name);
-
-    connection = vrpn_get_connection_by_name(address.c_str());
-
-    //station sol
-    main_tab=new Tab(getFrameworkManager()->GetTabWidget(),name);
-    tab=new TabWidget(main_tab->NewRow(),name);
-    setup_tab=new Tab(tab,"Reglages");
-
-    rotation_1=new OneAxisRotation(setup_tab->NewRow(),"post rotation 1");
-    rotation_2=new OneAxisRotation(setup_tab->NewRow(),"post rotation 2");
-}
-
-VrpnClient_impl::VrpnClient_impl(VrpnClient* self,std::string name,SerialPort* serialport,uint16_t us_period)
-{
-    this->us_period=us_period;
-    this->self=self;
-    this->serialport=serialport;
-    connection=NULL;
-    mutex=new Mutex(self,name);
-
-    serialport->SetBaudrate(111111);
-    serialport->SetRxTimeout(us_period*1000);
-
-    //station sol
-    main_tab=new Tab(getFrameworkManager()->GetTabWidget(),name);
-    tab=new TabWidget(main_tab->NewRow(),name);
-    setup_tab=new Tab(tab,"Reglages");
-
-    rotation_1=new OneAxisRotation(setup_tab->NewRow(),"post rotation 1");
-    rotation_2=new OneAxisRotation(setup_tab->NewRow(),"post rotation 2");
-}
-
-VrpnClient_impl::~VrpnClient_impl()
-{
-    if(!UseXbee())
-    {
-        //on fait une copie car le delete touche a xbee_objects_copy via RemoveTrackable
-        vector<VrpnObject*> trackables_copy=trackables;
-        for(unsigned int i=0;i<trackables_copy.size();i++) delete trackables_copy.at(i);
-        //trackables.clear();
+VrpnClient_impl::VrpnClient_impl(VrpnClient *self, std::string name,
+                                 std::string address, uint16_t us_period) {
+  this->us_period = us_period;
+  this->self = self;
+  serialport = NULL;
+
+  mutex = new Mutex(self, name);
+
+  connection = vrpn_get_connection_by_name(address.c_str());
+
+  // station sol
+  main_tab = new Tab(getFrameworkManager()->GetTabWidget(), name);
+  tab = new TabWidget(main_tab->NewRow(), name);
+  setup_tab = new Tab(tab, "Reglages");
+
+  rotation_1 = new OneAxisRotation(setup_tab->NewRow(), "post rotation 1");
+  rotation_2 = new OneAxisRotation(setup_tab->NewRow(), "post rotation 2");
+}
+
+VrpnClient_impl::VrpnClient_impl(VrpnClient *self, std::string name,
+                                 SerialPort *serialport, uint16_t us_period) {
+  this->us_period = us_period;
+  this->self = self;
+  this->serialport = serialport;
+  connection = NULL;
+  mutex = new Mutex(self, name);
+
+  serialport->SetBaudrate(111111);
+  serialport->SetRxTimeout(us_period * 1000);
+
+  // station sol
+  main_tab = new Tab(getFrameworkManager()->GetTabWidget(), name);
+  tab = new TabWidget(main_tab->NewRow(), name);
+  setup_tab = new Tab(tab, "Reglages");
+
+  rotation_1 = new OneAxisRotation(setup_tab->NewRow(), "post rotation 1");
+  rotation_2 = new OneAxisRotation(setup_tab->NewRow(), "post rotation 2");
+}
+
+VrpnClient_impl::~VrpnClient_impl() {
+  if (!UseXbee()) {
+    // on fait une copie car le delete touche a xbee_objects_copy via
+    // RemoveTrackable
+    vector<VrpnObject *> trackables_copy = trackables;
+    for (unsigned int i = 0; i < trackables_copy.size(); i++)
+      delete trackables_copy.at(i);
+    // trackables.clear();
+  } else {
+    // on fait une copie car le delete touche a xbee_objects_copy via
+    // RemoveTrackable
+    vector<xbee_object> xbee_objects_copy = xbee_objects;
+    for (unsigned int i = 0; i < xbee_objects_copy.size(); i++)
+      delete xbee_objects_copy.at(i).vrpnobject->self;
+  }
+
+  delete main_tab;
+
+  if (!UseXbee()) {
+    // it will automatically delete connection
+    connection->removeReference();
+  }
+}
+
+void VrpnClient_impl::ComputeRotations(Vector3D &point) {
+  rotation_1->ComputeRotation(point);
+  rotation_2->ComputeRotation(point);
+}
+
+void VrpnClient_impl::ComputeRotations(Quaternion &quat) {
+  rotation_1->ComputeRotation(quat);
+  rotation_2->ComputeRotation(quat);
+}
+
+void VrpnClient_impl::AddTrackable(VrpnObject *obj) {
+  mutex->GetMutex();
+  trackables.push_back(obj);
+  mutex->ReleaseMutex();
+}
+
+void VrpnClient_impl::RemoveTrackable(VrpnObject *obj) {
+  mutex->GetMutex();
+  for (vector<VrpnObject *>::iterator it = trackables.begin();
+       it < trackables.end(); it++) {
+    if (*it == obj) {
+      trackables.erase(it);
+      break;
     }
-    else
-    {
-        //on fait une copie car le delete touche a xbee_objects_copy via RemoveTrackable
-        vector<xbee_object> xbee_objects_copy=xbee_objects;
-        for(unsigned int i=0;i<xbee_objects_copy.size();i++) delete xbee_objects_copy.at(i).vrpnobject->self;
+  }
+  mutex->ReleaseMutex();
+}
+
+void VrpnClient_impl::AddTrackable(VrpnObject_impl *obj, uint8_t id) {
+  xbee_object tmp;
+  tmp.vrpnobject = obj;
+  tmp.id = id;
+  mutex->GetMutex();
+  xbee_objects.push_back(tmp);
+  mutex->ReleaseMutex();
+}
+
+void VrpnClient_impl::RemoveTrackable(VrpnObject_impl *obj) {
+  mutex->GetMutex();
+  for (vector<xbee_object>::iterator it = xbee_objects.begin();
+       it < xbee_objects.end(); it++) {
+    if ((*it).vrpnobject == obj) {
+      xbee_objects.erase(it);
+      break;
     }
-
-    delete main_tab;
-
-    if(!UseXbee())
-    {
-        //it will automatically delete connection
-        connection->removeReference();
+  }
+  mutex->ReleaseMutex();
+}
+
+bool VrpnClient_impl::UseXbee(void) {
+  if (connection == NULL) {
+    return true;
+  } else {
+    return false;
+  }
+}
+
+void VrpnClient_impl::Run(void) {
+  while (!self->ToBeStopped()) {
+    if (UseXbee()) {
+      ssize_t read = 0;
+      uint8_t response[38] = {0};
+
+      read = serialport->Read(response, sizeof(response));
+      if (read > 0 && read != sizeof(response))
+        read += serialport->Read(&response[read], sizeof(response) - read);
+      // int temps=(float)self->GetTime()/(1000*1000);
+      // self->Printf("%i %i %i\n",temps-last,temps,last);
+      // last=temps;
+      if (read < 0) {
+        // self->Warn("erreur rt_dev_read (%s)\n",strerror(-read));
+      } else if (read != sizeof(response)) {
+        self->Warn("erreur rt_dev_read %i/%i\n", read, sizeof(response));
+      } else {
+        // for(ssize_t i=0;i<read;i++) printf("%x ",response[i]);
+        // printf("\n");
+        uint8_t checksum = 0;
+        for (ssize_t i = 3; i < read; i++)
+          checksum += response[i];
+        if (checksum != 255) {
+          self->Err("checksum error\n");
+        } else {
+          vrpn_TRACKERCB t;
+          float pos[3];
+          float quat[4];
+          uint8_t id = response[8];
+
+          mutex->GetMutex();
+          if (id < xbee_objects.size()) {
+            memcpy(pos, &response[9], sizeof(pos));
+            memcpy(quat, &response[9] + sizeof(pos), sizeof(quat));
+            for (int i = 0; i < 3; i++)
+              t.pos[i] = pos[i];
+            for (int i = 0; i < 4; i++)
+              t.quat[i] = quat[i];
+            if (fabs(pos[0] > 10) || fabs(pos[1] > 10) || fabs(pos[2] > 10)) {
+              printf("prob pos %f %f %f\n", pos[0], pos[1], pos[2]);
+            } else {
+              // self->Printf("%i %f %f %f
+              // %f\n",id,pos[0],pos[1],pos[2],(float)self->GetTime()/(1000*1000));
+              VrpnObject_impl::handle_pos(xbee_objects.at(id).vrpnobject, t);
+            }
+          }
+          mutex->ReleaseMutex();
+        }
+      }
+    } else {
+      connection->mainloop();
+      mutex->GetMutex();
+      for (unsigned int i = 0; i < trackables.size(); i++)
+        trackables.at(i)->mainloop();
+      mutex->ReleaseMutex();
+
+      self->SleepUS(us_period);
     }
-}
-
-void VrpnClient_impl::ComputeRotations(Vector3D& point)
-{
-    rotation_1->ComputeRotation(point);
-    rotation_2->ComputeRotation(point);
-}
-
-void VrpnClient_impl::ComputeRotations(Quaternion& quat)
-{
-    rotation_1->ComputeRotation(quat);
-    rotation_2->ComputeRotation(quat);
-}
-
-void VrpnClient_impl::AddTrackable(VrpnObject* obj)
-{
-    mutex->GetMutex();
-    trackables.push_back(obj);
-    mutex->ReleaseMutex();
-}
-
-void VrpnClient_impl::RemoveTrackable(VrpnObject* obj)
-{
-    mutex->GetMutex();
-    for(vector<VrpnObject*>::iterator it=trackables.begin() ; it < trackables.end(); it++ )
-    {
-        if(*it==obj)
-        {
-            trackables.erase (it);
-            break;
-        }
-    }
-    mutex->ReleaseMutex();
-}
-
-void VrpnClient_impl::AddTrackable(VrpnObject_impl* obj,uint8_t id)
-{
-    xbee_object tmp;
-    tmp.vrpnobject=obj;
-    tmp.id=id;
-    mutex->GetMutex();
-    xbee_objects.push_back(tmp);
-    mutex->ReleaseMutex();
-}
-
-void VrpnClient_impl::RemoveTrackable(VrpnObject_impl* obj)
-{
-    mutex->GetMutex();
-    for(vector<xbee_object>::iterator it=xbee_objects.begin() ; it < xbee_objects.end(); it++ )
-    {
-        if((*it).vrpnobject==obj)
-        {
-            xbee_objects.erase (it);
-            break;
-        }
-    }
-    mutex->ReleaseMutex();
-}
-
-bool VrpnClient_impl::UseXbee(void)
-{
-    if(connection==NULL)
-    {
-        return true;
-    }
-    else
-    {
-        return false;
-    }
-}
-
-void VrpnClient_impl::Run(void)
-{
-    while(!self->ToBeStopped())
-    {
-        if(UseXbee())
-        {
-            ssize_t read = 0;
-            uint8_t response[38] = {0};
-
-            read = serialport->Read(response,sizeof(response));
-            if(read>0 && read!=sizeof(response)) read += serialport->Read(&response[read],sizeof(response)-read);
-            //int temps=(float)self->GetTime()/(1000*1000);
-//self->Printf("%i %i %i\n",temps-last,temps,last);
-//last=temps;
-            if(read<0)
-            {
-                //self->Warn("erreur rt_dev_read (%s)\n",strerror(-read));
-            }
-            else if (read != sizeof(response))
-            {
-                self->Warn("erreur rt_dev_read %i/%i\n",read,sizeof(response));
-            }
-            else
-            {
-                //for(ssize_t i=0;i<read;i++) printf("%x ",response[i]);
-                //printf("\n");
-                uint8_t checksum=0;
-                for(ssize_t i=3;i<read;i++) checksum+=response[i];
-                if(checksum!=255)
-                {
-                    self->Err("checksum error\n");
-                }
-                else
-                {
-                    vrpn_TRACKERCB t;
-                    float pos[3];
-                    float quat[4];
-                    uint8_t id=response[8];
-
-                    mutex->GetMutex();
-                    if(id<xbee_objects.size())
-                    {
-                        memcpy(pos,&response[9],sizeof(pos));
-                        memcpy(quat,&response[9]+sizeof(pos),sizeof(quat));
-                        for(int i=0;i<3;i++) t.pos[i]=pos[i];
-                        for(int i=0;i<4;i++) t.quat[i]=quat[i];
-                        if(fabs(pos[0]>10) || fabs(pos[1]>10) || fabs(pos[2]>10))
-                        {
-                            printf("prob pos %f %f %f\n",pos[0],pos[1],pos[2]);
-                        }
-                        else
-                        {
-                            //self->Printf("%i %f %f %f %f\n",id,pos[0],pos[1],pos[2],(float)self->GetTime()/(1000*1000));
-                            VrpnObject_impl::handle_pos(xbee_objects.at(id).vrpnobject,t);
-                        }
-                    }
-                    mutex->ReleaseMutex();
-                }
-            }
-        }
-        else
-        {
-            connection->mainloop();
-            mutex->GetMutex();
-            for(unsigned int i=0;i<trackables.size();i++) trackables.at(i)->mainloop();
-            mutex->ReleaseMutex();
-
-            self->SleepUS(us_period);
-        }
-    }
-}
+  }
+}
Index: trunk/lib/FlairSensorActuator/src/VrpnObject.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/VrpnObject.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/VrpnObject.cpp	(revision 15)
@@ -27,85 +27,55 @@
 using namespace flair::gui;
 
-namespace flair
-{
-namespace sensor
-{
+namespace flair {
+namespace sensor {
 
-VrpnObject::VrpnObject(const VrpnClient *parent,string name,const TabWidget* tab): IODevice(parent,name)
-{
-    pimpl_=new VrpnObject_impl(this,parent,name,-1,tab);
-    AddDataToLog(pimpl_->output);
+VrpnObject::VrpnObject(const VrpnClient *parent, string name,
+                       const TabWidget *tab)
+    : IODevice(parent, name) {
+  pimpl_ = new VrpnObject_impl(this, parent, name, -1, tab);
+  AddDataToLog(pimpl_->output);
 }
 
-VrpnObject::VrpnObject(const VrpnClient *parent,string name,uint8_t id,const TabWidget* tab): IODevice(parent,name)
-{
-    Warn("Creation of object %s with id %i\n",name.c_str(),id);
-    pimpl_=new VrpnObject_impl(this,parent,name,id,tab);
-    AddDataToLog(pimpl_->output);
+VrpnObject::VrpnObject(const VrpnClient *parent, string name, uint8_t id,
+                       const TabWidget *tab)
+    : IODevice(parent, name) {
+  Warn("Creation of object %s with id %i\n", name.c_str(), id);
+  pimpl_ = new VrpnObject_impl(this, parent, name, id, tab);
+  AddDataToLog(pimpl_->output);
 }
 
-VrpnObject::~VrpnObject(void)
-{
-	delete pimpl_;
+VrpnObject::~VrpnObject(void) { delete pimpl_; }
+
+cvmatrix *VrpnObject::Output(void) const { return pimpl_->output; }
+
+cvmatrix *VrpnObject::State(void) const { return pimpl_->state; }
+
+Tab *VrpnObject::GetPlotTab(void) const { return pimpl_->plot_tab; }
+
+DataPlot1D *VrpnObject::xPlot(void) const { return pimpl_->x_plot; }
+
+DataPlot1D *VrpnObject::yPlot(void) const { return pimpl_->y_plot; }
+
+DataPlot1D *VrpnObject::zPlot(void) const { return pimpl_->z_plot; }
+
+Time VrpnObject::GetLastPacketTime(void) const {
+  return pimpl_->output->DataTime();
 }
 
-cvmatrix *VrpnObject::Output(void) const
-{
-    return pimpl_->output;
+bool VrpnObject::IsTracked(unsigned int timeout_ms) const {
+  return pimpl_->IsTracked(timeout_ms);
 }
 
-cvmatrix *VrpnObject::State(void) const
-{
-    return pimpl_->state;
+void VrpnObject::GetEuler(Euler &euler) const { pimpl_->GetEuler(euler); }
+
+void VrpnObject::GetQuaternion(Quaternion &quaternion) const {
+  pimpl_->GetQuaternion(quaternion);
 }
 
-Tab* VrpnObject::GetPlotTab(void) const
-{
-    return pimpl_->plot_tab;
+void VrpnObject::GetPosition(Vector3D &point) const {
+  pimpl_->GetPosition(point);
 }
 
-DataPlot1D* VrpnObject::xPlot(void) const
-{
-    return pimpl_->x_plot;
-}
-
-DataPlot1D* VrpnObject::yPlot(void) const
-{
-    return pimpl_->y_plot;
-}
-
-DataPlot1D* VrpnObject::zPlot(void) const
-{
-    return pimpl_->z_plot;
-}
-
-Time VrpnObject::GetLastPacketTime(void) const
-{
-	return pimpl_->output->DataTime();
-}
-
-bool VrpnObject::IsTracked(unsigned int timeout_ms) const
-{
-    return pimpl_->IsTracked(timeout_ms);
-}
-
-void VrpnObject::GetEuler(Euler &euler) const
-{
-    pimpl_->GetEuler(euler);
-}
-
-void VrpnObject::GetQuaternion(Quaternion &quaternion) const {
-    pimpl_->GetQuaternion(quaternion);
-}
-
-void VrpnObject::GetPosition(Vector3D &point) const
-{
-    pimpl_->GetPosition(point);
-}
-
-void VrpnObject::mainloop(void)
-{
-    pimpl_->mainloop();
-}
+void VrpnObject::mainloop(void) { pimpl_->mainloop(); }
 
 } // end namespace sensor
Index: trunk/lib/FlairSensorActuator/src/VrpnObject.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/VrpnObject.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/VrpnObject.h	(revision 15)
@@ -6,5 +6,6 @@
  * \file VrpnObject.h
  * \brief Class for VRPN object
- * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS
+ * 7253
  * \date 2013/04/03
  * \version 4.0
@@ -17,19 +18,16 @@
 #include <stdint.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class cvmatrix;
-        class Vector3D;
-        class Euler;
-        class Quaternion;
-    }
-    namespace gui
-    {
-        class TabWidget;
-        class Tab;
-        class DataPlot1D;
-    }
+namespace flair {
+namespace core {
+class cvmatrix;
+class Vector3D;
+class Euler;
+class Quaternion;
+}
+namespace gui {
+class TabWidget;
+class Tab;
+class DataPlot1D;
+}
 }
 
@@ -37,152 +35,151 @@
 class VrpnClient_impl;
 
-namespace flair
-{
-namespace sensor
-{
-    class VrpnClient;
+namespace flair {
+namespace sensor {
+class VrpnClient;
 
-    /*! \class VrpnObject
-    *
-    * \brief Class for VRPN object
-    */
-    class VrpnObject: public core::IODevice
-    {
-        friend class ::VrpnObject_impl;
-        friend class ::VrpnClient_impl;
+/*! \class VrpnObject
+*
+* \brief Class for VRPN object
+*/
+class VrpnObject : public core::IODevice {
+  friend class ::VrpnObject_impl;
+  friend class ::VrpnClient_impl;
 
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a VrpnObject. Connection is done by IP.
-            *
-            * \param parent parent
-            * \param name VRPN object name, should be the same as defined in the server
-            * \param tab Tab for the user interface
-            */
-            VrpnObject(const VrpnClient *parent,std::string name,const gui::TabWidget* tab);
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a VrpnObject. Connection is done by IP.
+  *
+  * \param parent parent
+  * \param name VRPN object name, should be the same as defined in the server
+  * \param tab Tab for the user interface
+  */
+  VrpnObject(const VrpnClient *parent, std::string name,
+             const gui::TabWidget *tab);
 
-            /*!
-            * \brief Constructor
-            *
-            * Construct a VrpnObject. Connection is done by IP.
-            *
-            * \param parent parent
-            * \param name name
-            * \param id VRPN object id, should be the same as defined in the server
-            * \param tab Tab for the user interface
-            */
-            VrpnObject(const VrpnClient *parent,std::string name,uint8_t id,const gui::TabWidget* tab);
+  /*!
+  * \brief Constructor
+  *
+  * Construct a VrpnObject. Connection is done by IP.
+  *
+  * \param parent parent
+  * \param name name
+  * \param id VRPN object id, should be the same as defined in the server
+  * \param tab Tab for the user interface
+  */
+  VrpnObject(const VrpnClient *parent, std::string name, uint8_t id,
+             const gui::TabWidget *tab);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~VrpnObject(void);
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~VrpnObject(void);
 
-            /*!
-            * \brief Plot tab
-            *
-            * \return plot Tab
-            */
-            gui::Tab* GetPlotTab(void) const;
+  /*!
+  * \brief Plot tab
+  *
+  * \return plot Tab
+  */
+  gui::Tab *GetPlotTab(void) const;
 
-            /*!
-            * \brief Get Last Packet Time
-            *
-            * \return Time of last received packe
-            */
-            core::Time GetLastPacketTime(void) const;
+  /*!
+  * \brief Get Last Packet Time
+  *
+  * \return Time of last received packe
+  */
+  core::Time GetLastPacketTime(void) const;
 
-            /*!
-            * \brief Is object tracked?
-            *
-            * \param timeout_ms timeout
-            * \return true if object is tracked during timeout_ms time
-            */
-            bool IsTracked(unsigned int timeout_ms) const;
+  /*!
+  * \brief Is object tracked?
+  *
+  * \param timeout_ms timeout
+  * \return true if object is tracked during timeout_ms time
+  */
+  bool IsTracked(unsigned int timeout_ms) const;
 
-            /*!
-            * \brief Get Euler angles
-            *
-            * \param euler output datas
-            */
-            void GetEuler(core::Euler &euler) const;
+  /*!
+  * \brief Get Euler angles
+  *
+  * \param euler output datas
+  */
+  void GetEuler(core::Euler &euler) const;
 
-            /*!
-            * \brief Get Quaternion
-            *
-            * \param quaternion output datas
-            */
-            void GetQuaternion(core::Quaternion &quaternion) const;
-            /*!
-            * \brief Get Position
-            *
-            * \param point output datas
-            */
-            void GetPosition(core::Vector3D &point) const;
+  /*!
+  * \brief Get Quaternion
+  *
+  * \param quaternion output datas
+  */
+  void GetQuaternion(core::Quaternion &quaternion) const;
+  /*!
+  * \brief Get Position
+  *
+  * \param point output datas
+  */
+  void GetPosition(core::Vector3D &point) const;
 
-            /*!
-            * \brief Output matrix
-            *
-            * Matrix is of type float and as follows: \n
-            * (0,0) roll (rad) \n
-            * (1,0) pitch (rad) \n
-            * (2,0) yaw (rad) \n
-            * (3,0) x \n
-            * (4,0) y \n
-            * (5,0) z \n
-            *
-            * \return Output metrix
-            */
-            core::cvmatrix *Output(void) const;
+  /*!
+  * \brief Output matrix
+  *
+  * Matrix is of type float and as follows: \n
+  * (0,0) roll (rad) \n
+  * (1,0) pitch (rad) \n
+  * (2,0) yaw (rad) \n
+  * (3,0) x \n
+  * (4,0) y \n
+  * (5,0) z \n
+  *
+  * \return Output metrix
+  */
+  core::cvmatrix *Output(void) const;
 
-            /*!
-            * \brief State matrix
-            *
-            * Matrix is of type float and as follows: \n
-            * (0,0) roll (deg) \n
-            * (1,0) pitch (deg) \n
-            * (2,0) yaw (deg) \n
-            *
-            * \return State metrix
-            */
-            core::cvmatrix *State(void) const;
+  /*!
+  * \brief State matrix
+  *
+  * Matrix is of type float and as follows: \n
+  * (0,0) roll (deg) \n
+  * (1,0) pitch (deg) \n
+  * (2,0) yaw (deg) \n
+  *
+  * \return State metrix
+  */
+  core::cvmatrix *State(void) const;
 
-            /*!
-            * \brief x plot
-            *
-            * \return x plot
-            */
-            gui::DataPlot1D* xPlot(void) const;
+  /*!
+  * \brief x plot
+  *
+  * \return x plot
+  */
+  gui::DataPlot1D *xPlot(void) const;
 
-            /*!
-            * \brief y plot
-            *
-            * \return y plot
-            */
-            gui::DataPlot1D* yPlot(void) const;
+  /*!
+  * \brief y plot
+  *
+  * \return y plot
+  */
+  gui::DataPlot1D *yPlot(void) const;
 
-            /*!
-            * \brief z plot
-            *
-            * \return z plot
-            */
-            gui::DataPlot1D* zPlot(void) const;
+  /*!
+  * \brief z plot
+  *
+  * \return z plot
+  */
+  gui::DataPlot1D *zPlot(void) const;
 
-        private:
-            /*!
-            * \brief Update using provided datas
-            *
-            * Reimplemented from IODevice.
-            *
-            * \param data data from the parent to process
-            */
-            void UpdateFrom(const core::io_data *data){};
+private:
+  /*!
+  * \brief Update using provided datas
+  *
+  * Reimplemented from IODevice.
+  *
+  * \param data data from the parent to process
+  */
+  void UpdateFrom(const core::io_data *data){};
 
-            void mainloop(void);
-            class VrpnObject_impl* pimpl_;
-    };
+  void mainloop(void);
+  class VrpnObject_impl *pimpl_;
+};
 } // end namespace sensor
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/VrpnObject_impl.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/VrpnObject_impl.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/VrpnObject_impl.cpp	(revision 15)
@@ -39,176 +39,161 @@
 using namespace flair::sensor;
 
-VrpnObject_impl::VrpnObject_impl(VrpnObject* self,const VrpnClient *parent,string name, int id,const TabWidget* tab)
-{
-    this->parent=parent;
-    this->self=self;
+VrpnObject_impl::VrpnObject_impl(VrpnObject *self, const VrpnClient *parent,
+                                 string name, int id, const TabWidget *tab) {
+  this->parent = parent;
+  this->self = self;
 
-    if(id==-1 && parent->UseXbee())
-    {
-        self->Err("erreur aucun identifiant specifie pour la connexion Xbee\n");
-    }
-    if(id!=-1 && !parent->UseXbee())
-    {
-        self->Warn("identifiant pour la connexion Xbee ignore car pas en mode Xbee\n");
-    }
+  if (id == -1 && parent->UseXbee()) {
+    self->Err("erreur aucun identifiant specifie pour la connexion Xbee\n");
+  }
+  if (id != -1 && !parent->UseXbee()) {
+    self->Warn(
+        "identifiant pour la connexion Xbee ignore car pas en mode Xbee\n");
+  }
 
-	if(parent->UseXbee())
-	{
-        parent->pimpl_->AddTrackable(this,id);
-        tracker=NULL;
-	}
-	else
-	{
-	    parent->pimpl_->AddTrackable(self);
-        tracker = new vrpn_Tracker_Remote(name.c_str(), parent->pimpl_->connection);
-        tracker->register_change_handler(this,handle_pos);
-        tracker->shutup=true;
-	}
+  if (parent->UseXbee()) {
+    parent->pimpl_->AddTrackable(this, id);
+    tracker = NULL;
+  } else {
+    parent->pimpl_->AddTrackable(self);
+    tracker = new vrpn_Tracker_Remote(name.c_str(), parent->pimpl_->connection);
+    tracker->register_change_handler(this, handle_pos);
+    tracker->shutup = true;
+  }
 
-	//state
-	cvmatrix_descriptor* desc=new cvmatrix_descriptor(6,1);
-	desc->SetElementName(0,0,"roll");
-	desc->SetElementName(1,0,"pitch");
-	desc->SetElementName(2,0,"yaw");
-	desc->SetElementName(3,0,"x");
-	desc->SetElementName(4,0,"y");
-	desc->SetElementName(5,0,"z");
-	output=new cvmatrix(self,desc,floatType);
+  // state
+  cvmatrix_descriptor *desc = new cvmatrix_descriptor(6, 1);
+  desc->SetElementName(0, 0, "roll");
+  desc->SetElementName(1, 0, "pitch");
+  desc->SetElementName(2, 0, "yaw");
+  desc->SetElementName(3, 0, "x");
+  desc->SetElementName(4, 0, "y");
+  desc->SetElementName(5, 0, "z");
+  output = new cvmatrix(self, desc, floatType);
 
-	desc=new cvmatrix_descriptor(3,1);
-	desc->SetElementName(0,0,"roll");
-	desc->SetElementName(1,0,"pitch");
-	desc->SetElementName(2,0,"yaw");
-	state=new cvmatrix(self,desc,floatType);
+  desc = new cvmatrix_descriptor(3, 1);
+  desc->SetElementName(0, 0, "roll");
+  desc->SetElementName(1, 0, "pitch");
+  desc->SetElementName(2, 0, "yaw");
+  state = new cvmatrix(self, desc, floatType);
 
-	//ui
-	plot_tab=new Tab(tab,"Mesures "+ name);
-        x_plot=new DataPlot1D(plot_tab->NewRow(),"x",-10,10);
-            x_plot->AddCurve(output->Element(3));
-        y_plot=new DataPlot1D(plot_tab->LastRowLastCol(),"y",-10,10);
-            y_plot->AddCurve(output->Element(4));
-        z_plot=new DataPlot1D(plot_tab->LastRowLastCol(),"z",-2,0);
-            z_plot->AddCurve(output->Element(5));
+  // ui
+  plot_tab = new Tab(tab, "Mesures " + name);
+  x_plot = new DataPlot1D(plot_tab->NewRow(), "x", -10, 10);
+  x_plot->AddCurve(output->Element(3));
+  y_plot = new DataPlot1D(plot_tab->LastRowLastCol(), "y", -10, 10);
+  y_plot->AddCurve(output->Element(4));
+  z_plot = new DataPlot1D(plot_tab->LastRowLastCol(), "z", -2, 0);
+  z_plot->AddCurve(output->Element(5));
 }
 
-VrpnObject_impl::~VrpnObject_impl(void)
-{
-    if(tracker!=NULL)//normal
-	{
-	    parent->pimpl_->RemoveTrackable(self);
-        tracker->unregister_change_handler(this,handle_pos);
-        delete tracker;
-	}
-	else//xbee
-	{
-        parent->pimpl_->RemoveTrackable(this);
-	}
-	delete plot_tab;
+VrpnObject_impl::~VrpnObject_impl(void) {
+  if (tracker != NULL) // normal
+  {
+    parent->pimpl_->RemoveTrackable(self);
+    tracker->unregister_change_handler(this, handle_pos);
+    delete tracker;
+  } else // xbee
+  {
+    parent->pimpl_->RemoveTrackable(this);
+  }
+  delete plot_tab;
 }
 
-void VrpnObject_impl::mainloop(void)
-{
-	tracker->mainloop();
+void VrpnObject_impl::mainloop(void) { tracker->mainloop(); }
+
+bool VrpnObject_impl::IsTracked(unsigned int timeout_ms) {
+  output->GetMutex();
+  Time a = GetTime();
+  Time dt = a - output->DataTime();
+  output->ReleaseMutex();
+
+  if (dt > (Time)(timeout_ms * 1000000)) {
+    // self->Printf("%lld %lld %lld
+    // %lld\n",a,output->DataTime(),dt,(Time)(timeout_ms*1000000));
+    return false;
+  } else {
+    return true;
+  }
 }
 
-bool VrpnObject_impl::IsTracked(unsigned int timeout_ms)
-{
-    output->GetMutex();
-    Time a=GetTime();
-    Time dt=a-output->DataTime();
-    output->ReleaseMutex();
-
-    if(dt>(Time)(timeout_ms*1000000))
-    {
-        //self->Printf("%lld %lld %lld %lld\n",a,output->DataTime(),dt,(Time)(timeout_ms*1000000));
-        return false;
-    }
-    else
-    {
-        return true;
-    }
-}
-
-void VrpnObject_impl::GetEuler(Euler &euler)
-{
-    output->GetMutex();
-    euler.roll=output->ValueNoMutex(0,0);
-    euler.pitch=output->ValueNoMutex(1,0);
-    euler.yaw=output->ValueNoMutex(2,0);
-    output->ReleaseMutex();
+void VrpnObject_impl::GetEuler(Euler &euler) {
+  output->GetMutex();
+  euler.roll = output->ValueNoMutex(0, 0);
+  euler.pitch = output->ValueNoMutex(1, 0);
+  euler.yaw = output->ValueNoMutex(2, 0);
+  output->ReleaseMutex();
 }
 
 void VrpnObject_impl::GetQuaternion(Quaternion &quaternion) {
-    output->GetMutex();
-    quaternion.q0=this->quaternion.q0;
-    quaternion.q1=this->quaternion.q1;
-    quaternion.q2=this->quaternion.q2;
-    quaternion.q3=this->quaternion.q3;
-    output->ReleaseMutex();
+  output->GetMutex();
+  quaternion.q0 = this->quaternion.q0;
+  quaternion.q1 = this->quaternion.q1;
+  quaternion.q2 = this->quaternion.q2;
+  quaternion.q3 = this->quaternion.q3;
+  output->ReleaseMutex();
 }
 
-void VrpnObject_impl::GetPosition(Vector3D &point)
-{
-    output->GetMutex();
-    point.x=output->ValueNoMutex(3,0);
-    point.y=output->ValueNoMutex(4,0);
-    point.z=output->ValueNoMutex(5,0);
-    output->ReleaseMutex();
+void VrpnObject_impl::GetPosition(Vector3D &point) {
+  output->GetMutex();
+  point.x = output->ValueNoMutex(3, 0);
+  point.y = output->ValueNoMutex(4, 0);
+  point.z = output->ValueNoMutex(5, 0);
+  output->ReleaseMutex();
 }
 
-void VRPN_CALLBACK VrpnObject_impl::handle_pos(void *userdata, const vrpn_TRACKERCB t)
-{
-    bool is_nan=false;
-	VrpnObject_impl* caller= reinterpret_cast<VrpnObject_impl*>(userdata);
-	Time time=GetTime();
+void VRPN_CALLBACK
+VrpnObject_impl::handle_pos(void *userdata, const vrpn_TRACKERCB t) {
+  bool is_nan = false;
+  VrpnObject_impl *caller = reinterpret_cast<VrpnObject_impl *>(userdata);
+  Time time = GetTime();
 
-    //check if something is nan
-    for(int i=0;i<3;i++)
-    {
-        if(isnan(t.pos[i])==true) is_nan=true;
-    }
-    for(int i=0;i<4;i++)
-    {
-        if(isnan(t.quat[i])==true) is_nan=true;
-    }
-    if(is_nan==true)
-    {
-        caller->self->Warn("data is nan, skipping it (time %lld)\n",time);
-        return;
-    }
+  // check if something is nan
+  for (int i = 0; i < 3; i++) {
+    if (isnan(t.pos[i]) == true)
+      is_nan = true;
+  }
+  for (int i = 0; i < 4; i++) {
+    if (isnan(t.quat[i]) == true)
+      is_nan = true;
+  }
+  if (is_nan == true) {
+    caller->self->Warn("data is nan, skipping it (time %lld)\n", time);
+    return;
+  }
 
-    //on prend une fois pour toute le mutex et on fait des accès directs
-    caller->output->GetMutex();
+  // on prend une fois pour toute le mutex et on fait des accès directs
+  caller->output->GetMutex();
 
-    //warning: t.quat is defined as (qx,qy,qz,qw), which is different from flair::core::Quaternion
-    caller->quaternion.q0=t.quat[3];
-    caller->quaternion.q1=t.quat[0];
-    caller->quaternion.q2=t.quat[1];
-    caller->quaternion.q3=t.quat[2];
-    Vector3D pos((float)t.pos[0],(float)t.pos[1],(float)t.pos[2]);
+  // warning: t.quat is defined as (qx,qy,qz,qw), which is different from
+  // flair::core::Quaternion
+  caller->quaternion.q0 = t.quat[3];
+  caller->quaternion.q1 = t.quat[0];
+  caller->quaternion.q2 = t.quat[1];
+  caller->quaternion.q3 = t.quat[2];
+  Vector3D pos((float)t.pos[0], (float)t.pos[1], (float)t.pos[2]);
 
-    //on effectue les rotation
-    caller->parent->pimpl_->ComputeRotations(pos);
-    caller->parent->pimpl_->ComputeRotations(caller->quaternion);
+  // on effectue les rotation
+  caller->parent->pimpl_->ComputeRotations(pos);
+  caller->parent->pimpl_->ComputeRotations(caller->quaternion);
 
-    Euler euler;
-    caller->quaternion.ToEuler(euler);
-    caller->output->SetValueNoMutex( 0, 0,euler.roll);
-    caller->output->SetValueNoMutex( 1, 0,euler.pitch);
-    caller->output->SetValueNoMutex( 2, 0,euler.yaw);
-    caller->output->SetValueNoMutex( 3, 0,pos.x);
-    caller->output->SetValueNoMutex( 4, 0,pos.y);
-    caller->output->SetValueNoMutex( 5, 0,pos.z);
+  Euler euler;
+  caller->quaternion.ToEuler(euler);
+  caller->output->SetValueNoMutex(0, 0, euler.roll);
+  caller->output->SetValueNoMutex(1, 0, euler.pitch);
+  caller->output->SetValueNoMutex(2, 0, euler.yaw);
+  caller->output->SetValueNoMutex(3, 0, pos.x);
+  caller->output->SetValueNoMutex(4, 0, pos.y);
+  caller->output->SetValueNoMutex(5, 0, pos.z);
 
-    caller->output->SetDataTime(time);
-    caller->output->ReleaseMutex();
+  caller->output->SetDataTime(time);
+  caller->output->ReleaseMutex();
 
-    caller->state->GetMutex();
-    caller->state->SetValueNoMutex( 0, 0,Euler::ToDegree(euler.roll));
-    caller->state->SetValueNoMutex( 1, 0,Euler::ToDegree(euler.pitch));
-    caller->state->SetValueNoMutex(2, 0,Euler::ToDegree(euler.yaw));
-    caller->state->ReleaseMutex();
+  caller->state->GetMutex();
+  caller->state->SetValueNoMutex(0, 0, Euler::ToDegree(euler.roll));
+  caller->state->SetValueNoMutex(1, 0, Euler::ToDegree(euler.pitch));
+  caller->state->SetValueNoMutex(2, 0, Euler::ToDegree(euler.yaw));
+  caller->state->ReleaseMutex();
 
-    caller->self->ProcessUpdate(caller->output);
+  caller->self->ProcessUpdate(caller->output);
 }
-
Index: trunk/lib/FlairSensorActuator/src/XBldc.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/XBldc.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/XBldc.cpp	(revision 15)
@@ -23,20 +23,16 @@
 using namespace flair::gui;
 
-namespace flair
-{
-namespace actuator
-{
+namespace flair {
+namespace actuator {
 
-XBldc::XBldc(const IODevice* parent,Layout* layout,string name,I2cPort* i2cport) : Bldc(parent,layout,name,4) {
-    pimpl_=new XBldc_impl(this,i2cport);
+XBldc::XBldc(const IODevice *parent, Layout *layout, string name,
+             I2cPort *i2cport)
+    : Bldc(parent, layout, name, 4) {
+  pimpl_ = new XBldc_impl(this, i2cport);
 }
 
-XBldc::~XBldc() {
-    delete pimpl_;
-}
+XBldc::~XBldc() { delete pimpl_; }
 
-void XBldc::SetMotors(float* value) {
-    pimpl_->SetMotors(value);
-}
+void XBldc::SetMotors(float *value) { pimpl_->SetMotors(value); }
 
 } // end namespace actuator
Index: trunk/lib/FlairSensorActuator/src/XBldc.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/XBldc.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/XBldc.h	(revision 15)
@@ -16,79 +16,74 @@
 #include "Bldc.h"
 
-namespace flair
-{
-    namespace core
-    {
-        class IODevice;
-        class I2cPort;
-    }
-    namespace gui
-    {
-        class Layout;
-    }
+namespace flair {
+namespace core {
+class IODevice;
+class I2cPort;
+}
+namespace gui {
+class Layout;
+}
 }
 
 class XBldc_impl;
 
-namespace flair
-{
-namespace actuator
-{
-    /*! \class XBldc
-    *
-    * \brief Class for Xufo Bldc
-    */
-    class XBldc : public Bldc
-    {
-        public:
-            /*!
-            * \brief Constructor
-            *
-            * Construct a XBldc.
-            *
-            * \param parent parent
-            * \param layout layout
-            * \param name name
-            * \param i2cport i2cport
-            */
-            XBldc(const core::IODevice* parent,gui::Layout* layout,std::string name,core::I2cPort* i2cport);
+namespace flair {
+namespace actuator {
+/*! \class XBldc
+*
+* \brief Class for Xufo Bldc
+*/
+class XBldc : public Bldc {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a XBldc.
+  *
+  * \param parent parent
+  * \param layout layout
+  * \param name name
+  * \param i2cport i2cport
+  */
+  XBldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
+        core::I2cPort *i2cport);
 
-            /*!
-            * \brief Destructor
-            *
-            */
-            ~XBldc();
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~XBldc();
 
-            /*!
-            * \brief Has speed measurement
-            *
-            * Reimplemented from Bldc. \n
-            *
-            * \return true if it has speed measurement
-            */
-            bool HasSpeedMeasurement(void) const{return false;};
+  /*!
+  * \brief Has speed measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has speed measurement
+  */
+  bool HasSpeedMeasurement(void) const { return false; };
 
-            /*!
-            * \brief Has current measurement
-            *
-            * Reimplemented from Bldc. \n
-            *
-            * \return true if it has current measurement
-            */
-            bool HasCurrentMeasurement(void) const{return false;};
+  /*!
+  * \brief Has current measurement
+  *
+  * Reimplemented from Bldc. \n
+  *
+  * \return true if it has current measurement
+  */
+  bool HasCurrentMeasurement(void) const { return false; };
 
-        private:
-            /*!
-            * \brief Set motors values
-            *
-            * Reimplemented from Bldc. \n
-            * Values size must be the same as MotorsCount()
-            *
-            * \param values motor values
-            */
-            void SetMotors(float* value);
+private:
+  /*!
+  * \brief Set motors values
+  *
+  * Reimplemented from Bldc. \n
+  * Values size must be the same as MotorsCount()
+  *
+  * \param values motor values
+  */
+  void SetMotors(float *value);
 
-            class XBldc_impl* pimpl_;
-    };
+  class XBldc_impl *pimpl_;
+};
 } // end namespace actuator
 } // end namespace flair
Index: trunk/lib/FlairSensorActuator/src/XBldc_impl.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/XBldc_impl.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/XBldc_impl.cpp	(revision 15)
@@ -29,40 +29,40 @@
 using namespace flair::actuator;
 
-XBldc_impl::XBldc_impl(XBldc* self,I2cPort* i2cport) {
-    this->self=self;
-	this->i2cport=i2cport;
+XBldc_impl::XBldc_impl(XBldc *self, I2cPort *i2cport) {
+  this->self = self;
+  this->i2cport = i2cport;
 
-    i2cport->SetTxTimeout(5000000);
+  i2cport->SetTxTimeout(5000000);
 }
 
-XBldc_impl::~XBldc_impl() {
-}
+XBldc_impl::~XBldc_impl() {}
 
-void XBldc_impl::SetMotors(float* value) {
-    uint8_t tosend_value[5];
+void XBldc_impl::SetMotors(float *value) {
+  uint8_t tosend_value[5];
 
-    for(int i=0;i<4;i++) tosend_value[i]=(uint8_t)(MAX_VALUE*value[i]);
+  for (int i = 0; i < 4; i++)
+    tosend_value[i] = (uint8_t)(MAX_VALUE * value[i]);
 
-    ssize_t written;
-    tosend_value[4]=0xaa;
-    for(int i=0;i<4;i++) tosend_value[4]+=tosend_value[i];
-    self->Err("please verify motors adresses\n");
-    //todo faire la procedure changement addresse par la station sol
-/*
-    i2cport->GetMutex();
-    i2cport->SetSlave(BASE_ADDRESS);
+  ssize_t written;
+  tosend_value[4] = 0xaa;
+  for (int i = 0; i < 4; i++)
+    tosend_value[4] += tosend_value[i];
+  self->Err("please verify motors adresses\n");
+  // todo faire la procedure changement addresse par la station sol
+  /*
+      i2cport->GetMutex();
+      i2cport->SetSlave(BASE_ADDRESS);
 
-    written =i2cport->Write(tosend_value, sizeof(tosend_value));
-    if(written<0)
-    {
-        self->Err("rt_dev_write error (%s)\n",strerror(-written));
-    }
-    else if (written != sizeof(tosend_value))
-    {
-        self->Err("rt_dev_write error %i/%i\n",written,sizeof(tosend_value));
-    }
+      written =i2cport->Write(tosend_value, sizeof(tosend_value));
+      if(written<0)
+      {
+          self->Err("rt_dev_write error (%s)\n",strerror(-written));
+      }
+      else if (written != sizeof(tosend_value))
+      {
+          self->Err("rt_dev_write error %i/%i\n",written,sizeof(tosend_value));
+      }
 
-    i2cport->ReleaseMutex();*/
-
+      i2cport->ReleaseMutex();*/
 }
 /*
@@ -94,54 +94,57 @@
 */
 void XBldc_impl::ChangeDirection(uint8_t moteur) {
-    unsigned char tx[4];
-    ssize_t written;
+  unsigned char tx[4];
+  ssize_t written;
 
-    tx[0]=254;
-    tx[1]=moteur;
-    tx[2]=0;
-    tx[3]=234+moteur;
+  tx[0] = 254;
+  tx[1] = moteur;
+  tx[2] = 0;
+  tx[3] = 234 + moteur;
 
-    i2cport->GetMutex();
-    i2cport->SetSlave(BASE_ADDRESS);
+  i2cport->GetMutex();
+  i2cport->SetSlave(BASE_ADDRESS);
 
-    written =i2cport->Write(tx, sizeof(tx));
-    if(written<0) {
-        self->Err("rt_dev_write (%s) error\n",strerror(-written));
-    } else if (written != sizeof(tx)) {
-        self->Err("rt_dev_write %i/%i error\n",written,sizeof(tx));
-    }
+  written = i2cport->Write(tx, sizeof(tx));
+  if (written < 0) {
+    self->Err("rt_dev_write (%s) error\n", strerror(-written));
+  } else if (written != sizeof(tx)) {
+    self->Err("rt_dev_write %i/%i error\n", written, sizeof(tx));
+  }
 
-    i2cport->ReleaseMutex();
+  i2cport->ReleaseMutex();
 }
 
-void XBldc_impl::ChangeAdress(uint8_t old_add,uint8_t new_add) {
-    unsigned char tx[4];
-    ssize_t written;
+void XBldc_impl::ChangeAdress(uint8_t old_add, uint8_t new_add) {
+  unsigned char tx[4];
+  ssize_t written;
 
-    tx[0]=250;
-    tx[1]=old_add;
-    tx[2]=new_add;
-    tx[3]=230+old_add+new_add;
+  tx[0] = 250;
+  tx[1] = old_add;
+  tx[2] = new_add;
+  tx[3] = 230 + old_add + new_add;
 
-    i2cport->GetMutex();
-    i2cport->SetSlave(BASE_ADDRESS);
+  i2cport->GetMutex();
+  i2cport->SetSlave(BASE_ADDRESS);
 
-    written =i2cport->Write(tx, sizeof(tx));
-    if(written<0) {
-        self->Err("rt_dev_write error (%s)\n",strerror(-written));
-    } else if (written != sizeof(tx)) {
-        self->Err("rt_dev_write error %i/%i\n",written,sizeof(tx));
-    }
+  written = i2cport->Write(tx, sizeof(tx));
+  if (written < 0) {
+    self->Err("rt_dev_write error (%s)\n", strerror(-written));
+  } else if (written != sizeof(tx)) {
+    self->Err("rt_dev_write error %i/%i\n", written, sizeof(tx));
+  }
 
-    i2cport->ReleaseMutex();
+  i2cport->ReleaseMutex();
 }
 
-uint8_t XBldc_impl::Sat(float value,uint8_t min,uint8_t max) {
-  uint8_t sat_value=(uint8_t)value;
+uint8_t XBldc_impl::Sat(float value, uint8_t min, uint8_t max) {
+  uint8_t sat_value = (uint8_t)value;
 
-  if(value>((float)sat_value+0.5)) sat_value++;
+  if (value > ((float)sat_value + 0.5))
+    sat_value++;
 
-  if(value<(float)min) sat_value=min;
-  if(value>(float)max) sat_value=max;
+  if (value < (float)min)
+    sat_value = min;
+  if (value > (float)max)
+    sat_value = max;
 
   return sat_value;
Index: trunk/lib/FlairSensorActuator/src/geodesie.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/geodesie.cpp	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/geodesie.cpp	(revision 15)
@@ -8,143 +8,158 @@
 
 #ifdef _MSC_VER
-#   pragma warning(disable:4244)
+#pragma warning(disable : 4244)
 #endif //_MSC_VER
 
 namespace Geodesie {
 /// ////////////////////////////////////////////////////////////////////
-Matrice::Matrice(const Matrice & A) {
-    c0_l0=A.c0_l0;c1_l0=A.c1_l0;c2_l0=A.c2_l0;
-    c0_l1=A.c0_l1;c1_l1=A.c1_l1;c2_l1=A.c2_l1;
-    c0_l2=A.c0_l2;c1_l2=A.c1_l2;c2_l2=A.c2_l2;
+Matrice::Matrice(const Matrice &A) {
+  c0_l0 = A.c0_l0;
+  c1_l0 = A.c1_l0;
+  c2_l0 = A.c2_l0;
+  c0_l1 = A.c0_l1;
+  c1_l1 = A.c1_l1;
+  c2_l1 = A.c2_l1;
+  c0_l2 = A.c0_l2;
+  c1_l2 = A.c1_l2;
+  c2_l2 = A.c2_l2;
 }
 /// ////////////////////////////////////////////////////////////////////
 Matrice::Matrice() {
-    c0_l0=0.0;c1_l0=0.0;c2_l0=0.0;
-    c0_l1=0.0;c1_l1=0.0;c2_l1=0.0;
-    c0_l2=0.0;c1_l2=0.0;c2_l2=0.0;
-}
-/// ////////////////////////////////////////////////////////////////////
-void Matrice::Apply(double v0,double v1,double v2, double& Mv0,double& Mv1,double& Mv2) {
-    Mv0 = c0_l0*v0 + c1_l0*v1 + c2_l0*v2;
-    Mv1 = c0_l1*v0 + c1_l1*v1 + c2_l1*v2;
-    Mv2 = c0_l2*v0 + c1_l2*v1 + c2_l2*v2;
+  c0_l0 = 0.0;
+  c1_l0 = 0.0;
+  c2_l0 = 0.0;
+  c0_l1 = 0.0;
+  c1_l1 = 0.0;
+  c2_l1 = 0.0;
+  c0_l2 = 0.0;
+  c1_l2 = 0.0;
+  c2_l2 = 0.0;
+}
+/// ////////////////////////////////////////////////////////////////////
+void Matrice::Apply(double v0, double v1, double v2, double &Mv0, double &Mv1,
+                    double &Mv2) {
+  Mv0 = c0_l0 * v0 + c1_l0 * v1 + c2_l0 * v2;
+  Mv1 = c0_l1 * v0 + c1_l1 * v1 + c2_l1 * v2;
+  Mv2 = c0_l2 * v0 + c1_l2 * v1 + c2_l2 * v2;
 }
 /// ////////////////////////////////////////////////////////////////////
 Matrice ProdMat(const Matrice A, const Matrice B) {
-    Matrice out;
-
-    out.c0_l0=A.c0_l0 * B.c0_l0 + A.c1_l0 * B.c0_l1 + A.c2_l0 * B.c0_l2;
-    out.c1_l0=A.c0_l0 * B.c1_l0 + A.c1_l0 * B.c1_l1 + A.c2_l0 * B.c1_l2;
-    out.c2_l0=A.c0_l0 * B.c2_l0 + A.c1_l0 * B.c2_l1 + A.c2_l0 * B.c2_l2;
-
-    out.c0_l1=A.c0_l1 * B.c0_l0 + A.c1_l1 * B.c0_l1 + A.c2_l1 * B.c0_l2;
-    out.c1_l1=A.c0_l1 * B.c1_l0 + A.c1_l1 * B.c1_l1 + A.c2_l1 * B.c1_l2;
-    out.c2_l1=A.c0_l1 * B.c2_l0 + A.c1_l1 * B.c2_l1 + A.c2_l1 * B.c2_l2;
-
-    out.c0_l2=A.c0_l2 * B.c0_l0 + A.c1_l2 * B.c0_l1 + A.c2_l2 * B.c0_l2;
-    out.c1_l2=A.c0_l2 * B.c1_l0 + A.c1_l2 * B.c1_l1 + A.c2_l2 * B.c1_l2;
-    out.c2_l2=A.c0_l2 * B.c2_l0 + A.c1_l2 * B.c2_l1 + A.c2_l2 * B.c2_l2;
-    return out;
+  Matrice out;
+
+  out.c0_l0 = A.c0_l0 * B.c0_l0 + A.c1_l0 * B.c0_l1 + A.c2_l0 * B.c0_l2;
+  out.c1_l0 = A.c0_l0 * B.c1_l0 + A.c1_l0 * B.c1_l1 + A.c2_l0 * B.c1_l2;
+  out.c2_l0 = A.c0_l0 * B.c2_l0 + A.c1_l0 * B.c2_l1 + A.c2_l0 * B.c2_l2;
+
+  out.c0_l1 = A.c0_l1 * B.c0_l0 + A.c1_l1 * B.c0_l1 + A.c2_l1 * B.c0_l2;
+  out.c1_l1 = A.c0_l1 * B.c1_l0 + A.c1_l1 * B.c1_l1 + A.c2_l1 * B.c1_l2;
+  out.c2_l1 = A.c0_l1 * B.c2_l0 + A.c1_l1 * B.c2_l1 + A.c2_l1 * B.c2_l2;
+
+  out.c0_l2 = A.c0_l2 * B.c0_l0 + A.c1_l2 * B.c0_l1 + A.c2_l2 * B.c0_l2;
+  out.c1_l2 = A.c0_l2 * B.c1_l0 + A.c1_l2 * B.c1_l1 + A.c2_l2 * B.c1_l2;
+  out.c2_l2 = A.c0_l2 * B.c2_l0 + A.c1_l2 * B.c2_l1 + A.c2_l2 * B.c2_l2;
+  return out;
 }
 
 /// ////////////////////////////////////////////////////////////////////
 Matrice TransMat(const Matrice A) {
-    Matrice out;
-    out.c0_l0=A.c0_l0 ; out.c1_l0 = A.c0_l1 ; out.c2_l0 = A.c0_l2 ;
-    out.c0_l1=A.c1_l0 ; out.c1_l1 = A.c1_l1 ; out.c2_l1 = A.c1_l2 ;
-    out.c0_l2=A.c2_l0 ; out.c1_l2 = A.c2_l1 ; out.c2_l2 = A.c2_l2 ;
-    return out;
-}
-
-/// ////////////////////////////////////////////////////////////////////
-void Write(const Matrice A,std::ostream& out) {
-    out<< A.c0_l0<<"\t"<< A.c1_l0<<"\t"<< A.c2_l0<<"\n";
-    out<< A.c0_l1<<"\t"<< A.c1_l1<<"\t"<< A.c2_l1<<"\n";
-    out<< A.c0_l2<<"\t"<< A.c1_l2<<"\t"<< A.c2_l2<<"\n";
-}
-
-/// ////////////////////////////////////////////////////////////////////
-Raf98::~Raf98() {
-    m_dvalues.clear();
-}
+  Matrice out;
+  out.c0_l0 = A.c0_l0;
+  out.c1_l0 = A.c0_l1;
+  out.c2_l0 = A.c0_l2;
+  out.c0_l1 = A.c1_l0;
+  out.c1_l1 = A.c1_l1;
+  out.c2_l1 = A.c1_l2;
+  out.c0_l2 = A.c2_l0;
+  out.c1_l2 = A.c2_l1;
+  out.c2_l2 = A.c2_l2;
+  return out;
+}
+
+/// ////////////////////////////////////////////////////////////////////
+void Write(const Matrice A, std::ostream &out) {
+  out << A.c0_l0 << "\t" << A.c1_l0 << "\t" << A.c2_l0 << "\n";
+  out << A.c0_l1 << "\t" << A.c1_l1 << "\t" << A.c2_l1 << "\n";
+  out << A.c0_l2 << "\t" << A.c1_l2 << "\t" << A.c2_l2 << "\n";
+}
+
+/// ////////////////////////////////////////////////////////////////////
+Raf98::~Raf98() { m_dvalues.clear(); }
 
 //-----------------------------------------------------------------------------
-bool Raf98::Interpol(double longitude, double latitude, double* Hwgs84) const {
-    *Hwgs84 = 0.0;
-    if (m_dvalues.size()==0)
-        return false;
-    const double longitude_min =  -5.5;
-    const double longitude_max =  8.5;
-    if (longitude < longitude_min)
-        return false;
-    if (longitude > longitude_max)
-        return false;
-
-    const double latitude_min =  42;
-    const double latitude_max =  51.5;
-    if (latitude < latitude_min)
-        return false;
-    if (latitude > latitude_max)
-        return false;
-
-    //conversion en position
-    double longPix = (longitude - longitude_min) * 30.;
-    double latPix  = (latitude_max - latitude) * 40.;
-
-    double RestCol,RestLig;
-    double  ColIni,LigIni;
-    RestCol = modf(longPix,&ColIni);
-    RestLig = modf(latPix,&LigIni);
-
-
-    double Zbd = (1.0-RestCol) * (1.0-RestLig) * LitGrille(ColIni  , LigIni  );
-    Zbd += RestCol * (1.0-RestLig) * LitGrille(ColIni+1, LigIni  );
-    Zbd += (1.0-RestCol) *   RestLig  * LitGrille(ColIni  , LigIni+1);
-    Zbd += RestCol * RestLig * LitGrille(ColIni+1, LigIni+1);
-    *Hwgs84 = Zbd;
-
-
-    return true;
-}
-/// ////////////////////////////////////////////////////////////////////
-double Raf98::LitGrille(unsigned int c,unsigned int l) const{
-    const unsigned int w=421;
-    //    const unsigned int h=381;
-    return m_dvalues.at(c+l*w);
-}
-/// ////////////////////////////////////////////////////////////////////
-bool Raf98::Load(const std::string & sin) {
-    std::ifstream in(sin.c_str());
-    unsigned int w = 421;
-    unsigned int h = 381;
-
-    m_dvalues.reserve(w*h);
-
-    char entete[1024];//sur 3 lignes
-    in.getline(entete,1023);
-    in.getline(entete,1023);
-    in.getline(entete,1023);
-
-    char bidon[1024];
-    double val;
-    for (unsigned int i=0; i< h; ++i) {
-        for (unsigned int j=0; j< 52; ++j)  {
-            for (unsigned int k=0; k< 8; ++k) {
-                in >> val;
-                m_dvalues.push_back( val );
-            }
-            in.getline(bidon,1023);
-        }
-        for (unsigned int k=0; k< 5; ++k) {
-            in >> val;
-            m_dvalues.push_back( val );
-        }
-        in.getline(bidon,1023);
-        if (!in.good())         {
-            m_dvalues.clear();
-            return false;
-        }
+bool Raf98::Interpol(double longitude, double latitude, double *Hwgs84) const {
+  *Hwgs84 = 0.0;
+  if (m_dvalues.size() == 0)
+    return false;
+  const double longitude_min = -5.5;
+  const double longitude_max = 8.5;
+  if (longitude < longitude_min)
+    return false;
+  if (longitude > longitude_max)
+    return false;
+
+  const double latitude_min = 42;
+  const double latitude_max = 51.5;
+  if (latitude < latitude_min)
+    return false;
+  if (latitude > latitude_max)
+    return false;
+
+  // conversion en position
+  double longPix = (longitude - longitude_min) * 30.;
+  double latPix = (latitude_max - latitude) * 40.;
+
+  double RestCol, RestLig;
+  double ColIni, LigIni;
+  RestCol = modf(longPix, &ColIni);
+  RestLig = modf(latPix, &LigIni);
+
+  double Zbd = (1.0 - RestCol) * (1.0 - RestLig) * LitGrille(ColIni, LigIni);
+  Zbd += RestCol * (1.0 - RestLig) * LitGrille(ColIni + 1, LigIni);
+  Zbd += (1.0 - RestCol) * RestLig * LitGrille(ColIni, LigIni + 1);
+  Zbd += RestCol * RestLig * LitGrille(ColIni + 1, LigIni + 1);
+  *Hwgs84 = Zbd;
+
+  return true;
+}
+/// ////////////////////////////////////////////////////////////////////
+double Raf98::LitGrille(unsigned int c, unsigned int l) const {
+  const unsigned int w = 421;
+  //    const unsigned int h=381;
+  return m_dvalues.at(c + l * w);
+}
+/// ////////////////////////////////////////////////////////////////////
+bool Raf98::Load(const std::string &sin) {
+  std::ifstream in(sin.c_str());
+  unsigned int w = 421;
+  unsigned int h = 381;
+
+  m_dvalues.reserve(w * h);
+
+  char entete[1024]; // sur 3 lignes
+  in.getline(entete, 1023);
+  in.getline(entete, 1023);
+  in.getline(entete, 1023);
+
+  char bidon[1024];
+  double val;
+  for (unsigned int i = 0; i < h; ++i) {
+    for (unsigned int j = 0; j < 52; ++j) {
+      for (unsigned int k = 0; k < 8; ++k) {
+        in >> val;
+        m_dvalues.push_back(val);
+      }
+      in.getline(bidon, 1023);
     }
-    return in.good();
+    for (unsigned int k = 0; k < 5; ++k) {
+      in >> val;
+      m_dvalues.push_back(val);
+    }
+    in.getline(bidon, 1023);
+    if (!in.good()) {
+      m_dvalues.clear();
+      return false;
+    }
+  }
+  return in.good();
 }
 
@@ -155,189 +170,183 @@
 
 /// ////////////////////////////////////////////////////////////////////
-//ALGO0001
-double Geodesie::LatitueIsometrique(double latitude,double e) {
-    double li;
-    li = log(tan(M_PI_4 + latitude/2.)) + e*log( (1-e*sin(latitude))/(1+e*sin(latitude)) )/2;
-    return li;
-}
-
-/// ////////////////////////////////////////////////////////////////////
-//ALGO0002
-double Geodesie::LatitueIsometrique2Lat(double latitude_iso,double e,double epsilon) {
-    double latitude_i=2*atan(exp(latitude_iso)) - M_PI_2;
-    double latitude_ip1=latitude_i+epsilon*2;
-    while (fabs(latitude_i-latitude_ip1)>epsilon) {
-        latitude_i=latitude_ip1;
-        latitude_ip1=2*atan(
-                    exp(e*0.5*
-                        log(
-                            (1+e*sin(latitude_i))/(1-e*sin(latitude_i))
-                            )
-                        )
-                    *exp(latitude_iso)
-                    ) - M_PI_2;
-    }
-    return latitude_ip1;
-}
-/// ////////////////////////////////////////////////////////////////////
-void Geodesie::Geo2ProjLambert(
-    double lambda,double phi,
-    double n, double c,double e,
-    double lambdac,double xs,double ys,
-    double& X,double& Y)
-{
-    double lat_iso=LatitueIsometrique(phi,e);
-    X=xs+c*exp(-n*lat_iso)*sin(n*(lambda-lambdac));
-    Y=ys-c*exp(-n*lat_iso)*cos(n*(lambda-lambdac));
-}
-/// ////////////////////////////////////////////////////////////////////
-//ALGO0004
-void Geodesie::Proj2GeoLambert(
-    double X,double Y,
-    double n, double c,double e,
-    double lambdac,double xs,double ys,
-    double epsilon,
-    double& lambda,double& phi)
-{
-    double X_xs=X-xs;
-    double ys_Y=ys-Y;
-    double R=sqrt(X_xs*X_xs+ys_Y*ys_Y);
-    double gamma=atan(X_xs/ys_Y);
-    lambda=lambdac+gamma/n;
-    double lat_iso=-1/n*log(fabs(R/c));
-    phi=LatitueIsometrique2Lat(lat_iso,e,epsilon);
+// ALGO0001
+double Geodesie::LatitueIsometrique(double latitude, double e) {
+  double li;
+  li = log(tan(M_PI_4 + latitude / 2.)) +
+       e * log((1 - e * sin(latitude)) / (1 + e * sin(latitude))) / 2;
+  return li;
+}
+
+/// ////////////////////////////////////////////////////////////////////
+// ALGO0002
+double Geodesie::LatitueIsometrique2Lat(double latitude_iso, double e,
+                                        double epsilon) {
+  double latitude_i = 2 * atan(exp(latitude_iso)) - M_PI_2;
+  double latitude_ip1 = latitude_i + epsilon * 2;
+  while (fabs(latitude_i - latitude_ip1) > epsilon) {
+    latitude_i = latitude_ip1;
+    latitude_ip1 = 2 * atan(exp(e * 0.5 * log((1 + e * sin(latitude_i)) /
+                                              (1 - e * sin(latitude_i)))) *
+                            exp(latitude_iso)) -
+                   M_PI_2;
+  }
+  return latitude_ip1;
+}
+/// ////////////////////////////////////////////////////////////////////
+void Geodesie::Geo2ProjLambert(double lambda, double phi, double n, double c,
+                               double e, double lambdac, double xs, double ys,
+                               double &X, double &Y) {
+  double lat_iso = LatitueIsometrique(phi, e);
+  X = xs + c * exp(-n * lat_iso) * sin(n * (lambda - lambdac));
+  Y = ys - c * exp(-n * lat_iso) * cos(n * (lambda - lambdac));
+}
+/// ////////////////////////////////////////////////////////////////////
+// ALGO0004
+void Geodesie::Proj2GeoLambert(double X, double Y, double n, double c, double e,
+                               double lambdac, double xs, double ys,
+                               double epsilon, double &lambda, double &phi) {
+  double X_xs = X - xs;
+  double ys_Y = ys - Y;
+  double R = sqrt(X_xs * X_xs + ys_Y * ys_Y);
+  double gamma = atan(X_xs / ys_Y);
+  lambda = lambdac + gamma / n;
+  double lat_iso = -1 / n * log(fabs(R / c));
+  phi = LatitueIsometrique2Lat(lat_iso, e, epsilon);
 }
 /// ////////////////////////////////////////////////////////////////////
 double Geodesie::ConvMerApp(double longitude) {
-    double phi0_Lambert93 = Deg2Rad(46.5);
-    double lambda0_Lambert93 = Deg2Rad(3.0);
-    double conv=-sin(phi0_Lambert93)*(longitude-lambda0_Lambert93);
-    return  conv;
+  double phi0_Lambert93 = Deg2Rad(46.5);
+  double lambda0_Lambert93 = Deg2Rad(3.0);
+  double conv = -sin(phi0_Lambert93) * (longitude - lambda0_Lambert93);
+  return conv;
 }
 
 ////////////////////////////////////////////////////////////////////
-void Geodesie::Geographique_2_Lambert93(const Raf98& raf98,double lambda,double phi,double he,Matrice in,double& E,double& N,double& h,Matrice& out) {
-    Matrice passage;
-    double conv=Geodesie::ConvMerApp(lambda);
-    double c_=cos(conv);
-    double s_=sin(conv);
-
-    passage.c0_l0 = c_;
-    passage.c0_l1 = s_;
-    passage.c0_l2 =  0.0;
-
-    passage.c1_l0 = -s_;
-    passage.c1_l1 = c_;
-    passage.c1_l2 =  0.0;
-
-    passage.c2_l0 =  0.0;
-    passage.c2_l1 =  0.0;
-    passage.c2_l2 =  1.0;
-
-    out=ProdMat(passage,in);
-    double diff_h;
-    raf98.Interpol(Rad2Deg(lambda),Rad2Deg(phi),&diff_h);
-    h=he-diff_h;
-
-    Geodesie::Geo2ProjLambert(
-                lambda,phi,
-                n_Lambert93,c_Lambert93,e_Lambert93,
-                lambda0_Lambert93,xs_Lambert93,ys_Lambert93,
-                E,N);
+void Geodesie::Geographique_2_Lambert93(const Raf98 &raf98, double lambda,
+                                        double phi, double he, Matrice in,
+                                        double &E, double &N, double &h,
+                                        Matrice &out) {
+  Matrice passage;
+  double conv = Geodesie::ConvMerApp(lambda);
+  double c_ = cos(conv);
+  double s_ = sin(conv);
+
+  passage.c0_l0 = c_;
+  passage.c0_l1 = s_;
+  passage.c0_l2 = 0.0;
+
+  passage.c1_l0 = -s_;
+  passage.c1_l1 = c_;
+  passage.c1_l2 = 0.0;
+
+  passage.c2_l0 = 0.0;
+  passage.c2_l1 = 0.0;
+  passage.c2_l2 = 1.0;
+
+  out = ProdMat(passage, in);
+  double diff_h;
+  raf98.Interpol(Rad2Deg(lambda), Rad2Deg(phi), &diff_h);
+  h = he - diff_h;
+
+  Geodesie::Geo2ProjLambert(lambda, phi, n_Lambert93, c_Lambert93, e_Lambert93,
+                            lambda0_Lambert93, xs_Lambert93, ys_Lambert93, E,
+                            N);
 }
 ////////////////////////////////////////////////////////////////////////
-void Geodesie::Geographique_2_Lambert93(const Raf98& raf98,double lambda,double phi,double he,double& E,double& N,double& h) {
-    Geodesie::Geo2ProjLambert(
-                lambda,phi,
-                n_Lambert93,c_Lambert93,e_Lambert93,
-                lambda0_Lambert93,xs_Lambert93,ys_Lambert93,
-                E,N);
-
-    double diff_h;
-    raf98.Interpol(Rad2Deg(lambda),Rad2Deg(phi),&diff_h);
-    h=he-diff_h;
+void Geodesie::Geographique_2_Lambert93(const Raf98 &raf98, double lambda,
+                                        double phi, double he, double &E,
+                                        double &N, double &h) {
+  Geodesie::Geo2ProjLambert(lambda, phi, n_Lambert93, c_Lambert93, e_Lambert93,
+                            lambda0_Lambert93, xs_Lambert93, ys_Lambert93, E,
+                            N);
+
+  double diff_h;
+  raf98.Interpol(Rad2Deg(lambda), Rad2Deg(phi), &diff_h);
+  h = he - diff_h;
 }
 /**
-    Converts Lambert93 coordinates (East, North, Height) into geographical coordinates in radians (Longitude = Rad2Deg(lambda), Latitude = Rad2Deg(phi), Height)
+    Converts Lambert93 coordinates (East, North, Height) into geographical
+   coordinates in radians (Longitude = Rad2Deg(lambda), Latitude = Rad2Deg(phi),
+   Height)
 */
-void Geodesie::Lambert93_2_Geographique(const Raf98& raf98,double E,double N,double h,double& lambda,double& phi,double& he) {
-    Geodesie::Proj2GeoLambert(
-                E,N,
-                n_Lambert93,c_Lambert93,e_Lambert93,
-                lambda0_Lambert93,xs_Lambert93,ys_Lambert93,
-                0.0000000000000001,
-                lambda,phi);
-
-    double diff_h;
-    raf98.Interpol(Rad2Deg(lambda),Rad2Deg(phi),&diff_h);
-    he=h+diff_h;
+void Geodesie::Lambert93_2_Geographique(const Raf98 &raf98, double E, double N,
+                                        double h, double &lambda, double &phi,
+                                        double &he) {
+  Geodesie::Proj2GeoLambert(E, N, n_Lambert93, c_Lambert93, e_Lambert93,
+                            lambda0_Lambert93, xs_Lambert93, ys_Lambert93,
+                            0.0000000000000001, lambda, phi);
+
+  double diff_h;
+  raf98.Interpol(Rad2Deg(lambda), Rad2Deg(phi), &diff_h);
+  he = h + diff_h;
 }
 ////////////////////////////////////////////////////////////////////////
-void Geodesie::Lambert93_2_Geographique(const Raf98& raf98,double E,double N,double h,Matrice in,double& lambda,double& phi,double& he,Matrice& out) {
-    Geodesie::Proj2GeoLambert(
-                E,N,
-                n_Lambert93,c_Lambert93,e_Lambert93,
-                lambda0_Lambert93,xs_Lambert93,ys_Lambert93,
-                0.0000000000000001,
-                lambda,phi);
-
-    Matrice passage;
-    double conv=Geodesie::ConvMerApp(lambda);
-    double c_=cos(conv);
-    double s_=sin(conv);
-
-    passage.c0_l0 = c_;
-    passage.c0_l1 = -s_;
-    passage.c0_l2 =  0.0;
-
-    passage.c1_l0 = s_;
-    passage.c1_l1 = c_;
-    passage.c1_l2 =  0.0;
-
-    passage.c2_l0 =  0.0;
-    passage.c2_l1 =  0.0;
-    passage.c2_l2 =  1.0;
-
-    out=ProdMat(passage,in);
-
-    double diff_h;
-    raf98.Interpol(Rad2Deg(lambda),Rad2Deg(phi),&diff_h);
-    he=h+diff_h;
+void Geodesie::Lambert93_2_Geographique(const Raf98 &raf98, double E, double N,
+                                        double h, Matrice in, double &lambda,
+                                        double &phi, double &he, Matrice &out) {
+  Geodesie::Proj2GeoLambert(E, N, n_Lambert93, c_Lambert93, e_Lambert93,
+                            lambda0_Lambert93, xs_Lambert93, ys_Lambert93,
+                            0.0000000000000001, lambda, phi);
+
+  Matrice passage;
+  double conv = Geodesie::ConvMerApp(lambda);
+  double c_ = cos(conv);
+  double s_ = sin(conv);
+
+  passage.c0_l0 = c_;
+  passage.c0_l1 = -s_;
+  passage.c0_l2 = 0.0;
+
+  passage.c1_l0 = s_;
+  passage.c1_l1 = c_;
+  passage.c1_l2 = 0.0;
+
+  passage.c2_l0 = 0.0;
+  passage.c2_l1 = 0.0;
+  passage.c2_l2 = 1.0;
+
+  out = ProdMat(passage, in);
+
+  double diff_h;
+  raf98.Interpol(Rad2Deg(lambda), Rad2Deg(phi), &diff_h);
+  he = h + diff_h;
 }
 
 ////////////////////////////////////////////////////////////////////////
-void Geodesie::Geographique_2_ECEF(double longitude,double latitude,double he,double& x,double& y,double& z) {
-    const double n = GRS_a / sqrt(1.0 - pow(GRS_e,2) * pow(sin(latitude),2));
-    x = (n + he) * cos(latitude) * cos(longitude);
-    y = (n + he) * cos(latitude) * sin(longitude);
-    z = (n * (1.0 - pow(GRS_e,2)) + he) * sin(latitude);
+void Geodesie::Geographique_2_ECEF(double longitude, double latitude, double he,
+                                   double &x, double &y, double &z) {
+  const double n = GRS_a / sqrt(1.0 - pow(GRS_e, 2) * pow(sin(latitude), 2));
+  x = (n + he) * cos(latitude) * cos(longitude);
+  y = (n + he) * cos(latitude) * sin(longitude);
+  z = (n * (1.0 - pow(GRS_e, 2)) + he) * sin(latitude);
 }
 
 ////////////////////////////////////////////////////////////////////////
-void Geodesie::ECEF_2_ENU(double x,double y,double z,double& e,double& n,double& u,double lon0,double lat0,double he0) {
-    double slat = std::sin(lat0);
-    double clat = std::cos(lat0);
-    double slon = std::sin(lon0);
-    double clon = std::cos(lon0);
-
-    Geodesie::Matrice C;
-    C.c0_l0 = -slon;
-    C.c1_l0 = clon;
-
-    C.c0_l1 = -clon * slat;
-    C.c1_l1 = -slon * slat;
-    C.c2_l1 = clat;
-
-    C.c0_l2 = clon * clat;
-    C.c1_l2 = slon * clat;
-    C.c2_l2 = slat;
-
-    double x0, y0, z0;
-    Geographique_2_ECEF(lon0,lat0,he0, x0,y0,z0);
-
-    x -= x0;
-    y -= y0;
-    z -= z0;
-
-    C.Apply(x,y,z, e,n,u);
-}
+void Geodesie::ECEF_2_ENU(double x, double y, double z, double &e, double &n,
+                          double &u, double lon0, double lat0, double he0) {
+  double slat = std::sin(lat0);
+  double clat = std::cos(lat0);
+  double slon = std::sin(lon0);
+  double clon = std::cos(lon0);
+
+  Geodesie::Matrice C;
+  C.c0_l0 = -slon;
+  C.c1_l0 = clon;
+
+  C.c0_l1 = -clon * slat;
+  C.c1_l1 = -slon * slat;
+  C.c2_l1 = clat;
+
+  C.c0_l2 = clon * clat;
+  C.c1_l2 = slon * clat;
+  C.c2_l2 = slat;
+
+  double x0, y0, z0;
+  Geographique_2_ECEF(lon0, lat0, he0, x0, y0, z0);
+
+  x -= x0;
+  y -= y0;
+  z -= z0;
+
+  C.Apply(x, y, z, e, n, u);
+}
Index: trunk/lib/FlairSensorActuator/src/unexported/AfroBldc_impl.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/unexported/AfroBldc_impl.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/unexported/AfroBldc_impl.h	(revision 15)
@@ -16,5 +16,4 @@
 /*********************************************************************/
 
-
 #ifndef AFROBLDC_IMPL_H
 #define AFROBLDC_IMPL_H
@@ -25,38 +24,34 @@
 #define MAX_MOTORS 8
 
-namespace flair
-{
-    namespace core
-    {
-        class I2cPort;
-    }
-    namespace gui
-    {
-        class SpinBox;
-        class GroupBox;
-        class Layout;
-    }
-    namespace actuator
-    {
-        class AfroBldc;
-    }
-    namespace sensor
-    {
-        class BatteryMonitor;
-    }
+namespace flair {
+namespace core {
+class I2cPort;
+}
+namespace gui {
+class SpinBox;
+class GroupBox;
+class Layout;
+}
+namespace actuator {
+class AfroBldc;
+}
+namespace sensor {
+class BatteryMonitor;
+}
 }
 
-class AfroBldc_impl
-{
-    public:
-        AfroBldc_impl(flair::actuator::AfroBldc* self,flair::gui::Layout *layout,flair::core::I2cPort* i2cport);
-        ~AfroBldc_impl();
-        void SetMotors(float* value);
+class AfroBldc_impl {
+public:
+  AfroBldc_impl(flair::actuator::AfroBldc *self, flair::gui::Layout *layout,
+                flair::core::I2cPort *i2cport);
+  ~AfroBldc_impl();
+  void SetMotors(float *value);
 
-    private:
-        void WriteValue(uint16_t value);//I2cPort mutex must be taken before calling this function
-        int nb_mot;
-        flair::core::I2cPort* i2cport;
-        flair::actuator::AfroBldc* self;
+private:
+  void WriteValue(uint16_t value); // I2cPort mutex must be taken before calling
+                                   // this function
+  int nb_mot;
+  flair::core::I2cPort *i2cport;
+  flair::actuator::AfroBldc *self;
 };
 
Index: trunk/lib/FlairSensorActuator/src/unexported/BlCtrlV2_impl.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/unexported/BlCtrlV2_impl.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/unexported/BlCtrlV2_impl.h	(revision 15)
@@ -16,5 +16,4 @@
 /*********************************************************************/
 
-
 #ifndef BLCTRLV2_IMPL_H
 #define BLCTRLV2_IMPL_H
@@ -25,44 +24,45 @@
 #define MAX_MOTORS 8
 
-namespace flair
-{
-    namespace core
-    {
-        class I2cPort;
-    }
-    namespace gui
-    {
-        class SpinBox;
-        class GroupBox;
-        class Layout;
-    }
-    namespace actuator
-    {
-        class BlCtrlV2;
-    }
-    namespace sensor
-    {
-        class BatteryMonitor;
-    }
+namespace flair {
+namespace core {
+class I2cPort;
+}
+namespace gui {
+class SpinBox;
+class GroupBox;
+class Layout;
+}
+namespace actuator {
+class BlCtrlV2;
+}
+namespace sensor {
+class BatteryMonitor;
+}
 }
 
-class BlCtrlV2_impl
-{
-    public:
-        BlCtrlV2_impl(flair::actuator::BlCtrlV2* self,flair::gui::Layout *layout,flair::core::I2cPort* i2cport);
-        ~BlCtrlV2_impl();
-        void SetMotors(float* value);
-        flair::sensor::BatteryMonitor *battery;
-        flair::gui::SpinBox *poles;
+class BlCtrlV2_impl {
+public:
+  BlCtrlV2_impl(flair::actuator::BlCtrlV2 *self, flair::gui::Layout *layout,
+                flair::core::I2cPort *i2cport);
+  ~BlCtrlV2_impl();
+  void SetMotors(float *value);
+  flair::sensor::BatteryMonitor *battery;
+  flair::gui::SpinBox *poles;
 
-    private:
-        void WriteValue(uint16_t value);//I2cPort mutex must be taken before calling this function
-        void DetectMotors(void);
-        void GetCurrentSpeedAndVoltage(float &current,float &speed,float &voltage);//I2cPort mutex must be taken before calling this function
-        void GetCurrentAndSpeed(float &current,float &speed);//I2cPort mutex must be taken before calling this function
-        flair::core::Time last_voltage_time;
-        int nb_mot;
-        flair::core::I2cPort* i2cport;
-        flair::actuator::BlCtrlV2* self;
+private:
+  void WriteValue(uint16_t value); // I2cPort mutex must be taken before calling
+                                   // this function
+  void DetectMotors(void);
+  void GetCurrentSpeedAndVoltage(float &current, float &speed,
+                                 float &voltage); // I2cPort mutex must be taken
+                                                  // before calling this
+                                                  // function
+  void GetCurrentAndSpeed(
+      float &current,
+      float &speed); // I2cPort mutex must be taken before calling this function
+  flair::core::Time last_voltage_time;
+  int nb_mot;
+  flair::core::I2cPort *i2cport;
+  flair::actuator::BlCtrlV2 *self;
 };
 
Index: trunk/lib/FlairSensorActuator/src/unexported/Bldc_impl.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/unexported/Bldc_impl.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/unexported/Bldc_impl.h	(revision 15)
@@ -22,49 +22,46 @@
 #include <stdint.h>
 
-namespace flair
-{
-    namespace gui
-    {
-        class DoubleSpinBox;
-        class Layout;
-        class Label;
-        class DataPlot1D;
-        class TabWidget;
-        class PushButton;
-    }
-    namespace actuator
-    {
-        class Bldc;
-    }
+namespace flair {
+namespace gui {
+class DoubleSpinBox;
+class Layout;
+class Label;
+class DataPlot1D;
+class TabWidget;
+class PushButton;
+}
+namespace actuator {
+class Bldc;
+}
 }
 
-class Bldc_impl
-{
-    public:
-        Bldc_impl(flair::actuator::Bldc* self,flair::gui::Layout* layout,std::string name,uint8_t motors_count);
-        Bldc_impl(flair::actuator::Bldc* self,uint8_t motors_count);//simulation
-        ~Bldc_impl();
-        void UpdateFrom(const flair::core::io_data *data);
-        void LockUserInterface(void) const;
-        void UnlockUserInterface(void) const;
-        bool are_enabled;
-        float* power;
-        void UseDefaultPlot(flair::gui::TabWidget* tab);
-        uint8_t motors_count;
-        flair::gui::Layout* layout;
+class Bldc_impl {
+public:
+  Bldc_impl(flair::actuator::Bldc *self, flair::gui::Layout *layout,
+            std::string name, uint8_t motors_count);
+  Bldc_impl(flair::actuator::Bldc *self, uint8_t motors_count); // simulation
+  ~Bldc_impl();
+  void UpdateFrom(const flair::core::io_data *data);
+  void LockUserInterface(void) const;
+  void UnlockUserInterface(void) const;
+  bool are_enabled;
+  float *power;
+  void UseDefaultPlot(flair::gui::TabWidget *tab);
+  uint8_t motors_count;
+  flair::gui::Layout *layout;
 
-    private:
-        float *values;
-        float Sat(float value);
-        flair::actuator::Bldc* self;
-        flair::gui::DoubleSpinBox *min_value,*max_value,*test_value;
-        flair::gui::Label *flight_time;
-        flair::gui::DataPlot1D *plots;
-        flair::core::Time flight_start_time;
-        flair::gui::PushButton **button_test;
-        int time_sec;
-        bool is_running;
-        flair::core::Time test_start_time;
-        int tested_motor;//=-1 if no motor is tested
+private:
+  float *values;
+  float Sat(float value);
+  flair::actuator::Bldc *self;
+  flair::gui::DoubleSpinBox *min_value, *max_value, *test_value;
+  flair::gui::Label *flight_time;
+  flair::gui::DataPlot1D *plots;
+  flair::core::Time flight_start_time;
+  flair::gui::PushButton **button_test;
+  int time_sec;
+  bool is_running;
+  flair::core::Time test_start_time;
+  int tested_motor; //=-1 if no motor is tested
 };
 
Index: trunk/lib/FlairSensorActuator/src/unexported/Gx3_25_imu_impl.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/unexported/Gx3_25_imu_impl.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/unexported/Gx3_25_imu_impl.h	(revision 15)
@@ -18,15 +18,15 @@
 
 namespace flair {
-    namespace core {
-        class FrameworkManager;
-        class SerialPort;
-        class AhrsData;
-    }
-    namespace gui {
-        class SpinBox;
-        class CheckBox;
-        class PushButton;
-        class Label;
-    }
+namespace core {
+class FrameworkManager;
+class SerialPort;
+class AhrsData;
+}
+namespace gui {
+class SpinBox;
+class CheckBox;
+class PushButton;
+class Label;
+}
 }
 
@@ -38,33 +38,38 @@
 class Gx3_25_imu_impl {
 
-    public:
-        Gx3_25_imu_impl(flair::sensor::Gx3_25_imu* self,std::string name,flair::core::SerialPort *serialport,flair::sensor::Gx3_25_imu::Command_t command,flair::gui::GroupBox* setupgroupbox);
-        ~Gx3_25_imu_impl();
-        void Run(void);
+public:
+  Gx3_25_imu_impl(flair::sensor::Gx3_25_imu *self, std::string name,
+                  flair::core::SerialPort *serialport,
+                  flair::sensor::Gx3_25_imu::Command_t command,
+                  flair::gui::GroupBox *setupgroupbox);
+  ~Gx3_25_imu_impl();
+  void Run(void);
 
-    private:
-        void DeviceReset(void);
-        void GetData(uint8_t* buf,ssize_t buf_size,flair::core::Time *time);
-        float Dequeue(uint8_t** buf);
-        void GyrosBias(void);
-        void SamplingSettings(void);
-        void SetBaudrate(int value);
-        bool CalcChecksum(uint8_t *buf,int size);
-        int FirmwareNumber(void);
-        void PrintModelInfo(void);
-        void RealignUpNorth(bool realign_up,bool realign_north);
+private:
+  void DeviceReset(void);
+  void GetData(uint8_t *buf, ssize_t buf_size, flair::core::Time *time);
+  float Dequeue(uint8_t **buf);
+  void GyrosBias(void);
+  void SamplingSettings(void);
+  void SetBaudrate(int value);
+  bool CalcChecksum(uint8_t *buf, int size);
+  int FirmwareNumber(void);
+  void PrintModelInfo(void);
+  void RealignUpNorth(bool realign_up, bool realign_north);
 
-        void SetContinuousMode(uint8_t continuous_command);
+  void SetContinuousMode(uint8_t continuous_command);
 
-        flair::gui::GroupBox *setupgroupbox;
-        flair::gui::SpinBox *data_rate,*gyro_acc_size,*mag_size,*up_comp,*north_comp;
-        flair::gui::CheckBox *coning,*disable_magn,*disable_north_comp,*disable_grav_comp;
-        flair::gui::PushButton *button_bias;
-        flair::gui::Label *data_rate_label;
+  flair::gui::GroupBox *setupgroupbox;
+  flair::gui::SpinBox *data_rate, *gyro_acc_size, *mag_size, *up_comp,
+      *north_comp;
+  flair::gui::CheckBox *coning, *disable_magn, *disable_north_comp,
+      *disable_grav_comp;
+  flair::gui::PushButton *button_bias;
+  flair::gui::Label *data_rate_label;
 
-        flair::core::SerialPort *serialport;
-        uint8_t command;
-        flair::sensor::Gx3_25_imu *self;
-        flair::core::AhrsData *ahrsData;
+  flair::core::SerialPort *serialport;
+  uint8_t command;
+  flair::sensor::Gx3_25_imu *self;
+  flair::core::AhrsData *ahrsData;
 };
 
Index: trunk/lib/FlairSensorActuator/src/unexported/VrpnClient_impl.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/unexported/VrpnClient_impl.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/unexported/VrpnClient_impl.h	(revision 15)
@@ -22,25 +22,21 @@
 #include <vector>
 
-namespace flair
-{
-    namespace core
-    {
-        class OneAxisRotation;
-        class Vector3D;
-        class Quaternion;
-        class Mutex;
-        class SerialPort;
-    }
-    namespace gui
-    {
-        class TabWidget;
-        class Tab;
-        class Layout;
-    }
-    namespace sensor
-    {
-        class VrpnClient;
-        class VrpnObject;
-    }
+namespace flair {
+namespace core {
+class OneAxisRotation;
+class Vector3D;
+class Quaternion;
+class Mutex;
+class SerialPort;
+}
+namespace gui {
+class TabWidget;
+class Tab;
+class Layout;
+}
+namespace sensor {
+class VrpnClient;
+class VrpnObject;
+}
 }
 
@@ -48,36 +44,37 @@
 class vrpn_Connection;
 
-class VrpnClient_impl
-{
-    public:
-        VrpnClient_impl(flair::sensor::VrpnClient* self,std::string name,std::string address,uint16_t us_period);
-        VrpnClient_impl(flair::sensor::VrpnClient* self,std::string name,flair::core::SerialPort* serialport,uint16_t us_period);
-        ~VrpnClient_impl();
-        void AddTrackable(flair::sensor::VrpnObject* obj);//normal
-        void RemoveTrackable(flair::sensor::VrpnObject* obj);//normal
-        void AddTrackable(VrpnObject_impl* obj,uint8_t id);//xbee
-        void RemoveTrackable(VrpnObject_impl* obj);//xbee
-        void ComputeRotations(flair::core::Vector3D& point);
-        void ComputeRotations(flair::core::Quaternion& quat);
-        bool UseXbee(void);
-        void Run(void);
-        flair::gui::Tab* setup_tab;
-        flair::gui::TabWidget* tab;
-        vrpn_Connection *connection;
+class VrpnClient_impl {
+public:
+  VrpnClient_impl(flair::sensor::VrpnClient *self, std::string name,
+                  std::string address, uint16_t us_period);
+  VrpnClient_impl(flair::sensor::VrpnClient *self, std::string name,
+                  flair::core::SerialPort *serialport, uint16_t us_period);
+  ~VrpnClient_impl();
+  void AddTrackable(flair::sensor::VrpnObject *obj); // normal
+  void RemoveTrackable(flair::sensor::VrpnObject *obj); // normal
+  void AddTrackable(VrpnObject_impl *obj, uint8_t id); // xbee
+  void RemoveTrackable(VrpnObject_impl *obj); // xbee
+  void ComputeRotations(flair::core::Vector3D &point);
+  void ComputeRotations(flair::core::Quaternion &quat);
+  bool UseXbee(void);
+  void Run(void);
+  flair::gui::Tab *setup_tab;
+  flair::gui::TabWidget *tab;
+  vrpn_Connection *connection;
 
-    private:
-        flair::sensor::VrpnClient* self;
-        flair::core::Mutex* mutex;
-        uint16_t us_period;
-        std::vector<flair::sensor::VrpnObject*> trackables;
-        typedef struct xbee_object{
-            VrpnObject_impl* vrpnobject;
-            uint8_t id;
-        } xbee_object;
+private:
+  flair::sensor::VrpnClient *self;
+  flair::core::Mutex *mutex;
+  uint16_t us_period;
+  std::vector<flair::sensor::VrpnObject *> trackables;
+  typedef struct xbee_object {
+    VrpnObject_impl *vrpnobject;
+    uint8_t id;
+  } xbee_object;
 
-        std::vector<xbee_object> xbee_objects;
-        flair::gui::Tab* main_tab;
-        flair::core::OneAxisRotation *rotation_1,*rotation_2;
-        flair::core::SerialPort* serialport;
+  std::vector<xbee_object> xbee_objects;
+  flair::gui::Tab *main_tab;
+  flair::core::OneAxisRotation *rotation_1, *rotation_2;
+  flair::core::SerialPort *serialport;
 };
 
Index: trunk/lib/FlairSensorActuator/src/unexported/VrpnObject_impl.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/unexported/VrpnObject_impl.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/unexported/VrpnObject_impl.h	(revision 15)
@@ -25,53 +25,51 @@
 #include "Quaternion.h"
 
-namespace flair
-{
-    namespace core
-    {
-        class cvmatrix;
-        class Vector3D;
-        class Euler;
-    }
-    namespace gui
-    {
-        class TabWidget;
-        class Tab;
-        class DataPlot1D;
-    }
-    namespace sensor
-    {
-        class VrpnClient;
-        class VrpnObject;
-    }
+namespace flair {
+namespace core {
+class cvmatrix;
+class Vector3D;
+class Euler;
+}
+namespace gui {
+class TabWidget;
+class Tab;
+class DataPlot1D;
+}
+namespace sensor {
+class VrpnClient;
+class VrpnObject;
+}
 }
 
-class VrpnObject_impl
-{
-    friend class VrpnClient_impl;
+class VrpnObject_impl {
+  friend class VrpnClient_impl;
 
-    public:
-        VrpnObject_impl(flair::sensor::VrpnObject* self,const flair::sensor::VrpnClient *parent,std::string name,int id,const flair::gui::TabWidget* tab);
-        ~VrpnObject_impl(void);
+public:
+  VrpnObject_impl(flair::sensor::VrpnObject *self,
+                  const flair::sensor::VrpnClient *parent, std::string name,
+                  int id, const flair::gui::TabWidget *tab);
+  ~VrpnObject_impl(void);
 
-        void mainloop(void);
-        void GetEuler(flair::core::Euler &euler);
-        void GetQuaternion(flair::core::Quaternion &quaternion);
-        void GetPosition(flair::core::Vector3D &point);
-        bool IsTracked(unsigned int timeout_ms);
+  void mainloop(void);
+  void GetEuler(flair::core::Euler &euler);
+  void GetQuaternion(flair::core::Quaternion &quaternion);
+  void GetPosition(flair::core::Vector3D &point);
+  bool IsTracked(unsigned int timeout_ms);
 
-        flair::gui::Tab* plot_tab;
-        flair::gui::DataPlot1D* x_plot;
-        flair::gui::DataPlot1D* y_plot;
-        flair::gui::DataPlot1D* z_plot;
-        flair::core::cvmatrix *output,*state;
+  flair::gui::Tab *plot_tab;
+  flair::gui::DataPlot1D *x_plot;
+  flair::gui::DataPlot1D *y_plot;
+  flair::gui::DataPlot1D *z_plot;
+  flair::core::cvmatrix *output, *state;
 
-        static void	VRPN_CALLBACK handle_pos(void *userdata, const vrpn_TRACKERCB t);
+  static void VRPN_CALLBACK handle_pos(void *userdata, const vrpn_TRACKERCB t);
 
-    private:
-        flair::sensor::VrpnObject* self;
-        const flair::sensor::VrpnClient *parent;
-        vrpn_Tracker_Remote* tracker;
-        flair::core::Quaternion quaternion;//todo: quaternion should be included in the output to replace euler angles
-        void Update(void);
+private:
+  flair::sensor::VrpnObject *self;
+  const flair::sensor::VrpnClient *parent;
+  vrpn_Tracker_Remote *tracker;
+  flair::core::Quaternion quaternion; // todo: quaternion should be included in
+                                      // the output to replace euler angles
+  void Update(void);
 };
 
Index: trunk/lib/FlairSensorActuator/src/unexported/XBldc_impl.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/unexported/XBldc_impl.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/unexported/XBldc_impl.h	(revision 15)
@@ -16,5 +16,4 @@
 /*********************************************************************/
 
-
 #ifndef XBLDC_IMPL_H
 #define XBLDC_IMPL_H
@@ -23,33 +22,28 @@
 #include <stdint.h>
 
-namespace flair
-{
-    namespace core
-    {
-        class I2cPort;
-    }
-    namespace actuator
-    {
-        class XBldc;
-    }
+namespace flair {
+namespace core {
+class I2cPort;
+}
+namespace actuator {
+class XBldc;
+}
 }
 
+class XBldc_impl {
 
-class XBldc_impl
-{
+public:
+  XBldc_impl(flair::actuator::XBldc *self, flair::core::I2cPort *i2cport);
+  ~XBldc_impl();
+  void UpdateFrom(flair::core::io_data *data);
+  void SetMotors(float *value);
 
-    public:
-        XBldc_impl(flair::actuator::XBldc* self,flair::core::I2cPort* i2cport);
-        ~XBldc_impl();
-        void UpdateFrom(flair::core::io_data *data);
-        void SetMotors(float* value);
-
-    private:
-        uint8_t Sat(float value,uint8_t min,uint8_t max);
-        //void StartTest(uint8_t moteur);
-        void ChangeDirection(uint8_t moteur);
-        void ChangeAdress(uint8_t old_add,uint8_t new_add);
-        flair::actuator::XBldc* self;
-        flair::core::I2cPort* i2cport;
+private:
+  uint8_t Sat(float value, uint8_t min, uint8_t max);
+  // void StartTest(uint8_t moteur);
+  void ChangeDirection(uint8_t moteur);
+  void ChangeAdress(uint8_t old_add, uint8_t new_add);
+  flair::actuator::XBldc *self;
+  flair::core::I2cPort *i2cport;
 };
 
Index: trunk/lib/FlairSensorActuator/src/unexported/geodesie.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/unexported/geodesie.h	(revision 10)
+++ trunk/lib/FlairSensorActuator/src/unexported/geodesie.h	(revision 15)
@@ -13,55 +13,64 @@
 
 #ifndef M_PI
-#   define M_PI 3.14159265358979323846
+#define M_PI 3.14159265358979323846
 #endif
 #ifndef M_PI_2
-#   define M_PI_2 1.57079632679489661923
+#define M_PI_2 1.57079632679489661923
 #endif
 #ifndef M_PI_4
-#   define M_PI_4 0.78539816339744830962
+#define M_PI_4 0.78539816339744830962
 #endif
 
 ////////////////////////////////////////////////////////////////////////
 struct Matrice {
-    Matrice(const Matrice & A);
-    Matrice();
-    void Apply(double v0, double v1, double v2, double & Mv0, double & Mv1, double & Mv2);
-    double c0_l0;double c1_l0;double c2_l0;
-    double c0_l1;double c1_l1;double c2_l1;
-    double c0_l2;double c1_l2;double c2_l2;
+  Matrice(const Matrice &A);
+  Matrice();
+  void Apply(double v0, double v1, double v2, double &Mv0, double &Mv1,
+             double &Mv2);
+  double c0_l0;
+  double c1_l0;
+  double c2_l0;
+  double c0_l1;
+  double c1_l1;
+  double c2_l1;
+  double c0_l2;
+  double c1_l2;
+  double c2_l2;
 }; // class
 
 Matrice TransMat(const Matrice A);
 
-Matrice ProdMat(const Matrice A,const Matrice B);
-void Write(const Matrice A,std::ostream& out);
+Matrice ProdMat(const Matrice A, const Matrice B);
+void Write(const Matrice A, std::ostream &out);
 
 ////////////////////////////////////////////////////////////////////////
 class Raf98 {
-private :
-    std::vector<double> m_dvalues;
-    double LitGrille(unsigned int c,unsigned int l) const;
-public :
-    ~Raf98();
-    Raf98() {}
-    bool Load(const std::string & s);
-    bool Interpol(double longitude/*deg*/, double latitude/*deg*/, double* Hwgs84) const;
+private:
+  std::vector<double> m_dvalues;
+  double LitGrille(unsigned int c, unsigned int l) const;
+
+public:
+  ~Raf98();
+  Raf98() {}
+  bool Load(const std::string &s);
+  bool Interpol(double longitude /*deg*/, double latitude /*deg*/,
+                double *Hwgs84) const;
 }; // class
 ////////////////////////////////////////////////////////////////////////
 
 ////////////////////////////////////////////////////////////////////////
-inline double Deg2Rad(double deg) {return deg*M_PI/180.0;}
-inline double Rad2Deg(double rad) {return rad*180.0/M_PI;}
+inline double Deg2Rad(double deg) { return deg * M_PI / 180.0; }
+inline double Rad2Deg(double rad) { return rad * 180.0 / M_PI; }
 ////////////////////////////////////////////////////////////////////////
 
-const double a_Lambert93=6378137;
-const double f_Lambert93=1 / 298.257222101;
-const double e_Lambert93=sqrt(f_Lambert93*(2-f_Lambert93));
-const double lambda0_Lambert93=Deg2Rad(3.0);//degres
-const double phi0_Lambert93=Deg2Rad(46.5);
-const double phi1_Lambert93=Deg2Rad(44.0);
-const double phi2_Lambert93=Deg2Rad(49.0);//degres
-const double X0_Lambert93=700000;//
-const double Y0_Lambert93=6600000;//
+const double a_Lambert93 = 6378137;
+const double f_Lambert93 = 1 / 298.257222101;
+const double e_Lambert93 = sqrt(f_Lambert93 * (2 - f_Lambert93));
+const double lambda0_Lambert93 = Deg2Rad(3.0); // degres
+const double phi0_Lambert93 = Deg2Rad(46.5);
+const double phi1_Lambert93 = Deg2Rad(44.0);
+const double phi2_Lambert93 = Deg2Rad(49.0); // degres
+const double X0_Lambert93 = 700000;  //
+const double Y0_Lambert93 = 6600000; //
 const double n_Lambert93 = 0.7256077650;
 const double c_Lambert93 = 11754255.426;
@@ -70,13 +79,19 @@
 
 const double GRS_a = 6378137;
-const double GRS_f = 1/298.257222101;
-const double GRS_b = GRS_a*(1-GRS_f);
-const double GRS_e = sqrt((pow(GRS_a,2) - pow(GRS_b,2)) / pow(GRS_a,2));
+const double GRS_f = 1 / 298.257222101;
+const double GRS_b = GRS_a * (1 - GRS_f);
+const double GRS_e = sqrt((pow(GRS_a, 2) - pow(GRS_b, 2)) / pow(GRS_a, 2));
 
 ////////////////////////////////////////////////////////////////////////
-void Geographique_2_Lambert93(const Raf98& raf98,double lambda,double phi,double he,Matrice in,double& E,double& N,double& h,Matrice& out);
-void Geographique_2_Lambert93(const Raf98& raf98,double lambda,double phi,double he,double& E,double& N,double& h);
-void Lambert93_2_Geographique(const Raf98& raf98,double E,double N,double h,double& lambda,double& phi,double& he);
-void Lambert93_2_Geographique(const Raf98& raf98,double E,double N,double h,Matrice in,double& lambda,double& phi,double& he,Matrice& out);
+void Geographique_2_Lambert93(const Raf98 &raf98, double lambda, double phi,
+                              double he, Matrice in, double &E, double &N,
+                              double &h, Matrice &out);
+void Geographique_2_Lambert93(const Raf98 &raf98, double lambda, double phi,
+                              double he, double &E, double &N, double &h);
+void Lambert93_2_Geographique(const Raf98 &raf98, double E, double N, double h,
+                              double &lambda, double &phi, double &he);
+void Lambert93_2_Geographique(const Raf98 &raf98, double E, double N, double h,
+                              Matrice in, double &lambda, double &phi,
+                              double &he, Matrice &out);
 /** Convert from geographique to ECEF.
  * @param[in] longitude Longitude in radian.
@@ -84,5 +99,6 @@
  * @param[in] he Height in meter.
  */
-void Geographique_2_ECEF(double longitude, double latitude, double he, double& x, double& y, double& z);
+void Geographique_2_ECEF(double longitude, double latitude, double he,
+                         double &x, double &y, double &z);
 /** Convert from ECEF two ENU.
  * @param[in] lon0 Longitude of the origin in radian.
@@ -90,25 +106,21 @@
  * @param[in] he0 Height of the origin in radian.
  */
-void ECEF_2_ENU(double x,double y,double z,double& e,double& n,double& u,double lon0,double lat0,double he0);
+void ECEF_2_ENU(double x, double y, double z, double &e, double &n, double &u,
+                double lon0, double lat0, double he0);
 ////////////////////////////////////////////////////////////////////////
 
-//ALGO0001
-double LatitueIsometrique(double latitude,double e);
-//ALGO0002
-double LatitueIsometrique2Lat(double latitude_iso,double e,double epsilon);
+// ALGO0001
+double LatitueIsometrique(double latitude, double e);
+// ALGO0002
+double LatitueIsometrique2Lat(double latitude_iso, double e, double epsilon);
 
-//ALGO0003
-void Geo2ProjLambert(
-    double lambda,double phi,
-    double n, double c,double e,
-    double lambdac,double xs,double ys,
-    double& X,double& Y);
-//ALGO0004
-void Proj2GeoLambert(
-    double X,double Y,
-    double n, double c,double e,
-    double lambdac,double xs,double ys,
-    double epsilon,
-    double& lambda,double& phi);
+// ALGO0003
+void Geo2ProjLambert(double lambda, double phi, double n, double c, double e,
+                     double lambdac, double xs, double ys, double &X,
+                     double &Y);
+// ALGO0004
+void Proj2GeoLambert(double X, double Y, double n, double c, double e,
+                     double lambdac, double xs, double ys, double epsilon,
+                     double &lambda, double &phi);
 
 double ConvMerApp(double longitude);
@@ -118,7 +130,7 @@
 */
 template <typename _T1, typename _T2>
-void cartesianToPolar(const _T1 x, const _T1 y, _T2 & r, _T2 & theta) {
-    r = std::sqrt(x*x + y*y);
-    theta = std::atan2(x, y);
+void cartesianToPolar(const _T1 x, const _T1 y, _T2 &r, _T2 &theta) {
+  r = std::sqrt(x * x + y * y);
+  theta = std::atan2(x, y);
 }
 
@@ -127,29 +139,33 @@
 */
 template <typename _T1, typename _T2>
-void polarToCartesian(const _T1 r, const _T1 theta, _T2 & x, _T2 & y) {
-    x = r * std::cos(theta);
-    y = r * std::sin(theta);
+void polarToCartesian(const _T1 r, const _T1 theta, _T2 &x, _T2 &y) {
+  x = r * std::cos(theta);
+  y = r * std::sin(theta);
 }
 
 /**
-Converts Cartesian (x, y, z) coordinates to spherical coordinates (r, theta, phi)
+Converts Cartesian (x, y, z) coordinates to spherical coordinates (r, theta,
+phi)
 Angles expressed in radians.
 */
 template <typename _T1, typename _T2>
-void cartesianToSpherical(const _T1 x, const _T1 y, const _T1 z, _T2 & r, _T2 & theta, _T2 & phi) {
-    r = std::sqrt(x*x + y*y + z*z);
-    theta = std::acos(z / r);
-    phi = std::atan2(y, x);
+void cartesianToSpherical(const _T1 x, const _T1 y, const _T1 z, _T2 &r,
+                          _T2 &theta, _T2 &phi) {
+  r = std::sqrt(x * x + y * y + z * z);
+  theta = std::acos(z / r);
+  phi = std::atan2(y, x);
 }
 
 /**
-Converts spherical coordinates (r, theta, phi) to Cartesian (x, y, z) coordinates.
+Converts spherical coordinates (r, theta, phi) to Cartesian (x, y, z)
+coordinates.
 Angles expressed in radians.
 */
 template <typename _T1, typename _T2>
-void sphericalToCartesian(const _T1 r, const _T1 theta, const _T1 phi, _T2 & x, _T2 & y, _T2 & z) {
-    x = r * std::sin(theta) * std::cos(phi);
-    y = r * std::sin(theta) * std::sin(phi);
-    z = r * std::cos(theta);
+void sphericalToCartesian(const _T1 r, const _T1 theta, const _T1 phi, _T2 &x,
+                          _T2 &y, _T2 &z) {
+  x = r * std::sin(theta) * std::cos(phi);
+  y = r * std::sin(theta) * std::sin(phi);
+  z = r * std::cos(theta);
 }
 
