From 43c6bb38645791d60414b02fa72182137e6636f5 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 12 Apr 2023 15:23:26 +1000 Subject: [PATCH] ArduPlane: AP_Arming ensures mission items present when in auto mode Co-authored-by: Henry Wurzburg --- ArduPlane/AP_Arming.cpp | 5 ----- ArduPlane/Plane.h | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ArduPlane/AP_Arming.cpp b/ArduPlane/AP_Arming.cpp index 54fdc5592f..e9e0005f90 100644 --- a/ArduPlane/AP_Arming.cpp +++ b/ArduPlane/AP_Arming.cpp @@ -95,11 +95,6 @@ bool AP_Arming_Plane::pre_arm_checks(bool display_failure) ret &= quadplane_checks(display_failure); #endif - if (plane.control_mode == &plane.mode_auto && plane.mission.num_commands() <= 1) { - check_failed(display_failure, "No mission loaded"); - ret = false; - } - // check adsb avoidance failsafe if (plane.failsafe.adsb) { check_failed(display_failure, "ADSB threat detected"); diff --git a/ArduPlane/Plane.h b/ArduPlane/Plane.h index 087e86cd41..ee58db454f 100644 --- a/ArduPlane/Plane.h +++ b/ArduPlane/Plane.h @@ -974,6 +974,10 @@ private: bool mode_allows_autotuning(void); uint8_t get_mode() const override { return (uint8_t)control_mode->mode_number(); } Mode *mode_from_mode_num(const enum Mode::Number num); + bool current_mode_requires_mission() const override { + return control_mode == &mode_auto; + } + bool autotuning; // events.cpp