From 26e41fee7a0c1fe20422a1ea1a69ef4fdb3f40cf Mon Sep 17 00:00:00 2001 From: Niti Rohilla Date: Thu, 19 May 2016 19:36:45 +0900 Subject: [PATCH] Copter: prevent Auto tipovers caused by missing takeoff command --- ArduCopter/control_auto.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ArduCopter/control_auto.cpp b/ArduCopter/control_auto.cpp index 753b4b48b3..7dd6d57c30 100644 --- a/ArduCopter/control_auto.cpp +++ b/ArduCopter/control_auto.cpp @@ -37,6 +37,10 @@ bool Copter::auto_init(bool ignore_checks) // clear guided limits guided_limit_clear(); + // Deny switching to auto mode if land is completed and motors are armed but the next command in the mission is lateral flying + if (motors.armed() && ap.land_complete && !mission.check_takeoff_cmd()) { + return false; + } // start/resume the mission (based on MIS_RESTART parameter) mission.start_or_resume(); return true;