From fe083c8ffa35ff85095a6caf70eb5df7d2218a7a Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Tue, 1 Sep 2015 08:32:52 -0700 Subject: [PATCH] Plane: consider extended launch throttle delays use the greater of takeoff_throttle_delay+2s or 5s --- ArduPlane/Attitude.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ArduPlane/Attitude.cpp b/ArduPlane/Attitude.cpp index 71d0f61ae4..e2e9251e5c 100644 --- a/ArduPlane/Attitude.cpp +++ b/ArduPlane/Attitude.cpp @@ -576,12 +576,13 @@ bool Plane::suppress_throttle(void) if (control_mode==AUTO && auto_state.takeoff_complete == false) { + uint32_t launch_duration_ms = ((int32_t)g.takeoff_throttle_delay)*100 + 2000; if (is_flying() && - millis() - started_flying_ms > 5000 && // been flying >5s in any mode + millis() - started_flying_ms > max(launch_duration_ms,5000) && // been flying >5s in any mode adjusted_relative_altitude_cm() > 500) { // are >5m above AGL/home // we're already flying, do not suppress the throttle. We can get // stuck in this condition if we reset a mission and cmd 1 is takeoff - // but we're still flying around + // but we're currently flying around below the takeoff altitude throttle_suppressed = false; return false; }