Copter: don't report initial mode switch as failsafe mode change

This commit is contained in:
Pierre Kancir 2020-12-31 09:41:00 +01:00 committed by Randy Mackay
parent 186c28c275
commit f53892a1fa

View File

@ -216,13 +216,11 @@ void Copter::init_ardupilot()
enable_motor_output();
}
// attempt to switch to RTL, if this fails then switch to Land
// attempt to set the intial_mode, else set to STABILIZE
if (!set_mode((enum Mode::Number)g.initial_mode.get(), ModeReason::INITIALISED)) {
// set mode to STABILIZE will trigger mode change notification to pilot
set_mode(Mode::Number::STABILIZE, ModeReason::UNAVAILABLE);
} else {
// alert pilot to mode change
AP_Notify::events.failsafe_mode_change = 1;
AP_Notify::events.user_mode_change_failed = 1;
}
// flag that initialisation has completed