From 0efb2f20484ee3582f0aba1b96108aa821f2d919 Mon Sep 17 00:00:00 2001 From: Hwurzburg Date: Sun, 30 Jan 2022 19:26:51 -0600 Subject: [PATCH] Plane: disable TECS use during NAV_SCRIPT_TIME --- ArduPlane/mode.h | 4 ++-- ArduPlane/mode_auto.cpp | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ArduPlane/mode.h b/ArduPlane/mode.h index 871bf5810c..0dafd9a0eb 100644 --- a/ArduPlane/mode.h +++ b/ArduPlane/mode.h @@ -173,9 +173,9 @@ public: bool allows_throttle_nudging() const override { return true; } - bool does_auto_navigation() const override { return true; } + bool does_auto_navigation() const override; - bool does_auto_throttle() const override { return true; } + bool does_auto_throttle() const override; protected: diff --git a/ArduPlane/mode_auto.cpp b/ArduPlane/mode_auto.cpp index 306f4dbc88..9b6332b059 100644 --- a/ArduPlane/mode_auto.cpp +++ b/ArduPlane/mode_auto.cpp @@ -112,3 +112,19 @@ void ModeAuto::navigate() } } + +bool ModeAuto::does_auto_navigation() const +{ +#if AP_SCRIPTING_ENABLED + return (!plane.nav_scripting_active()); +#endif + return true; +} + +bool ModeAuto::does_auto_throttle() const +{ +#if AP_SCRIPTING_ENABLED + return (!plane.nav_scripting_active()); +#endif + return true; +}