AC_AutoTune: fix pilot testing bug

This commit is contained in:
Bill Geyer 2022-11-12 14:04:46 -05:00 committed by Randy Mackay
parent 86173a6573
commit 20a2e2485e

View File

@ -198,6 +198,8 @@ void AC_AutoTune::run()
const bool zero_rp_input = is_zero(target_roll_cd) && is_zero(target_pitch_cd); const bool zero_rp_input = is_zero(target_roll_cd) && is_zero(target_pitch_cd);
const uint32_t now = AP_HAL::millis(); const uint32_t now = AP_HAL::millis();
if (mode != SUCCESS) {
if (!zero_rp_input || !is_zero(target_yaw_rate_cds) || !is_zero(target_climb_rate_cms)) { if (!zero_rp_input || !is_zero(target_yaw_rate_cds) || !is_zero(target_climb_rate_cms)) {
if (!pilot_override) { if (!pilot_override) {
pilot_override = true; pilot_override = true;
@ -223,6 +225,7 @@ void AC_AutoTune::run()
desired_yaw_cd = ahrs_view->yaw_sensor; desired_yaw_cd = ahrs_view->yaw_sensor;
} }
} }
}
if (pilot_override) { if (pilot_override) {
if (now - last_pilot_override_warning > 1000) { if (now - last_pilot_override_warning > 1000) {
gcs().send_text(MAV_SEVERITY_INFO, "AutoTune: pilot overrides active"); gcs().send_text(MAV_SEVERITY_INFO, "AutoTune: pilot overrides active");