Changeset 214 in flair-src for trunk/lib/FlairSimulator/src/X8.cpp


Ignore:
Timestamp:
02/07/18 17:49:27 (6 years ago)
Author:
Sanahuja Guillaume
Message:

matrix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairSimulator/src/X8.cpp

    r167 r214  
    2020#include <Tab.h>
    2121#include <DoubleSpinBox.h>
     22#include <SpinBox.h>
    2223#include <GroupBox.h>
    2324#include <math.h>
     
    8182      setup_tab->LastRowLastCol(), "S:", 1, 2,
    8283      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);
    8386
    8487  motors = new SimuBldc(this, name, 8, modelId,0);
     
    231234  float u_roll, u_pitch, u_yaw, u_thrust;
    232235  float omega;
     236  Time motorTime;
    233237#ifdef GL
    234238  motor_speed_mutex->GetMutex();
    235239#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  }
    237250#ifdef GL
    238251  motor_speed_mutex->ReleaseMutex();
Note: See TracChangeset for help on using the changeset viewer.