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


Ignore:
Timestamp:
Mar 4, 2021, 5:00:53 PM (4 years ago)
Author:
Sanahuja Guillaume
Message:

resolve bug with custom altitude

File:
1 edited

Legend:

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

    r317 r398  
    293293  }
    294294  // landing, only check if we reach desired landing altitude
     295  //no break in this case, continue with Stabilized state
    295296  case AltitudeState_t::StartLanding: {
    296297    if (altitudeTrajectory->Position() == desiredLandingAltitude->Value()) {
     
    318319      joy->SetZRef(0);
    319320    }
     321    break;
    320322  }
    321323  }
     
    342344               "switching back to safe mode\n");
    343345  EnterFailSafeMode();
     346  GetDefaultReferenceAltitude(refAltitude,refVerticalVelocity);
    344347};
    345348
    346349void UavStateMachine::ComputeThrust(void) {
    347   if (altitudeMode == AltitudeMode_t::Manual) {
     350  if (thrustMode == ThrustMode_t::Default) {
    348351    currentThrust = ComputeDefaultThrust();
    349352  } else {
     
    509512
    510513void UavStateMachine::Land(void) {
     514  if (thrustMode != ThrustMode_t::Default) {
     515    SetThrustMode(ThrustMode_t::Default);
     516  }
    511517  if (altitudeMode != AltitudeMode_t::Manual) {
    512518    SetAltitudeMode(AltitudeMode_t::Manual);
Note: See TracChangeset for help on using the changeset viewer.