From 5a210a697ecb14906544c17ff11841596d1da5f3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 18 Jan 2018 20:06:03 +1100 Subject: [PATCH] Copter: fixed flowhold build --- ArduCopter/mode_flowhold.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/ArduCopter/mode_flowhold.cpp b/ArduCopter/mode_flowhold.cpp index c7336a24cd..ced6f95dae 100644 --- a/ArduCopter/mode_flowhold.cpp +++ b/ArduCopter/mode_flowhold.cpp @@ -239,17 +239,9 @@ void Copter::ModeFlowHold::run() // get pilot's desired yaw rate float target_yaw_rate = copter.get_pilot_desired_yaw_rate(copter.channel_yaw->get_control_in()); -#if FRAME_CONFIG == HELI_FRAME - // helicopters are held on the ground until rotor speed runup has finished - bool takeoff_triggered = (copter.ap.land_complete && (target_climb_rate > 0.0f) && copter.motors->rotor_runup_complete()); -#else - bool takeoff_triggered = copter.ap.land_complete && (target_climb_rate > 0.0f); -#endif - - // FlowHold State Machine Determination if (!copter.motors->armed() || !copter.motors->get_interlock()) { flowhold_state = FlowHold_MotorStopped; - } else if (copter.takeoff_state.running || takeoff_triggered) { + } else if (copter.takeoff_state.running || takeoff_triggered(target_climb_rate)) { flowhold_state = FlowHold_Takeoff; } else if (!copter.ap.auto_armed || copter.ap.land_complete) { flowhold_state = FlowHold_Landed;