Changeset 201 in flair-src for trunk/lib/FlairMeta/src


Ignore:
Timestamp:
Oct 12, 2017, 9:29:37 AM (7 years ago)
Author:
Sanahuja Guillaume
Message:

put signal event after changing state variable

File:
1 edited

Legend:

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

    r186 r201  
    302302  case AltitudeState_t::Stabilized: {
    303303    if (!altitudeTrajectory->IsRunning() && !flagZTrajectoryFinished) {
     304      flagZTrajectoryFinished = true;
    304305      SignalEvent(Event_t::ZTrajectoryFinished);
    305       flagZTrajectoryFinished = true;
    306306    }
    307307    if (flagZTrajectoryFinished && desiredTakeoffAltitude->ValueChanged()) {
     
    479479    groundAltitude = currentAltitude;
    480480    altitudeState = AltitudeState_t::TakingOff;
    481 
    482481    SignalEvent(Event_t::TakingOff);
    483482  } else {
     
    498497        joy->SetZRef(0);
    499498        altitudeTrajectory->StartTraj(currentAltitude,desiredLandingAltitude->Value()); //shouldn't it be groundAltitude?
     499        altitudeState=AltitudeState_t::StartLanding;
    500500        SignalEvent(Event_t::StartLanding);
    501         altitudeState=AltitudeState_t::StartLanding;
    502501    } else if (altitudeState==AltitudeState_t::TakingOff) {
    503502        EmergencyLand();
     
    553552  uav->GetBldc()->SetEnabled(false);
    554553  uav->GetUavMultiplex()->UnlockUserInterface();
     554  altitudeState = AltitudeState_t::Stopped;
    555555  SignalEvent(Event_t::Stopped);
    556   altitudeState = AltitudeState_t::Stopped;
    557556  uav->GetAhrs()->UnlockUserInterface();
    558557
Note: See TracChangeset for help on using the changeset viewer.