From 999061704e21d1a76ccac94511053e4ae767ed81 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Thu, 13 Feb 2020 12:29:42 +0530 Subject: [PATCH] Rover: new function to check if arming is allowed in the mode --- APMrover2/mode.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/APMrover2/mode.h b/APMrover2/mode.h index 9625d9241f..1c55602afb 100644 --- a/APMrover2/mode.h +++ b/APMrover2/mode.h @@ -72,6 +72,9 @@ public: // returns true if vehicle can be armed or disarmed from the transmitter in this mode virtual bool allows_arming_from_transmitter() { return !is_autopilot_mode(); } + // returns false if vehicle cannot be armed in this mode + virtual bool allows_arming() const { return true; } + bool allows_stick_mixing() const { return is_autopilot_mode(); } // @@ -510,6 +513,9 @@ public: // attributes of the mode bool is_autopilot_mode() const override { return true; } + // do not allow arming from this mode + bool allows_arming() const override { return false; } + // return desired location bool get_desired_location(Location& destination) const override WARN_IF_UNUSED; @@ -542,6 +548,9 @@ public: // attributes of the mode bool is_autopilot_mode() const override { return true; } + // do not allow arming from this mode + bool allows_arming() const override { return false; } + // return desired location bool get_desired_location(Location& destination) const override WARN_IF_UNUSED;