Index: trunk/lib/FlairSensorActuator/src/SimuBldc.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuBldc.cpp	(revision 275)
+++ 	(revision )
@@ -1,83 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-//  created:    2014/02/07
-//  filename:   SimuBldc.cpp
-//
-//  author:     Guillaume Sanahuja
-//              Copyright Heudiasyc UMR UTC/CNRS 7253
-//
-//  version:    $Id: $
-//
-//  purpose:    Class for a simulation bldc
-//
-//
-/*********************************************************************/
-#ifdef CORE2_64
-
-#include "SimuBldc.h"
-#include <FrameworkManager.h>
-#include <GridLayout.h>
-#include <DoubleSpinBox.h>
-#include <GroupBox.h>
-#include <SharedMem.h>
-#include <Matrix.h>
-#include <sstream>
-#include <string.h>
-
-using std::string;
-using std::ostringstream;
-using namespace flair::core;
-using namespace flair::gui;
-
-namespace flair {
-namespace actuator {
-
-SimuBldc::SimuBldc(const IODevice *parent, Layout *layout, string name,
-                   uint8_t motors_count, uint32_t modelId,uint32_t deviceId)
-    : Bldc(parent, layout, name, motors_count) {
-  shmem =
-      new SharedMem(this, ShMemName(modelId, deviceId), motors_count * sizeof(float)+sizeof(Time));
-
-  GroupBox *groupbox = new GroupBox(layout->NewRow(), "simubldc");
-  k = new DoubleSpinBox(groupbox->NewRow(), "k driver:", 0, 10000, 1);
-  
-  buf=(char*)malloc(motors_count * sizeof(float)+sizeof(Time));
-  if(buf==NULL) {
-    Err("error creating buffer\n");
-    return;
-  }
-  SetIsReady(true);
-}
-
-SimuBldc::~SimuBldc() {
-  if(buf!=NULL) free(buf);
-}
-
-string SimuBldc::ShMemName(uint32_t modelId,uint32_t deviceId) {
-  ostringstream dev_name;
-  dev_name << "simu" <<  modelId << "_bldc_" << deviceId;
-  return dev_name.str().c_str();
-}
-
-void SimuBldc::SetMotors(float *value) {
-  float *values=(float*)buf;
-  for (int i = 0; i < MotorsCount(); i++) values[i] = k->Value() * value[i];
-  Time time=GetTime();
-  memcpy(buf+MotorsCount() * sizeof(float),&time,sizeof(Time));
-
-  shmem->Write(buf, MotorsCount() * sizeof(float)+sizeof(Time));
-
-  // 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();
-}
-
-} // end namespace sensor
-} // end namespace flair
-
-#endif
Index: trunk/lib/FlairSensorActuator/src/SimuBldc.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuBldc.h	(revision 275)
+++ 	(revision )
@@ -1,97 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-/*!
- * \file SimuBldc.h
- * \brief Class for a simulation bldc
- * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
- * \date 2014/02/07
- * \version 4.0
- */
-
-#ifndef SIMUBLDC_H
-#define SIMUBLDC_H
-
-#include <Bldc.h>
-
-namespace flair {
-namespace core {
-class SharedMem;
-class IODevice;
-class Matrix;
-}
-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
-  *
-  * \param parent parent
-  * \param layout layout
-  * \param name name
-  * \param motors_count number of motors
-  * \param modelId Model id
-  * \param deviceId Bldc id of the Model
-  */
-  SimuBldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
-           uint8_t motors_count, uint32_t modelId,uint32_t deviceId);
-
-  /*!
-  * \brief Destructor
-  *
-  */
-  ~SimuBldc();
-
-  /*!
-  * \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; };
-
-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);
-  
-  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
-  core::SharedMem *shmem;
-  gui::DoubleSpinBox *k;
-  char *buf;
-
-};
-} // end namespace actuator
-} // end namespace flair
-#endif // SIMUBLDC_H
Index: trunk/lib/FlairSensorActuator/src/SimuCamera.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuCamera.cpp	(revision 275)
+++ 	(revision )
@@ -1,98 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-//  created:    2014/03/06
-//  filename:   SimuCamera.cpp
-//
-//  author:     Guillaume Sanahuja
-//              Copyright Heudiasyc UMR UTC/CNRS 7253
-//
-//  version:    $Id: $
-//
-//  purpose:    Class for a simulation camera
-//
-//
-/*********************************************************************/
-#ifdef CORE2_64
-
-#include "SimuCamera.h"
-#include <FrameworkManager.h>
-#include <GroupBox.h>
-#include <SharedMem.h>
-#include <sstream>
-
-using std::string;
-using std::ostringstream;
-using namespace flair::core;
-using namespace flair::gui;
-
-namespace flair {
-namespace sensor {
-
-SimuCamera::SimuCamera(string name,
-                       uint16_t width, uint16_t height, uint8_t channels,
-                       uint32_t modelId,uint32_t deviceId, uint8_t priority)
-    : Thread(getFrameworkManager(), name, priority),
-      Camera(name, width, height, cvimage::Type::Format::BGR) {
-
-  buf_size = width * height * channels+sizeof(Time);
-
-  shmemReadBuf=(char*)malloc(buf_size);
-  output->img->imageData = shmemReadBuf;
-
-  ostringstream dev_name;
-  dev_name << "simu" <<  modelId << "_cam_" << deviceId;
-  shmem = new SharedMem((Thread *)this,ShMemName(modelId, deviceId), buf_size, SharedMem::Type::producerConsumer);
-  
-  SetIsReady(true);
-}
-
-
-SimuCamera::~SimuCamera() {
-  SafeStop();
-  Join();
-  if(shmemReadBuf!=NULL) delete shmemReadBuf;
-}
-
-string SimuCamera::ShMemName(uint32_t modelId,uint32_t deviceId) {
-  ostringstream dev_name;
-  dev_name << "simu" <<  modelId << "_cam_" << deviceId;
-  return dev_name.str().c_str();
-}
-
-void SimuCamera::Run(void) {
-  Time time;
-
-//  SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
-  shmem->ReaderReady();
-
-  while (!ToBeStopped()) {
-//    WaitPeriod();
-
-//    if (data_rate->ValueChanged() == true) {
-//      SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
-//    }
-
-    output->GetMutex();
-    //blocking read
-    if (shmem->Read(shmemReadBuf, buf_size, 1000000000)) { // remplacer copie par
-      // échange de pointeur sur
-      // double buffering
-
-      output->ReleaseMutex();
-      memcpy(&time, shmemReadBuf + buf_size - sizeof(Time), sizeof(Time));
-      output->SetDataTime(time);
-
-      ProcessUpdate(output);
-    } else {
-      output->ReleaseMutex();
-      //Thread::Warn("Read Timeout\n");
-    }
-  }
-}
-
-} // end namespace sensor
-} // end namespace flair
-
-#endif
Index: trunk/lib/FlairSensorActuator/src/SimuCamera.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuCamera.h	(revision 275)
+++ 	(revision )
@@ -1,91 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-/*!
- * \file SimuCamera.h
- * \brief Class for a simulation camera
- * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
- * \date 2014/03/06
- * \version 4.0
- */
-
-#ifndef SIMUCAMERA_H
-#define SIMUCAMERA_H
-
-#include <Camera.h>
-#include <Thread.h>
-#include <cxcore.h>
-
-namespace flair {
-  namespace core {
-    class SharedMem;
-  }
-}
-
-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.
-	* It will be child of the FrameworkManager.
-  *
-  * \param name name
-  * \param width width
-  * \param height height
-  * \param channels number of channels
-  * \param modelId Model id
-  * \param deviceId Camera id of the Model
-  * \param priority priority of the Thread
-  */
-  SimuCamera(std::string name,
-             uint16_t width, uint16_t height, uint8_t channels, uint32_t modelId,uint32_t deviceId,
-             uint8_t priority);
-
-
-  /*!
-  * \brief Destructor
-  *
-  */
-  ~SimuCamera();
-
-protected:
-  /*!
-  * \brief SharedMem to access datas
-  *
-  */
-  core::SharedMem *shmem;
-
-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){};
-  
-  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
-
-  size_t buf_size;
-  char* shmemReadBuf;
-};
-} // end namespace sensor
-} // end namespace flair
-#endif // SIMUCAMERA_H
Index: trunk/lib/FlairSensorActuator/src/SimuGps.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuGps.cpp	(revision 275)
+++ 	(revision )
@@ -1,137 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-//  created:    2014/05/26
-//  filename:   SimuGps.cpp
-//
-//  author:     Guillaume Sanahuja
-//              Copyright Heudiasyc UMR UTC/CNRS 7253
-//
-//  version:    $Id: $
-//
-//  purpose:    Class for a simulation GPS
-//
-//
-/*********************************************************************/
-#ifdef CORE2_64
-
-#include "SimuGps.h"
-#include <FrameworkManager.h>
-#include <GpsData.h>
-#include <SharedMem.h>
-#include <SpinBox.h>
-#include <DoubleSpinBox.h>
-#include <GroupBox.h>
-#include <Euler.h>
-#include <Matrix.h>
-#include <sstream>
-#include "geodesie.h"
-
-using std::string;
-using std::ostringstream;
-using namespace flair::core;
-using namespace flair::gui;
-using namespace Geodesie;
-
-namespace flair {
-namespace sensor {
-
-SimuGps::SimuGps(string name,
-                 NmeaGps::NMEAFlags_t NMEAFlags, uint32_t modelId,uint32_t deviceId,uint8_t priority)
-    : NmeaGps(name, NMEAFlags),Thread(getFrameworkManager(), name, priority) {
-
-  dataRate = new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 200);
-  latitudeRef = new DoubleSpinBox(GetGroupBox()->NewRow(), "latitude ref", " deg", -90, 90, 1, 6,49.402313);
-  longitudeRef = new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "longitude ref", " deg", -180, 180, 1, 6,2.795463);
-  altitudeRef= new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "altitude ref", " m", 0, 6000, 100, 1,0);
-  fixQuality = new SpinBox(GetGroupBox()->NewRow(), "fix quality", 1, 8, 1, 1);
-  numberOfSatellites = new SpinBox(GetGroupBox()->NewRow(), "number of satellites", 1, 15, 1, 5);
-  magneticDeclination= new DoubleSpinBox(GetGroupBox()->NewRow(), "magnetic declination", " deg", -180, 180, .1, 2,0);
-  
-  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
-                        sizeof(gps_states_t));
-                        
-  SetIsReady(true);
-}
-
-
-SimuGps::~SimuGps() {
-  SafeStop();
-  Join();
-}
-
-string SimuGps::ShMemName(uint32_t modelId,uint32_t deviceId) {
-  ostringstream dev_name;
-  dev_name << "simu" <<  modelId << "_gps_" << deviceId;
-  return dev_name.str().c_str();
-}
-
-void SimuGps::Run(void) {
-  gps_states_t state;
-  char buf[512];
-  nmeaGPGGA gga;
-  nmeaGPVTG vtg;
-  nmeaPOS pos;
-  nmeaINFO info;
-
-  vtg.dir_t='T';
-  vtg.dec_m='M';
-  vtg.spk_k='K';
-  vtg.spn_n='N';
-  gga.elv_units='M';
-  gga.diff_units='M';
-
-  SetPeriodUS((uint32_t)(1000000. / dataRate->Value()));
-
-  WarnUponSwitches(true);
-
-
-  while (!ToBeStopped()) {
-    WaitPeriod();
-
-    if (dataRate->ValueChanged() == true) {
-      SetPeriodUS((uint32_t)(1000000. / dataRate->Value()));
-    }
-
-    shmem->Read((char *)&state, sizeof(gps_states_t));
-
-    double x, y, z;
-    ENU_2_ECEF(state.e, state.n, state.u, x,y,z, Euler::ToRadian(longitudeRef->Value()), Euler::ToRadian(latitudeRef->Value()), altitudeRef->Value());
-    ECEF_2_Geographique( x, y, z,pos.lon, pos.lat, gga.elv);
-    nmea_pos2info(&pos,&info);
-
-    if(pos.lat>0) {
-      gga.ns='N';
-      gga.lat=info.lat;
-    } else {
-      gga.ns='S';
-      gga.lat=-info.lat;
-    }
-    if(pos.lon>0) {
-      gga.ew='E';
-      gga.lon=info.lon;
-    } else {
-      gga.ew='W';
-      gga.lon=-info.lon;
-    }
-
-    gga.sig=fixQuality->Value();
-    gga.satinuse=numberOfSatellites->Value();
-
-    int size=nmea_gen_GPGGA(buf,sizeof(buf),&gga);
-    parseFrame(buf,size);
-    
-    vtg.dir=90-Euler::ToDegree(atan2f(state.vn,state.ve));
-    vtg.spk=sqrtf(state.ve*state.ve+state.vn*state.vn)*3600./1000.;
-    size=nmea_gen_GPVTG(buf,sizeof(buf),&vtg);
-    parseFrame(buf,size);
-  }
-
-  WarnUponSwitches(false);
-}
-
-} // end namespace sensor
-} // end namespace flair
-
-#endif
Index: trunk/lib/FlairSensorActuator/src/SimuGps.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuGps.h	(revision 275)
+++ 	(revision )
@@ -1,92 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-/*!
- * \file SimuGps.h
- * \brief Class for a simulation GPS
- * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
- * \date 2013/08/23
- * \version 4.0
- */
-
-#ifndef SIMUGPS_H
-#define SIMUGPS_H
-
-#include <Thread.h>
-#include <NmeaGps.h>
-
-namespace flair {
-  namespace core {
-    class SharedMem;
-  }
-  namespace gui {
-    class SpinBox;
-    class DoubleSpinBox;
-  }
-}
-
-namespace flair {
-namespace sensor {
-/*! \class SimuGps
-*
-* \brief Class for a simulation GPS
-*/
-class SimuGps : public core::Thread, public NmeaGps {
-public:
-  /*!
-  * \brief Constructor
-  *
-  * Construct a simulation GPS
-  * It will be child of the FrameworkManager.
-	* 
-  * \param name name
-  * \param NMEAFlags NMEA sentances to enable
-  * \param modelId Model id
-  * \param deviceId Gps id of the Model
-  * \param priority priority of the Thread
-  */
-  SimuGps(std::string name,
-          NmeaGps::NMEAFlags_t NMEAFlags, uint32_t modelId,uint32_t deviceId,uint8_t priority);
-
-  /*!
-  * \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){};
-
-  /*!
-  * \brief Run function
-  *
-  * Reimplemented from Thread.
-  *
-  */
-  void Run(void);
-
-  typedef struct {
-    float e;
-    float n;
-    float u;
-    float ve;
-    float vn;
-  } gps_states_t;
-  
-  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
-
-  core::SharedMem *shmem;
-  gui::SpinBox *dataRate,*fixQuality,*numberOfSatellites;
-  gui::DoubleSpinBox *latitudeRef,*longitudeRef,*altitudeRef,*magneticDeclination;
-};
-} // end namespace sensor
-} // end namespace flair
-#endif // SIMUGPS_H
Index: trunk/lib/FlairSensorActuator/src/SimuImu.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuImu.cpp	(revision 275)
+++ 	(revision )
@@ -1,97 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-//  created:    2014/02/07
-//  filename:   SimuImu.cpp
-//
-//  author:     Guillaume Sanahuja
-//              Copyright Heudiasyc UMR UTC/CNRS 7253
-//
-//  version:    $Id: $
-//
-//  purpose:    Class for a simulation imu
-//
-//
-/*********************************************************************/
-#ifdef CORE2_64
-
-#include "SimuImu.h"
-#include <FrameworkManager.h>
-#include <ImuData.h>
-#include <SpinBox.h>
-#include <GroupBox.h>
-#include <Matrix.h>
-#include <SharedMem.h>
-#include <AhrsData.h>
-#include <sstream>
-
-using std::string;
-using std::ostringstream;
-using namespace flair::core;
-using namespace flair::gui;
-
-namespace flair {
-namespace sensor {
-
-SimuImu::SimuImu(string name, uint32_t modelId,uint32_t deviceId,
-                 uint8_t priority)
-    : Imu(name,false), Thread(getFrameworkManager(), name, priority) {
-  dataRate =
-      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 200);
-  ahrsData = new AhrsData((Imu *)this);
-  
-  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
-                        sizeof(imu_states_t));
-  SetIsReady(true);
-}
-
-SimuImu::~SimuImu() {
-  SafeStop();
-  Join();
-}
-
-string SimuImu::ShMemName(uint32_t modelId,uint32_t deviceId) {
-  ostringstream dev_name;
-  dev_name << "simu" <<  modelId << "_imu_" << deviceId;
-  return dev_name.str().c_str();
-}
-
-void SimuImu::Run(void) {
-  imu_states_t state;
-  ImuData *imuData;
-  GetDatas(&imuData);
-
-  SetPeriodUS((uint32_t)(1000000. / dataRate->Value()));
-
-  while (!ToBeStopped()) {
-    WaitPeriod();
-
-    if (dataRate->ValueChanged() == true) {
-      SetPeriodUS((uint32_t)(1000000. / dataRate->Value()));
-    }
-    shmem->Read((char *)&state, sizeof(imu_states_t));
-    Quaternion quaternion(state.q0, state.q1, state.q2, state.q3);
-    Vector3Df angRate(state.wx, state.wy, state.wz);
-    Vector3Df rawAcc(state.ax, state.ay, state.az);
-    Vector3Df rawMag(state.mx, state.my, state.mz);
-    Vector3Df rawGyr(state.wx, state.wy, state.wz);
-    //we do not need rotation in simulation
-    /*
-    ApplyRotation(angRate);
-    ApplyRotation(quaternion);
-    ApplyRotation(rawAcc);
-    ApplyRotation(rawMag);
-    ApplyRotation(rawGyr);*/
-    ahrsData->SetQuaternionAndAngularRates(quaternion,angRate);
-    imuData->SetRawAccMagAndGyr(rawAcc,rawMag,rawGyr);
-    imuData->SetDataTime(GetTime());
-    ahrsData->SetDataTime(GetTime());
-    ProcessUpdate(ahrsData);
-  }
-}
-
-} // end namespace sensor
-} // end namespace flair
-
-#endif
Index: trunk/lib/FlairSensorActuator/src/SimuImu.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuImu.h	(revision 275)
+++ 	(revision )
@@ -1,99 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-/*!
- * \file SimuImu.h
- * \brief Class for a simulation Imu
- * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
- * \date 2014/02/07
- * \version 4.0
- */
-
-#ifndef SIMUIMU_H
-#define SIMUIMU_H
-
-#include <Imu.h>
-#include <Thread.h>
-
-namespace flair {
-  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.
-	* It will be child of the FrameworkManager.
-  *
-  * \param name name
-  * \param modelId Model id
-  * \param deviceId Imu id of the Model
-  * \param priority priority of the Thread
-  */
-  SimuImu(std::string name,
-          uint32_t modelId,uint32_t deviceId, uint8_t priority);
-
-  /*!
-  * \brief Destructor
-  *
-  */
-  ~SimuImu();
-
-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){};
-
-  typedef struct {
-    float q0;
-    float q1;
-    float q2;
-    float q3;
-    float wx;
-    float wy;
-    float wz;
-    float ax;
-    float ay;
-    float az;
-    float mx;
-    float my;
-    float mz;
-  } imu_states_t;
-  
-  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
-
-  gui::SpinBox *dataRate;
-  core::SharedMem *shmem;
-  core::AhrsData *ahrsData;
-};
-} // end namespace sensor
-} // end namespace flair
-#endif // SIMUIMU_H
Index: trunk/lib/FlairSensorActuator/src/SimuLaser.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuLaser.cpp	(revision 275)
+++ 	(revision )
@@ -1,81 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-//  created:    2014/02/07
-//  filename:   SimuUs.cpp
-//
-//  author:     Guillaume Sanahuja
-//              Copyright Heudiasyc UMR UTC/CNRS 7253
-//
-//  version:    $Id: $
-//
-//  purpose:    Class for a simulation us
-//
-//
-/*********************************************************************/
-#ifdef CORE2_64
-
-#include "SimuLaser.h"
-#include <FrameworkManager.h>
-#include <SpinBox.h>
-#include <GroupBox.h>
-#include <Matrix.h>
-#include <SharedMem.h>
-#include <sstream>
-
-using std::string;
-using std::ostringstream;
-using namespace flair::core;
-using namespace flair::gui;
-
-namespace flair {
-namespace sensor {
-
-SimuLaser::SimuLaser(string name,
-                     uint32_t modelId,uint32_t deviceId, uint8_t priority)
-    : Thread(getFrameworkManager(), name, priority), LaserRangeFinder(name) {
-  data_rate =
-      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 50);
-
-  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
-                        360 * sizeof(float));
-  SetIsReady(true);
-}
-
-SimuLaser::~SimuLaser() {
-  SafeStop();
-  Join();
-}
-
-string SimuLaser::ShMemName(uint32_t modelId,uint32_t deviceId) {
-  ostringstream dev_name;
-  dev_name << "simu" <<  modelId << "_laser_" << deviceId;
-  return dev_name.str().c_str();
-}
-
-void SimuLaser::Run(void) {
-  float z[360];
-
-  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);
-  }
-}
-
-} // end namespace sensor
-} // end namespace flair
-
-#endif
Index: trunk/lib/FlairSensorActuator/src/SimuLaser.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuLaser.h	(revision 275)
+++ 	(revision )
@@ -1,85 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-/*!
- * \file SimuUs.h
- * \brief Class for a simulation UsRangeFinder
- * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
- * \date 2014/02/07
- * \version 4.0
- */
-
-#ifndef SIMULASER_H
-#define SIMULASER_H
-
-#include <LaserRangeFinder.h>
-#include <Thread.h>
-
-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.
-  *
-  * \param name name
-  * \param modelId Model id
-  * \param deviceId LaserRangeFinder id of the Model
-  * \param priority priority of the Thread
-  */
-  SimuLaser(std::string name,
-            uint32_t modelId,uint32_t deviceId, uint8_t priority);
-
-  /*!
-  * \brief Destructor
-  *
-  */
-  ~SimuLaser();
-
-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){};
-
-  /*!
-  * \brief Run function
-  *
-  * Reimplemented from Thread.
-  *
-  */
-  void Run(void);
-  
-  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
-  gui::SpinBox *data_rate;
-};
-} // end namespace sensor
-} // end namespace flair
-#endif // SIMULASER_H
Index: trunk/lib/FlairSensorActuator/src/SimuPressureSensor.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuPressureSensor.cpp	(revision 275)
+++ 	(revision )
@@ -1,80 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-//  created:    2018/05/24
-//  filename:   SimuPressureSensor.cpp
-//
-//  author:     Guillaume Sanahuja
-//              Copyright Heudiasyc UMR UTC/CNRS 7253
-//
-//  version:    $Id: $
-//
-//  purpose:    Class for a simulation pressure sensor
-//
-//
-/*********************************************************************/
-#ifdef CORE2_64
-
-#include "SimuPressureSensor.h"
-#include <FrameworkManager.h>
-#include <SpinBox.h>
-#include <GroupBox.h>
-#include <Matrix.h>
-#include <SharedMem.h>
-#include <sstream>
-
-using std::string;
-using std::ostringstream;
-using namespace flair::core;
-using namespace flair::gui;
-
-namespace flair {
-namespace sensor {
-
-SimuPressureSensor::SimuPressureSensor(string name, uint32_t modelId,uint32_t deviceId,
-               uint8_t priority)
-    : Thread(getFrameworkManager(), name, priority), PressureSensor( name) {
-  data_rate =
-      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 50);
-
-  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId), sizeof(float));
-
-  SetIsReady(true);
-}
-
-SimuPressureSensor::~SimuPressureSensor() {
-  SafeStop();
-  Join();
-}
-
-string SimuPressureSensor::ShMemName(uint32_t modelId,uint32_t deviceId) {
-  ostringstream dev_name;
-  dev_name << "simu" <<  modelId << "_pressure_" << deviceId;
-  return dev_name.str().c_str();
-}
-
-void SimuPressureSensor::Run(void) {
-  float p;
-
-  SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
-
-  while (!ToBeStopped()) {
-    WaitPeriod();
-
-    shmem->Read((char *)&p, sizeof(float));
-
-    if (data_rate->ValueChanged() == true) {
-      SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
-    }
-
-    output->SetValue(0, 0, p);
-    output->SetDataTime(GetTime());
-    ProcessUpdate(output);
-  }
-}
-
-} // end namespace sensor
-} // end namespace flair
-
-#endif
Index: trunk/lib/FlairSensorActuator/src/SimuPressureSensor.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuPressureSensor.h	(revision 275)
+++ 	(revision )
@@ -1,86 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-/*!
- * \file SimuPressureSensor.h
- * \brief Class for a simulation PressureSensor
- * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
- * \date 2018/05/24
- * \version 4.0
- */
-
-#ifndef SIMUPRESSURESENSOR_H
-#define SIMUPRESSURESENSOR_H
-
-#include <PressureSensor.h>
-#include <Thread.h>
-
-namespace flair {
-namespace core {
-class SharedMem;
-}
-namespace gui {
-class SpinBox;
-}
-}
-
-namespace flair {
-namespace sensor {
-/*! \class SimuPressureSensor
-*
-* \brief Class for a simulation PressureSensor
-*/
-class SimuPressureSensor : public core::Thread, public PressureSensor {
-public:
-  /*!
-  * \brief Constructor
-  *
-  * Construct a SimuPressureSensor.
-	* It will be child of the FrameworkManager.
-  *
-  * \param name name
-  * \param modelId Model id
-  * \param deviceId PressureSensor id of the Model
-  * \param priority priority of the Thread
-  */
-  SimuPressureSensor(std::string name,
-         uint32_t modelId,uint32_t deviceId, uint8_t priority);
-
-  /*!
-  * \brief Destructor
-  *
-  */
-  ~SimuPressureSensor();
-
-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){};
-
-  /*!
-  * \brief Run function
-  *
-  * Reimplemented from Thread.
-  *
-  */
-  void Run(void);
-  
-  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
-  gui::SpinBox *data_rate;
-};
-} // end namespace sensor
-} // end namespace flair
-#endif // SIMUPRESSURESENSOR_H
Index: trunk/lib/FlairSensorActuator/src/SimuUs.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuUs.cpp	(revision 275)
+++ 	(revision )
@@ -1,80 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-//  created:    2014/02/07
-//  filename:   SimuUs.cpp
-//
-//  author:     Guillaume Sanahuja
-//              Copyright Heudiasyc UMR UTC/CNRS 7253
-//
-//  version:    $Id: $
-//
-//  purpose:    Class for a simulation us
-//
-//
-/*********************************************************************/
-#ifdef CORE2_64
-
-#include "SimuUs.h"
-#include <FrameworkManager.h>
-#include <SpinBox.h>
-#include <GroupBox.h>
-#include <Matrix.h>
-#include <SharedMem.h>
-#include <sstream>
-
-using std::string;
-using std::ostringstream;
-using namespace flair::core;
-using namespace flair::gui;
-
-namespace flair {
-namespace sensor {
-
-SimuUs::SimuUs(string name, uint32_t modelId,uint32_t deviceId,
-               uint8_t priority)
-    : Thread(getFrameworkManager(), name, priority), UsRangeFinder( name) {
-  data_rate =
-      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 50);
-
-  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId), sizeof(float));
-
-  SetIsReady(true);
-}
-
-SimuUs::~SimuUs() {
-  SafeStop();
-  Join();
-}
-
-string SimuUs::ShMemName(uint32_t modelId,uint32_t deviceId) {
-  ostringstream dev_name;
-  dev_name << "simu" <<  modelId << "_us_" << deviceId;
-  return dev_name.str().c_str();
-}
-
-void SimuUs::Run(void) {
-  float z;
-  
-  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);
-  }
-}
-
-} // end namespace sensor
-} // end namespace flair
-
-#endif
Index: trunk/lib/FlairSensorActuator/src/SimuUs.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuUs.h	(revision 275)
+++ 	(revision )
@@ -1,86 +1,0 @@
-// %flair:license{
-// This file is part of the Flair framework distributed under the
-// CECILL-C License, Version 1.0.
-// %flair:license}
-/*!
- * \file SimuUs.h
- * \brief Class for a simulation UsRangeFinder
- * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
- * \date 2014/02/07
- * \version 4.0
- */
-
-#ifndef SIMUUS_H
-#define SIMUUS_H
-
-#include <UsRangeFinder.h>
-#include <Thread.h>
-
-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.
-	* It will be child of the FrameworkManager.
-  *
-  * \param name name
-  * \param modelId Model id
-  * \param deviceId UsRangeFinder id of the Model
-  * \param priority priority of the Thread
-  */
-  SimuUs(std::string name,
-         uint32_t modelId,uint32_t deviceId, uint8_t priority);
-
-  /*!
-  * \brief Destructor
-  *
-  */
-  ~SimuUs();
-
-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){};
-
-  /*!
-  * \brief Run function
-  *
-  * Reimplemented from Thread.
-  *
-  */
-  void Run(void);
-  
-  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
-  gui::SpinBox *data_rate;
-};
-} // end namespace sensor
-} // end namespace flair
-#endif // SIMUUS_H
Index: trunk/lib/FlairSensorActuator/src/SimulatedBldc.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimulatedBldc.cpp	(revision 286)
+++ trunk/lib/FlairSensorActuator/src/SimulatedBldc.cpp	(revision 286)
@@ -0,0 +1,83 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/07
+//  filename:   SimulatedBldc.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation bldc
+//
+//
+/*********************************************************************/
+#ifdef CORE2_64
+
+#include "SimulatedBldc.h"
+#include <FrameworkManager.h>
+#include <GridLayout.h>
+#include <DoubleSpinBox.h>
+#include <GroupBox.h>
+#include <SharedMem.h>
+#include <Matrix.h>
+#include <sstream>
+#include <string.h>
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace actuator {
+
+SimulatedBldc::SimulatedBldc(const IODevice *parent, Layout *layout, string name,
+                   uint8_t motors_count, uint32_t modelId,uint32_t deviceId)
+    : Bldc(parent, layout, name, motors_count) {
+  shmem =
+      new SharedMem(this, ShMemName(modelId, deviceId), motors_count * sizeof(float)+sizeof(Time));
+
+  GroupBox *groupbox = new GroupBox(layout->NewRow(), "simubldc");
+  k = new DoubleSpinBox(groupbox->NewRow(), "k driver:", 0, 10000, 1);
+  
+  buf=(char*)malloc(motors_count * sizeof(float)+sizeof(Time));
+  if(buf==NULL) {
+    Err("error creating buffer\n");
+    return;
+  }
+  SetIsReady(true);
+}
+
+SimulatedBldc::~SimulatedBldc() {
+  if(buf!=NULL) free(buf);
+}
+
+string SimulatedBldc::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_bldc_" << deviceId;
+  return dev_name.str().c_str();
+}
+
+void SimulatedBldc::SetMotors(float *value) {
+  float *values=(float*)buf;
+  for (int i = 0; i < MotorsCount(); i++) values[i] = k->Value() * value[i];
+  Time time=GetTime();
+  memcpy(buf+MotorsCount() * sizeof(float),&time,sizeof(Time));
+
+  shmem->Write(buf, MotorsCount() * sizeof(float)+sizeof(Time));
+
+  // 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();
+}
+
+} // end namespace sensor
+} // end namespace flair
+
+#endif
Index: trunk/lib/FlairSensorActuator/src/SimulatedBldc.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimulatedBldc.h	(revision 286)
+++ trunk/lib/FlairSensorActuator/src/SimulatedBldc.h	(revision 286)
@@ -0,0 +1,97 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimulatedBldc.h
+ * \brief Class for a simulation bldc
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/07
+ * \version 4.0
+ */
+
+#ifndef SIMULATEDBLDC_H
+#define SIMULATEDBLDC_H
+
+#include <Bldc.h>
+
+namespace flair {
+namespace core {
+class SharedMem;
+class IODevice;
+class Matrix;
+}
+namespace gui {
+class DoubleSpinBox;
+class Layout;
+}
+}
+
+namespace flair {
+namespace actuator {
+/*! \class SimulatedBldc
+*
+* \brief Class for a simulation bldc
+*
+*/
+class SimulatedBldc : public Bldc {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimulatedBldc
+  *
+  * \param parent parent
+  * \param layout layout
+  * \param name name
+  * \param motors_count number of motors
+  * \param modelId Model id
+  * \param deviceId Bldc id of the Model
+  */
+  SimulatedBldc(const core::IODevice *parent, gui::Layout *layout, std::string name,
+           uint8_t motors_count, uint32_t modelId,uint32_t deviceId);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimulatedBldc();
+
+  /*!
+  * \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; };
+
+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);
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
+  core::SharedMem *shmem;
+  gui::DoubleSpinBox *k;
+  char *buf;
+
+};
+} // end namespace actuator
+} // end namespace flair
+#endif // SIMULATEDBLDC_H
Index: trunk/lib/FlairSensorActuator/src/SimulatedCamera.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimulatedCamera.cpp	(revision 286)
+++ trunk/lib/FlairSensorActuator/src/SimulatedCamera.cpp	(revision 286)
@@ -0,0 +1,96 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/03/06
+//  filename:   SimulatedCamera.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation camera
+//
+//
+/*********************************************************************/
+#ifdef CORE2_64
+
+#include "SimulatedCamera.h"
+#include <FrameworkManager.h>
+#include <GroupBox.h>
+#include <SharedMem.h>
+#include <sstream>
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+SimulatedCamera::SimulatedCamera(string name,
+                       uint16_t width, uint16_t height, uint8_t channels,
+                       uint32_t modelId,uint32_t deviceId, uint8_t priority)
+    : Thread(getFrameworkManager(), name, priority),
+      Camera(name, width, height, cvimage::Type::Format::BGR) {
+
+  buf_size = width * height * channels+sizeof(Time);
+
+  shmemReadBuf=(char*)malloc(buf_size);
+  output->img->imageData = shmemReadBuf;
+
+  shmem = new SharedMem((Thread *)this,ShMemName(modelId, deviceId), buf_size, SharedMem::Type::producerConsumer);
+  
+  SetIsReady(true);
+}
+
+
+SimulatedCamera::~SimulatedCamera() {
+  SafeStop();
+  Join();
+  if(shmemReadBuf!=NULL) delete shmemReadBuf;
+}
+
+string SimulatedCamera::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_cam_" << deviceId;
+  return dev_name.str().c_str();
+}
+
+void SimulatedCamera::Run(void) {
+  Time time;
+
+//  SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
+  shmem->ReaderReady();
+
+  while (!ToBeStopped()) {
+//    WaitPeriod();
+
+//    if (data_rate->ValueChanged() == true) {
+//      SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
+//    }
+
+    output->GetMutex();
+    //blocking read
+    if (shmem->Read(shmemReadBuf, buf_size, 1000000000)) { // remplacer copie par
+      // échange de pointeur sur
+      // double buffering
+
+      output->ReleaseMutex();
+      memcpy(&time, shmemReadBuf + buf_size - sizeof(Time), sizeof(Time));
+      output->SetDataTime(time);
+
+      ProcessUpdate(output);
+    } else {
+      output->ReleaseMutex();
+      //Thread::Warn("Read Timeout\n");
+    }
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
+
+#endif
Index: trunk/lib/FlairSensorActuator/src/SimulatedCamera.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimulatedCamera.h	(revision 286)
+++ trunk/lib/FlairSensorActuator/src/SimulatedCamera.h	(revision 286)
@@ -0,0 +1,91 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimulatedCamera.h
+ * \brief Class for a simulation camera
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/03/06
+ * \version 4.0
+ */
+
+#ifndef SIMULATEDCAMERA_H
+#define SIMULATEDCAMERA_H
+
+#include <Camera.h>
+#include <Thread.h>
+#include <cxcore.h>
+
+namespace flair {
+  namespace core {
+    class SharedMem;
+  }
+}
+
+namespace flair {
+namespace sensor {
+/*! \class SimulatedCamera
+*
+* \brief Class for a simulation camera
+*/
+class SimulatedCamera : public core::Thread, public Camera {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimulatedCamera.
+	* It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param width width
+  * \param height height
+  * \param channels number of channels
+  * \param modelId Model id
+  * \param deviceId Camera id of the Model
+  * \param priority priority of the Thread
+  */
+  SimulatedCamera(std::string name,
+             uint16_t width, uint16_t height, uint8_t channels, uint32_t modelId,uint32_t deviceId,
+             uint8_t priority);
+
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimulatedCamera();
+
+protected:
+  /*!
+  * \brief SharedMem to access datas
+  *
+  */
+  core::SharedMem *shmem;
+
+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){};
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
+
+  size_t buf_size;
+  char* shmemReadBuf;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SIMULATEDCAMERA_H
Index: trunk/lib/FlairSensorActuator/src/SimulatedGps.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimulatedGps.cpp	(revision 286)
+++ trunk/lib/FlairSensorActuator/src/SimulatedGps.cpp	(revision 286)
@@ -0,0 +1,137 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/05/26
+//  filename:   SimulatedGps.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation GPS
+//
+//
+/*********************************************************************/
+#ifdef CORE2_64
+
+#include "SimulatedGps.h"
+#include <FrameworkManager.h>
+#include <GpsData.h>
+#include <SharedMem.h>
+#include <SpinBox.h>
+#include <DoubleSpinBox.h>
+#include <GroupBox.h>
+#include <Euler.h>
+#include <Matrix.h>
+#include <sstream>
+#include "geodesie.h"
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+using namespace Geodesie;
+
+namespace flair {
+namespace sensor {
+
+SimulatedGps::SimulatedGps(string name,
+                 NmeaGps::NMEAFlags_t NMEAFlags, uint32_t modelId,uint32_t deviceId,uint8_t priority)
+    : NmeaGps(name, NMEAFlags),Thread(getFrameworkManager(), name, priority) {
+
+  dataRate = new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 200);
+  latitudeRef = new DoubleSpinBox(GetGroupBox()->NewRow(), "latitude ref", " deg", -90, 90, 1, 6,49.402313);
+  longitudeRef = new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "longitude ref", " deg", -180, 180, 1, 6,2.795463);
+  altitudeRef= new DoubleSpinBox(GetGroupBox()->LastRowLastCol(), "altitude ref", " m", 0, 6000, 100, 1,0);
+  fixQuality = new SpinBox(GetGroupBox()->NewRow(), "fix quality", 1, 8, 1, 1);
+  numberOfSatellites = new SpinBox(GetGroupBox()->NewRow(), "number of satellites", 1, 15, 1, 5);
+  magneticDeclination= new DoubleSpinBox(GetGroupBox()->NewRow(), "magnetic declination", " deg", -180, 180, .1, 2,0);
+  
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
+                        sizeof(gps_states_t));
+                        
+  SetIsReady(true);
+}
+
+
+SimulatedGps::~SimulatedGps() {
+  SafeStop();
+  Join();
+}
+
+string SimulatedGps::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_gps_" << deviceId;
+  return dev_name.str().c_str();
+}
+
+void SimulatedGps::Run(void) {
+  gps_states_t state;
+  char buf[512];
+  nmeaGPGGA gga;
+  nmeaGPVTG vtg;
+  nmeaPOS pos;
+  nmeaINFO info;
+
+  vtg.dir_t='T';
+  vtg.dec_m='M';
+  vtg.spk_k='K';
+  vtg.spn_n='N';
+  gga.elv_units='M';
+  gga.diff_units='M';
+
+  SetPeriodUS((uint32_t)(1000000. / dataRate->Value()));
+
+  WarnUponSwitches(true);
+
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    if (dataRate->ValueChanged() == true) {
+      SetPeriodUS((uint32_t)(1000000. / dataRate->Value()));
+    }
+
+    shmem->Read((char *)&state, sizeof(gps_states_t));
+
+    double x, y, z;
+    ENU_2_ECEF(state.e, state.n, state.u, x,y,z, Euler::ToRadian(longitudeRef->Value()), Euler::ToRadian(latitudeRef->Value()), altitudeRef->Value());
+    ECEF_2_Geographique( x, y, z,pos.lon, pos.lat, gga.elv);
+    nmea_pos2info(&pos,&info);
+
+    if(pos.lat>0) {
+      gga.ns='N';
+      gga.lat=info.lat;
+    } else {
+      gga.ns='S';
+      gga.lat=-info.lat;
+    }
+    if(pos.lon>0) {
+      gga.ew='E';
+      gga.lon=info.lon;
+    } else {
+      gga.ew='W';
+      gga.lon=-info.lon;
+    }
+
+    gga.sig=fixQuality->Value();
+    gga.satinuse=numberOfSatellites->Value();
+
+    int size=nmea_gen_GPGGA(buf,sizeof(buf),&gga);
+    parseFrame(buf,size);
+    
+    vtg.dir=90-Euler::ToDegree(atan2f(state.vn,state.ve));
+    vtg.spk=sqrtf(state.ve*state.ve+state.vn*state.vn)*3600./1000.;
+    size=nmea_gen_GPVTG(buf,sizeof(buf),&vtg);
+    parseFrame(buf,size);
+  }
+
+  WarnUponSwitches(false);
+}
+
+} // end namespace sensor
+} // end namespace flair
+
+#endif
Index: trunk/lib/FlairSensorActuator/src/SimulatedGps.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimulatedGps.h	(revision 286)
+++ trunk/lib/FlairSensorActuator/src/SimulatedGps.h	(revision 286)
@@ -0,0 +1,92 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimulatedGps.h
+ * \brief Class for a simulation GPS
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/08/23
+ * \version 4.0
+ */
+
+#ifndef SimulatedGPS_H
+#define SimulatedGPS_H
+
+#include <Thread.h>
+#include <NmeaGps.h>
+
+namespace flair {
+  namespace core {
+    class SharedMem;
+  }
+  namespace gui {
+    class SpinBox;
+    class DoubleSpinBox;
+  }
+}
+
+namespace flair {
+namespace sensor {
+/*! \class SimulatedGps
+*
+* \brief Class for a simulation GPS
+*/
+class SimulatedGps : public core::Thread, public NmeaGps {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a simulation GPS
+  * It will be child of the FrameworkManager.
+	* 
+  * \param name name
+  * \param NMEAFlags NMEA sentances to enable
+  * \param modelId Model id
+  * \param deviceId Gps id of the Model
+  * \param priority priority of the Thread
+  */
+  SimulatedGps(std::string name,
+          NmeaGps::NMEAFlags_t NMEAFlags, uint32_t modelId,uint32_t deviceId,uint8_t priority);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimulatedGps();
+
+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);
+
+  typedef struct {
+    float e;
+    float n;
+    float u;
+    float ve;
+    float vn;
+  } gps_states_t;
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
+
+  core::SharedMem *shmem;
+  gui::SpinBox *dataRate,*fixQuality,*numberOfSatellites;
+  gui::DoubleSpinBox *latitudeRef,*longitudeRef,*altitudeRef,*magneticDeclination;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SIMULATEDGPS_H
Index: trunk/lib/FlairSensorActuator/src/SimulatedImu.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimulatedImu.cpp	(revision 286)
+++ trunk/lib/FlairSensorActuator/src/SimulatedImu.cpp	(revision 286)
@@ -0,0 +1,97 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/07
+//  filename:   SimulatedImu.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation imu
+//
+//
+/*********************************************************************/
+#ifdef CORE2_64
+
+#include "SimulatedImu.h"
+#include <FrameworkManager.h>
+#include <ImuData.h>
+#include <SpinBox.h>
+#include <GroupBox.h>
+#include <Matrix.h>
+#include <SharedMem.h>
+#include <AhrsData.h>
+#include <sstream>
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+SimulatedImu::SimulatedImu(string name, uint32_t modelId,uint32_t deviceId,
+                 uint8_t priority)
+    : Imu(name,false), Thread(getFrameworkManager(), name, priority) {
+  dataRate =
+      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 200);
+  ahrsData = new AhrsData((Imu *)this);
+  
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
+                        sizeof(imu_states_t));
+  SetIsReady(true);
+}
+
+SimulatedImu::~SimulatedImu() {
+  SafeStop();
+  Join();
+}
+
+string SimulatedImu::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_imu_" << deviceId;
+  return dev_name.str().c_str();
+}
+
+void SimulatedImu::Run(void) {
+  imu_states_t state;
+  ImuData *imuData;
+  GetDatas(&imuData);
+
+  SetPeriodUS((uint32_t)(1000000. / dataRate->Value()));
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    if (dataRate->ValueChanged() == true) {
+      SetPeriodUS((uint32_t)(1000000. / dataRate->Value()));
+    }
+    shmem->Read((char *)&state, sizeof(imu_states_t));
+    Quaternion quaternion(state.q0, state.q1, state.q2, state.q3);
+    Vector3Df angRate(state.wx, state.wy, state.wz);
+    Vector3Df rawAcc(state.ax, state.ay, state.az);
+    Vector3Df rawMag(state.mx, state.my, state.mz);
+    Vector3Df rawGyr(state.wx, state.wy, state.wz);
+    //we do not need rotation in simulation
+    /*
+    ApplyRotation(angRate);
+    ApplyRotation(quaternion);
+    ApplyRotation(rawAcc);
+    ApplyRotation(rawMag);
+    ApplyRotation(rawGyr);*/
+    ahrsData->SetQuaternionAndAngularRates(quaternion,angRate);
+    imuData->SetRawAccMagAndGyr(rawAcc,rawMag,rawGyr);
+    imuData->SetDataTime(GetTime());
+    ahrsData->SetDataTime(GetTime());
+    ProcessUpdate(ahrsData);
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
+
+#endif
Index: trunk/lib/FlairSensorActuator/src/SimulatedImu.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimulatedImu.h	(revision 286)
+++ trunk/lib/FlairSensorActuator/src/SimulatedImu.h	(revision 286)
@@ -0,0 +1,99 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimulatedImu.h
+ * \brief Class for a simulation Imu
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/07
+ * \version 4.0
+ */
+
+#ifndef SIMULATEDIMU_H
+#define SIMULATEDIMU_H
+
+#include <Imu.h>
+#include <Thread.h>
+
+namespace flair {
+  namespace core {
+    class SharedMem;
+    class AhrsData;
+  }
+  namespace gui {
+    class SpinBox;
+  }
+}
+
+namespace flair {
+namespace sensor {
+/*! \class SimulatedImu
+*
+* \brief Class for a simulation Imu
+*/
+class SimulatedImu : public Imu, public core::Thread {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimulatedImu.
+	* It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param modelId Model id
+  * \param deviceId Imu id of the Model
+  * \param priority priority of the Thread
+  */
+  SimulatedImu(std::string name,
+          uint32_t modelId,uint32_t deviceId, uint8_t priority);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimulatedImu();
+
+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){};
+
+  typedef struct {
+    float q0;
+    float q1;
+    float q2;
+    float q3;
+    float wx;
+    float wy;
+    float wz;
+    float ax;
+    float ay;
+    float az;
+    float mx;
+    float my;
+    float mz;
+  } imu_states_t;
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
+
+  gui::SpinBox *dataRate;
+  core::SharedMem *shmem;
+  core::AhrsData *ahrsData;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SIMULATEDIMU_H
Index: trunk/lib/FlairSensorActuator/src/SimulatedLaser.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimulatedLaser.cpp	(revision 286)
+++ trunk/lib/FlairSensorActuator/src/SimulatedLaser.cpp	(revision 286)
@@ -0,0 +1,81 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/07
+//  filename:   SimulatedUs.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation us
+//
+//
+/*********************************************************************/
+#ifdef CORE2_64
+
+#include "SimulatedLaser.h"
+#include <FrameworkManager.h>
+#include <SpinBox.h>
+#include <GroupBox.h>
+#include <Matrix.h>
+#include <SharedMem.h>
+#include <sstream>
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+SimulatedLaser::SimulatedLaser(string name,
+                     uint32_t modelId,uint32_t deviceId, uint8_t priority)
+    : Thread(getFrameworkManager(), name, priority), LaserRangeFinder(name) {
+  data_rate =
+      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 50);
+
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId),
+                        360 * sizeof(float));
+  SetIsReady(true);
+}
+
+SimulatedLaser::~SimulatedLaser() {
+  SafeStop();
+  Join();
+}
+
+string SimulatedLaser::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_laser_" << deviceId;
+  return dev_name.str().c_str();
+}
+
+void SimulatedLaser::Run(void) {
+  float z[360];
+
+  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);
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
+
+#endif
Index: trunk/lib/FlairSensorActuator/src/SimulatedLaser.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimulatedLaser.h	(revision 286)
+++ trunk/lib/FlairSensorActuator/src/SimulatedLaser.h	(revision 286)
@@ -0,0 +1,85 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimulatedUs.h
+ * \brief Class for a simulation UsRangeFinder
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/07
+ * \version 4.0
+ */
+
+#ifndef SIMULATEDLASER_H
+#define SIMULATEDLASER_H
+
+#include <LaserRangeFinder.h>
+#include <Thread.h>
+
+namespace flair {
+namespace core {
+class SharedMem;
+}
+namespace gui {
+class SpinBox;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class SimulatedUs
+*
+* \brief Class for a simulation UsRangeFinder
+*/
+class SimulatedLaser : public core::Thread, public LaserRangeFinder {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimulatedUs.
+  *
+  * \param name name
+  * \param modelId Model id
+  * \param deviceId LaserRangeFinder id of the Model
+  * \param priority priority of the Thread
+  */
+  SimulatedLaser(std::string name,
+            uint32_t modelId,uint32_t deviceId, uint8_t priority);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimulatedLaser();
+
+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){};
+
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
+  gui::SpinBox *data_rate;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SIMULATEDLASER_H
Index: trunk/lib/FlairSensorActuator/src/SimulatedPressureSensor.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimulatedPressureSensor.cpp	(revision 286)
+++ trunk/lib/FlairSensorActuator/src/SimulatedPressureSensor.cpp	(revision 286)
@@ -0,0 +1,80 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2018/05/24
+//  filename:   SimulatedPressureSensor.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation pressure sensor
+//
+//
+/*********************************************************************/
+#ifdef CORE2_64
+
+#include "SimulatedPressureSensor.h"
+#include <FrameworkManager.h>
+#include <SpinBox.h>
+#include <GroupBox.h>
+#include <Matrix.h>
+#include <SharedMem.h>
+#include <sstream>
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+SimulatedPressureSensor::SimulatedPressureSensor(string name, uint32_t modelId,uint32_t deviceId,
+               uint8_t priority)
+    : Thread(getFrameworkManager(), name, priority), PressureSensor( name) {
+  data_rate =
+      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 50);
+
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId), sizeof(float));
+
+  SetIsReady(true);
+}
+
+SimulatedPressureSensor::~SimulatedPressureSensor() {
+  SafeStop();
+  Join();
+}
+
+string SimulatedPressureSensor::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_pressure_" << deviceId;
+  return dev_name.str().c_str();
+}
+
+void SimulatedPressureSensor::Run(void) {
+  float p;
+
+  SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
+
+  while (!ToBeStopped()) {
+    WaitPeriod();
+
+    shmem->Read((char *)&p, sizeof(float));
+
+    if (data_rate->ValueChanged() == true) {
+      SetPeriodUS((uint32_t)(1000000. / data_rate->Value()));
+    }
+
+    output->SetValue(0, 0, p);
+    output->SetDataTime(GetTime());
+    ProcessUpdate(output);
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
+
+#endif
Index: trunk/lib/FlairSensorActuator/src/SimulatedPressureSensor.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimulatedPressureSensor.h	(revision 286)
+++ trunk/lib/FlairSensorActuator/src/SimulatedPressureSensor.h	(revision 286)
@@ -0,0 +1,86 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimulatedPressureSensor.h
+ * \brief Class for a simulation PressureSensor
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2018/05/24
+ * \version 4.0
+ */
+
+#ifndef SIMULATEDPRESSURESENSOR_H
+#define SIMULATEDPRESSURESENSOR_H
+
+#include <PressureSensor.h>
+#include <Thread.h>
+
+namespace flair {
+namespace core {
+class SharedMem;
+}
+namespace gui {
+class SpinBox;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class SimulatedPressureSensor
+*
+* \brief Class for a simulation PressureSensor
+*/
+class SimulatedPressureSensor : public core::Thread, public PressureSensor {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimulatedPressureSensor.
+	* It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param modelId Model id
+  * \param deviceId PressureSensor id of the Model
+  * \param priority priority of the Thread
+  */
+  SimulatedPressureSensor(std::string name,
+         uint32_t modelId,uint32_t deviceId, uint8_t priority);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimulatedPressureSensor();
+
+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){};
+
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
+  gui::SpinBox *data_rate;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SIMULATEDPRESSURESENSOR_H
Index: trunk/lib/FlairSensorActuator/src/SimulatedUs.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimulatedUs.cpp	(revision 286)
+++ trunk/lib/FlairSensorActuator/src/SimulatedUs.cpp	(revision 286)
@@ -0,0 +1,80 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/07
+//  filename:   SimulatedUs.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for a simulation us
+//
+//
+/*********************************************************************/
+#ifdef CORE2_64
+
+#include "SimulatedUs.h"
+#include <FrameworkManager.h>
+#include <SpinBox.h>
+#include <GroupBox.h>
+#include <Matrix.h>
+#include <SharedMem.h>
+#include <sstream>
+
+using std::string;
+using std::ostringstream;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace flair {
+namespace sensor {
+
+SimulatedUs::SimulatedUs(string name, uint32_t modelId,uint32_t deviceId,
+               uint8_t priority)
+    : Thread(getFrameworkManager(), name, priority), UsRangeFinder( name) {
+  data_rate =
+      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 500, 1, 50);
+
+  shmem = new SharedMem((Thread *)this, ShMemName(modelId, deviceId), sizeof(float));
+
+  SetIsReady(true);
+}
+
+SimulatedUs::~SimulatedUs() {
+  SafeStop();
+  Join();
+}
+
+string SimulatedUs::ShMemName(uint32_t modelId,uint32_t deviceId) {
+  ostringstream dev_name;
+  dev_name << "simu" <<  modelId << "_us_" << deviceId;
+  return dev_name.str().c_str();
+}
+
+void SimulatedUs::Run(void) {
+  float z;
+  
+  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);
+  }
+}
+
+} // end namespace sensor
+} // end namespace flair
+
+#endif
Index: trunk/lib/FlairSensorActuator/src/SimulatedUs.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimulatedUs.h	(revision 286)
+++ trunk/lib/FlairSensorActuator/src/SimulatedUs.h	(revision 286)
@@ -0,0 +1,86 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SimulatedUs.h
+ * \brief Class for a simulation UsRangeFinder
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/07
+ * \version 4.0
+ */
+
+#ifndef SIMULATEDUS_H
+#define SIMULATEDUS_H
+
+#include <UsRangeFinder.h>
+#include <Thread.h>
+
+namespace flair {
+namespace core {
+class SharedMem;
+}
+namespace gui {
+class SpinBox;
+}
+}
+
+namespace flair {
+namespace sensor {
+/*! \class SimulatedUs
+*
+* \brief Class for a simulation UsRangeFinder
+*/
+class SimulatedUs : public core::Thread, public UsRangeFinder {
+public:
+  /*!
+  * \brief Constructor
+  *
+  * Construct a SimulatedUs.
+	* It will be child of the FrameworkManager.
+  *
+  * \param name name
+  * \param modelId Model id
+  * \param deviceId UsRangeFinder id of the Model
+  * \param priority priority of the Thread
+  */
+  SimulatedUs(std::string name,
+         uint32_t modelId,uint32_t deviceId, uint8_t priority);
+
+  /*!
+  * \brief Destructor
+  *
+  */
+  ~SimulatedUs();
+
+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){};
+
+  /*!
+  * \brief Run function
+  *
+  * Reimplemented from Thread.
+  *
+  */
+  void Run(void);
+  
+  std::string ShMemName(uint32_t modelId,uint32_t deviceId);
+  gui::SpinBox *data_rate;
+};
+} // end namespace sensor
+} // end namespace flair
+#endif // SIMULATEDUS_H
Index: trunk/lib/FlairSensorActuator/src/VrpnObject.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/VrpnObject.cpp	(revision 275)
+++ trunk/lib/FlairSensorActuator/src/VrpnObject.cpp	(revision 286)
@@ -18,5 +18,4 @@
 #include "VrpnObject.h"
 #include "VrpnObject_impl.h"
