Ignore:
Timestamp:
Mar 4, 2017, 3:29:18 PM (4 years ago)
Author:
Sanahuja Guillaume
Message:

iadded isready to iodevice:
avoid problem of imu not ready in ardrone2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairMeta/src/UavStateMachine.cpp

    r153 r157  
    460460  flagZTrajectoryFinished = false;
    461461
    462     if((altitudeState==AltitudeState_t::Stopped) && safeToFly) {// && GetBatteryMonitor()->IsBatteryLow()==false)
    463         //The uav always takes off in fail safe mode
    464         EnterFailSafeMode();
    465         joy->SetLedOFF(4);//DualShock3::led4
    466         joy->SetLedOFF(1);//DualShock3::led1
    467         joy->Rumble(0x70);
    468         joy->SetZRef(0);
     462  if((altitudeState==AltitudeState_t::Stopped) && safeToFly && uav->isReadyToFly()) {// && GetBatteryMonitor()->IsBatteryLow()==false)
     463    //The uav always takes off in fail safe mode
     464    EnterFailSafeMode();
     465    joy->SetLedOFF(4);//DualShock3::led4
     466    joy->SetLedOFF(1);//DualShock3::led1
     467    joy->Rumble(0x70);
     468    joy->SetZRef(0);
    469469
    470470    uZ->SetOffset(); // positionne l'offset de compensation de la gravité à sa
     
    481481    SignalEvent(Event_t::TakingOff);
    482482  } else {
     483    Warn("cannot takeoff\n");
    483484    joy->ErrorNotify();
    484485  }
Note: See TracChangeset for help on using the changeset viewer.