Changeset 214 in flair-src for trunk/lib/FlairSimulator/src/X8.cpp
- Timestamp:
- 02/07/18 17:49:27 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairSimulator/src/X8.cpp
r167 r214 20 20 #include <Tab.h> 21 21 #include <DoubleSpinBox.h> 22 #include <SpinBox.h> 22 23 #include <GroupBox.h> 23 24 #include <math.h> … … 81 82 setup_tab->LastRowLastCol(), "S:", 1, 2, 82 83 0.1); // coefficient de forme des helices 1<S=1+Ss/Sprop<2 (sans unite) 84 85 motorTimeout = new SpinBox(setup_tab->NewRow(), "motor timeout:","ms", 0, 1000, 100,100); 83 86 84 87 motors = new SimuBldc(this, name, 8, modelId,0); … … 231 234 float u_roll, u_pitch, u_yaw, u_thrust; 232 235 float omega; 236 Time motorTime; 233 237 #ifdef GL 234 238 motor_speed_mutex->GetMutex(); 235 239 #endif // GL 236 motors->GetSpeeds(motor_speed); 240 motors->GetSpeeds(motor_speed,&motorTime); 241 if((GetTime()-motorTime)/1000000>motorTimeout->Value()) { 242 for(int i=0;i<8;i++) { 243 if(motor_speed[i]!=0) { 244 //Printf("timout\n"); 245 for(int i=0;i<8;i++) motor_speed[i]=0; 246 break; 247 } 248 } 249 } 237 250 #ifdef GL 238 251 motor_speed_mutex->ReleaseMutex();
Note:
See TracChangeset
for help on using the changeset viewer.