-#include "VrpnClient.h"
 #include <string.h>
 #include <Matrix.h>
@@ -30,7 +29,7 @@
 
 VrpnObject::VrpnObject(string name,
-                       const TabWidget *tab)
-    : IODevice(GetVrpnClient(), name) {
-  pimpl_ = new VrpnObject_impl(this, name, -1, tab);
+                       const TabWidget *tab,VrpnClient *client)
+    : IODevice(client, name) {
+  pimpl_ = new VrpnObject_impl(this, name, -1, tab,client);
   AddDataToLog(pimpl_->output);
   
@@ -39,8 +38,8 @@
 
 VrpnObject::VrpnObject(string name, uint8_t id,
-                       const TabWidget *tab)
-    : IODevice(GetVrpnClient(), name) {
+                       const TabWidget *tab,VrpnClient *client)
+    : IODevice(client, name) {
   Warn("Creation of object %s with id %i\n", name.c_str(), id);
-  pimpl_ = new VrpnObject_impl(this, name, id, tab);
+  pimpl_ = new VrpnObject_impl(this, name, id, tab,client);
   AddDataToLog(pimpl_->output);
   
Index: trunk/lib/FlairSensorActuator/src/VrpnObject.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/VrpnObject.h	(revision 275)
+++ trunk/lib/FlairSensorActuator/src/VrpnObject.h	(revision 286)
@@ -16,4 +16,5 @@
 
 #include <IODevice.h>
+#include <VrpnClient.h>
 #include <Vector3D.h>
 #include <stdint.h>
@@ -32,5 +33,4 @@
 
 class VrpnObject_impl;
-class VrpnClient_impl;
 
 namespace flair {
@@ -45,5 +45,4 @@
 class VrpnObject : public core::IODevice {
   friend class ::VrpnObject_impl;
-  friend class ::VrpnClient_impl;
 
 public:
@@ -55,19 +54,21 @@
   * \param name VRPN object name, should be the same as defined in the server
   * \param tab Tab for the user interface
+  * \param client VrpnClient of the connection, if unspecified, use the default one
   */
   VrpnObject(std::string name,
-             const gui::TabWidget *tab);
+             const gui::TabWidget *tab,sensor::VrpnClient *client=GetVrpnClient());
 
   /*!
   * \brief Constructor
   *
-  * Construct a VrpnObject. Connection is done by IP.
+  * Construct a VrpnObject. Connection is done by xbee.
   *
   * \param name name
-  * \param id VRPN object id, should be the same as defined in the server
+  * \param id VRPN object id, should be the same as defined in the xbee bridge
   * \param tab Tab for the user interface
+  * \param client VrpnClient of the connection, if unspecified, use the default one
   */
   VrpnObject(std::string name, uint8_t id,
-             const gui::TabWidget *tab);
+             const gui::TabWidget *tab,sensor::VrpnClient *client=GetVrpnClient());
 
   /*!
Index: trunk/lib/FlairSensorActuator/src/VrpnObject_impl.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/VrpnObject_impl.cpp	(revision 275)
+++ trunk/lib/FlairSensorActuator/src/VrpnObject_impl.cpp	(revision 286)
@@ -40,6 +40,6 @@
 
 VrpnObject_impl::VrpnObject_impl(VrpnObject *self,
-                                 string name, int id, const TabWidget *tab) {
-  parent = GetVrpnClient();
+                                 string name, int id, const TabWidget *tab,VrpnClient *client) {
+  parent = client;
   this->self = self;
 
Index: trunk/lib/FlairSensorActuator/src/unexported/VrpnObject_impl.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/unexported/VrpnObject_impl.h	(revision 275)
+++ trunk/lib/FlairSensorActuator/src/unexported/VrpnObject_impl.h	(revision 286)
@@ -47,5 +47,5 @@
   VrpnObject_impl(flair::sensor::VrpnObject *self,
                   std::string name,
-                  int id, const flair::gui::TabWidget *tab);
+                  int id, const flair::gui::TabWidget *tab,flair::sensor::VrpnClient *client);
   ~VrpnObject_impl(void);
 
