Index: trunk/lib/FlairSimulator/src/Model_impl.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/Model_impl.cpp	(revision 211)
+++ trunk/lib/FlairSimulator/src/Model_impl.cpp	(revision 214)
@@ -25,5 +25,5 @@
 #include "SpinBox.h"
 #include "CheckBox.h"
-#include "cvmatrix.h"
+#include "Matrix.h"
 #include "Euler.h"
 #include <math.h>
@@ -134,5 +134,5 @@
   desc->SetElementName(17, 0, "my");
   desc->SetElementName(18, 0, "mz");
-  output = new cvmatrix(this, desc, floatType, "state");
+  output = new Matrix(this, desc, floatType, "state");
   delete desc;
 
Index: trunk/lib/FlairSimulator/src/SimuLaserGL.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/SimuLaserGL.cpp	(revision 211)
+++ trunk/lib/FlairSimulator/src/SimuLaserGL.cpp	(revision 214)
@@ -20,5 +20,5 @@
 #include "Model.h"
 #include "Gui.h"
-#include <cvmatrix.h>
+#include <Matrix.h>
 #include <SharedMem.h>
 #include <TabWidget.h>
Index: trunk/lib/FlairSimulator/src/SimuUsGL.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/SimuUsGL.cpp	(revision 211)
+++ trunk/lib/FlairSimulator/src/SimuUsGL.cpp	(revision 214)
@@ -17,5 +17,5 @@
 #include "SimuUsGL.h"
 #include "Model.h"
-#include <cvmatrix.h>
+#include <Matrix.h>
 #include <SharedMem.h>
 #include <TabWidget.h>
@@ -54,5 +54,5 @@
 #endif
     // todo: utiliser le placement de l'us dans le drone et sa portée
-    cvmatrix *input = (cvmatrix *)data;
+    Matrix *input = (Matrix *)data;
     value = input->Value(9, 0);
     shmem->Write((char *)&value, sizeof(float));
Index: trunk/lib/FlairSimulator/src/X4.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/X4.cpp	(revision 211)
+++ trunk/lib/FlairSimulator/src/X4.cpp	(revision 214)
@@ -20,4 +20,5 @@
 #include <Tab.h>
 #include <DoubleSpinBox.h>
+#include <SpinBox.h>
 #include <GroupBox.h>
 #include <math.h>
@@ -73,4 +74,6 @@
   j_yaw = new DoubleSpinBox(setup_tab->LastRowLastCol(), "j_yaw:", 0, 1, 0.001,
                             5); // moment d'inertie d'un axe (N.m.s²/rad)
+                            
+  motorTimeout = new SpinBox(setup_tab->NewRow(), "motor timeout:","ms", 0, 1000, 100,100);
 
   motors = new SimuBldc(this, name, 4, modelId,0);
@@ -199,11 +202,22 @@
   float fl_speed, fr_speed, rl_speed, rr_speed;
   float u_roll, u_pitch, u_yaw, u_thrust;
+  Time motorTime;
 #ifdef GL
   motor_speed_mutex->GetMutex();
 #endif // GL
-  motors->GetSpeeds(motor_speed);
+  motors->GetSpeeds(motor_speed,&motorTime);
+  if((GetTime()-motorTime)/1000000>motorTimeout->Value()) {
+    for(int i=0;i<4;i++) {
+      if(motor_speed[i]!=0) {
+         //Printf("timout\n");
+        for(int i=0;i<4;i++) motor_speed[i]=0;
+        break;
+      }
+    }
+  }
 #ifdef GL
   motor_speed_mutex->ReleaseMutex();
 #endif // GL
+  
   fl_speed = motor_speed[0];
   fr_speed = motor_speed[1];
@@ -212,9 +226,9 @@
 
   /*
-      ** ===================================================================
-      **    u roll: roll torque
-      **
-      ** ===================================================================
-      */
+  ** ===================================================================
+  **    u roll: roll torque
+  **
+  ** ===================================================================
+  */
   u_roll = arm_length->Value() * k_mot->Value() *
            (fl_speed * fl_speed + rl_speed * rl_speed - fr_speed * fr_speed -
Index: trunk/lib/FlairSimulator/src/X4.h
===================================================================
--- trunk/lib/FlairSimulator/src/X4.h	(revision 211)
+++ trunk/lib/FlairSimulator/src/X4.h	(revision 214)
@@ -26,4 +26,5 @@
 namespace gui {
 class DoubleSpinBox;
+class SpinBox;
 }
 namespace actuator {
@@ -63,4 +64,5 @@
   gui::DoubleSpinBox *f_air_vert, *f_air_lat;
   gui::DoubleSpinBox *j_roll, *j_pitch, *j_yaw;
+  gui::SpinBox *motorTimeout;
 };
 } // end namespace simulator
Index: trunk/lib/FlairSimulator/src/X8.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/X8.cpp	(revision 211)
+++ trunk/lib/FlairSimulator/src/X8.cpp	(revision 214)
@@ -20,4 +20,5 @@
 #include <Tab.h>
 #include <DoubleSpinBox.h>
+#include <SpinBox.h>
 #include <GroupBox.h>
 #include <math.h>
@@ -81,4 +82,6 @@
       setup_tab->LastRowLastCol(), "S:", 1, 2,
       0.1); // coefficient de forme des helices 1<S=1+Ss/Sprop<2 (sans unite)
+      
+  motorTimeout = new SpinBox(setup_tab->NewRow(), "motor timeout:","ms", 0, 1000, 100,100);
 
   motors = new SimuBldc(this, name, 8, modelId,0);
@@ -231,8 +234,18 @@
   float u_roll, u_pitch, u_yaw, u_thrust;
   float omega;
+  Time motorTime;
 #ifdef GL
   motor_speed_mutex->GetMutex();
 #endif // GL
-  motors->GetSpeeds(motor_speed);
+  motors->GetSpeeds(motor_speed,&motorTime);
+  if((GetTime()-motorTime)/1000000>motorTimeout->Value()) {
+    for(int i=0;i<8;i++) {
+      if(motor_speed[i]!=0) {
+         //Printf("timout\n");
+        for(int i=0;i<8;i++) motor_speed[i]=0;
+        break;
+      }
+    }
+  }
 #ifdef GL
   motor_speed_mutex->ReleaseMutex();
Index: trunk/lib/FlairSimulator/src/X8.h
===================================================================
--- trunk/lib/FlairSimulator/src/X8.h	(revision 211)
+++ trunk/lib/FlairSimulator/src/X8.h	(revision 214)
@@ -26,4 +26,5 @@
 namespace gui {
 class DoubleSpinBox;
+class SpinBox;
 }
 namespace actuator {
@@ -65,4 +66,5 @@
   gui::DoubleSpinBox *j_roll, *j_pitch, *j_yaw;
   gui::DoubleSpinBox *j_r, *sigma, *S;
+  gui::SpinBox *motorTimeout;
 };
 } // end namespace simulator
Index: trunk/lib/FlairSimulator/src/unexported/Model_impl.h
===================================================================
--- trunk/lib/FlairSimulator/src/unexported/Model_impl.h	(revision 211)
+++ trunk/lib/FlairSimulator/src/unexported/Model_impl.h	(revision 214)
@@ -25,5 +25,5 @@
 namespace flair {
 namespace core {
-class cvmatrix;
+class Matrix;
 class Mutex;
 class ConditionVariable;
@@ -101,5 +101,5 @@
   flair::gui::CheckBox *enable_opti;
   flair::simulator::Model *self;
-  flair::core::cvmatrix *output;
+  flair::core::Matrix *output;
   flair::core::Mutex *states_mutex;
 
