Browse Source

AP_Soaring: Ensure minimum cruise times are respected when RC switch position is changed.

zr-v5.1
Samuel Tabor 4 years ago committed by Peter Barker
parent
commit
e78d6fee0a
  1. 19
      libraries/AP_Soaring/AP_Soaring.cpp

19
libraries/AP_Soaring/AP_Soaring.cpp

@ -405,21 +405,20 @@ void SoaringController::update_active_state() @@ -405,21 +405,20 @@ void SoaringController::update_active_state()
case ActiveStatus::MANUAL_MODE_CHANGE:
// It's enabled, but wasn't on the last loop.
gcs().send_text(MAV_SEVERITY_INFO, "Soaring: Enabled, manual mode changes.");
set_throttle_suppressed(true);
// We changed mode - if we're in LOITER this means we should exit gracefully.
// This has no effect if we're cruising as it is reset on thermal entry.
_exit_commanded = true;
break;
case ActiveStatus::AUTO_MODE_CHANGE:
gcs().send_text(MAV_SEVERITY_INFO, "Soaring: Enabled, automatic mode changes.");
set_throttle_suppressed(true);
// We changed mode - if we're in LOITER this means we should exit gracefully.
// This has no effect if we're cruising as it is reset on thermal entry.
_exit_commanded = true;
break;
}
if (_last_update_status == ActiveStatus::SOARING_DISABLED) {
// We have switched from disabled into an active mode, start cruising.
init_cruising();
} else if (status != ActiveStatus::SOARING_DISABLED) {
// We switched between active modes. If we're in THERMAL this means we should exit gracefully.
// This has no effect if we're cruising as it is reset on thermal entry.
_exit_commanded = true;
}
}
_last_update_status = status;

Loading…
Cancel
Save