From 26811ad46d33d3a8f0954295cc1c9820b95f1820 Mon Sep 17 00:00:00 2001 From: James O'Shannessy <12959316+joshanne@users.noreply.github.com> Date: Wed, 3 Mar 2021 23:25:47 +1100 Subject: [PATCH] AP_Landing: Autoenable fence if required when landing was aborted --- libraries/AP_Landing/AP_Landing.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/AP_Landing/AP_Landing.cpp b/libraries/AP_Landing/AP_Landing.cpp index da807a9c21..a9418b5b1d 100644 --- a/libraries/AP_Landing/AP_Landing.cpp +++ b/libraries/AP_Landing/AP_Landing.cpp @@ -20,6 +20,7 @@ #include "AP_Landing.h" #include #include +#include // table of user settable parameters const AP_Param::GroupInfo AP_Landing::var_info[] = { @@ -249,6 +250,11 @@ bool AP_Landing::verify_abort_landing(const Location &prev_WP_loc, Location &nex mission.resume(); } // else we're in AUTO with a stopped mission and handle_auto_mode() will set RTL + + AC_Fence *fence = AP::fence(); + if (fence) { + fence->auto_enable_fence_after_takeoff(); + } } Log();