Index: trunk/lib/FlairSensorActuator/src/SimuCamera.cpp
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuCamera.cpp	(revision 150)
+++ trunk/lib/FlairSensorActuator/src/SimuCamera.cpp	(revision 151)
@@ -19,6 +19,4 @@
 #include <FrameworkManager.h>
 #include <GroupBox.h>
-#include <SpinBox.h>
-//#include <cvimage.h>
 #include <SharedMem.h>
 #include <sstream>
@@ -32,4 +30,5 @@
 namespace sensor {
 
+//control part
 SimuCamera::SimuCamera(string name,
                        uint16_t width, uint16_t height, uint8_t channels,
@@ -37,11 +36,9 @@
     : Thread(getFrameworkManager(), name, priority),
       Camera(name, width, height, cvimage::Type::Format::BGR) {
-//  data_rate =
-//      new SpinBox(GetGroupBox()->NewRow(), "data rate", " Hz", 1, 200, 1, 50);
 
-  buf_size = width * height * channels;
+  buf_size = width * height * channels+sizeof(Time);
 
-  img = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 3);
-  output->img->imageData = img->imageData;
+  shmemReadBuf=(char*)malloc(buf_size);
+  output->img->imageData = shmemReadBuf;
 
   ostringstream dev_name;
@@ -50,13 +47,16 @@
 }
 
+//simulation part
 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;
 
+  buf_size = width * height * channels+sizeof(Time);
+  
   ostringstream dev_name;
   dev_name << "simu_cam_" << dev_id;
   shmem = new SharedMem((Thread *)this, dev_name.str().c_str(),
-                        width * height * channels, SharedMem::Type::producerConsumer);
+                        buf_size, SharedMem::Type::producerConsumer);
+  shmemReadBuf=NULL;
 }
 
@@ -64,7 +64,9 @@
   SafeStop();
   Join();
+  if(shmemReadBuf!=NULL) delete shmemReadBuf;
 }
 
 void SimuCamera::Run(void) {
+  Time time;
 //  if (data_rate == NULL) {
 //    Thread::Err("not applicable for simulation part.\n");
@@ -84,10 +86,10 @@
     output->GetMutex();
     //blocking read
-    shmem->Read((char *)img->imageData, buf_size); // remplacer copie par
+    shmem->Read(shmemReadBuf, buf_size); // remplacer copie par
                                                    // échange de pointeur sur
                                                    // double buffering
     output->ReleaseMutex();
-
-    output->SetDataTime(GetTime());
+    memcpy(&time,shmemReadBuf+buf_size-sizeof(Time),sizeof(Time));
+    output->SetDataTime(time);
 
     ProcessUpdate(output);
Index: trunk/lib/FlairSensorActuator/src/SimuCamera.h
===================================================================
--- trunk/lib/FlairSensorActuator/src/SimuCamera.h	(revision 150)
+++ trunk/lib/FlairSensorActuator/src/SimuCamera.h	(revision 151)
@@ -21,7 +21,4 @@
   namespace core {
     class SharedMem;
-  }
-  namespace gui {
-    class SpinBox;
   }
 }
@@ -99,7 +96,6 @@
   void UpdateFrom(const core::io_data *data){};
 
-  gui::SpinBox *data_rate;
   size_t buf_size;
-  IplImage *img;
+  char* shmemReadBuf;
 };
 } // end namespace sensor
Index: trunk/lib/FlairSimulator/src/Model_impl.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/Model_impl.cpp	(revision 150)
+++ trunk/lib/FlairSimulator/src/Model_impl.cpp	(revision 151)
@@ -204,6 +204,5 @@
 
   nodeOrientation.ToEuler(euler);
-  ISceneNode::setRotation(Euler::ToDegree(1) *
-                          vector3df(euler.roll, euler.pitch, euler.yaw));
+  ISceneNode::setRotation(Euler::ToDegree(1) * vector3df(euler.roll,euler.pitch, euler.yaw));
 
   if (position_init == false) {
Index: trunk/lib/FlairSimulator/src/SimuCameraGL.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/SimuCameraGL.cpp	(revision 150)
+++ trunk/lib/FlairSimulator/src/SimuCameraGL.cpp	(revision 151)
@@ -59,6 +59,4 @@
   index = 0;
 
-  buffer = (char *)malloc(width * height * 3);
-
   // user interface
   Tab *setup_tab = new Tab(parent->GetTabWidget(), name);
@@ -86,8 +84,8 @@
     glGenBuffersARB(PBO_COUNT, pboIds);
     glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pboIds[0]);
-    glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, width * height * 3, 0,
+    glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, width * height * 3+sizeof(Time), 0,
                     GL_STREAM_READ_ARB);
     glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pboIds[1]);
-    glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, width * height * 3, 0,
+    glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, width * height * 3+sizeof(Time), 0,
                     GL_STREAM_READ_ARB);
 
@@ -95,4 +93,5 @@
   } else {
     use_pbo = false;
+    buffer = (char *)malloc(width * height * 3+sizeof(Time));
     Thread::Warn("GL_ARB_pixel_buffer_object is not suppoorted\n");
   }
@@ -106,9 +105,9 @@
 
 SimuCameraGL::~SimuCameraGL() {
-  free(buffer);
-
   if (use_pbo) {
     glDeleteBuffersARB(PBO_COUNT, pboIds);
     free(pboIds);
+  } else {
+    free(buffer);
   }
 }
@@ -151,5 +150,5 @@
     glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pboIds[index]);
     glReadPixels(x, y, width, height, GL_BGR, GL_UNSIGNED_BYTE, 0);
-
+    Time time=GetTime();
     // map the PBO that contain framebuffer pixels before processing it
     glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pboIds[nextIndex]);
@@ -157,5 +156,5 @@
         GL_PIXEL_PACK_BUFFER_ARB, GL_READ_WRITE_ARB); // GL_READ_ONLY_ARB);
     if (src) {
-      putImage((char *)src);
+      putImage((char *)src,time);
       glUnmapBufferARB(
           GL_PIXEL_PACK_BUFFER_ARB); // release pointer to the mapped buffer
@@ -164,5 +163,5 @@
   } else {
     glReadPixels(x, y, width, height, GL_BGR, GL_UNSIGNED_BYTE, buffer);
-    putImage(buffer);
+    putImage(buffer,GetTime());
   }
 
@@ -173,5 +172,5 @@
 }
 
-void SimuCameraGL::putImage(char *buf) {
+void SimuCameraGL::putImage(char *buf,Time imageTime) {
   if (invert_pixel == true) {
     // opengl images are horizontally flipped, so we have to fix that here.
@@ -189,6 +188,6 @@
     delete[] tmpBuffer;
   }
-
-  shmem->Write(buf, width * height * 3);
+  memcpy(buf+width * height * 3,&imageTime,sizeof(Time));
+  shmem->Write(buf, width * height * 3+sizeof(Time));
 }
 
Index: trunk/lib/FlairSimulator/src/SimuCameraGL.h
===================================================================
--- trunk/lib/FlairSimulator/src/SimuCameraGL.h	(revision 150)
+++ trunk/lib/FlairSimulator/src/SimuCameraGL.h	(revision 151)
@@ -67,5 +67,5 @@
                                   irr::scene::ISceneManager *newManager = 0);
   void getImage(void);
-  void putImage(char *pixels);
+  void putImage(char *pixels,core::Time imageTime);
   irr::scene::ICameraSceneNode *camera;
   irr::scene::ISceneManager *smgr;
