From dfc1b841868c0e5790bf5056c8847c51f0312a82 Mon Sep 17 00:00:00 2001 From: Henry Wurzburg Date: Tue, 19 Dec 2023 13:42:24 -0600 Subject: [PATCH] AC_Fence: fix autofence enable in takeoff mode --- libraries/AC_Fence/AC_Fence.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/AC_Fence/AC_Fence.cpp b/libraries/AC_Fence/AC_Fence.cpp index ac9d7f50a0..c1e3b4cebb 100644 --- a/libraries/AC_Fence/AC_Fence.cpp +++ b/libraries/AC_Fence/AC_Fence.cpp @@ -205,6 +205,9 @@ void AC_Fence::disable_floor() */ void AC_Fence::auto_enable_fence_after_takeoff(void) { + if (_enabled) { + return; + } switch(auto_enabled()) { case AC_Fence::AutoEnable::ALWAYS_ENABLED: case AC_Fence::AutoEnable::ENABLE_DISABLE_FLOOR_ONLY: