From 4c40d66d7dd068ec74583cb2df95f2d7235eda39 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 30 Nov 2024 19:19:48 +1100 Subject: [PATCH] autotest: fixed test suite for FENCE_AUTOENABLE=2 --- Tools/autotest/arduplane.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Tools/autotest/arduplane.py b/Tools/autotest/arduplane.py index 8e49b0f203..9e1ea7ede1 100644 --- a/Tools/autotest/arduplane.py +++ b/Tools/autotest/arduplane.py @@ -3696,20 +3696,23 @@ class AutoTestPlane(vehicle_test_suite.TestSuite): self.set_rc(3, 1500) self.change_altitude(cruise_alt, relative=True) - self.progress("Fly below floor and check for no breach") - self.change_altitude(25, relative=True) + self.progress("Fly below floor and check for breach") + self.set_rc(2, 2000) + self.wait_mode("RTL") m = self.mav.recv_match(type='SYS_STATUS', blocking=True) self.progress("Got (%s)" % str(m)) - if (not (m.onboard_control_sensors_health & fence_bit)): - raise NotAchievedException("Fence Ceiling breached") + if (m.onboard_control_sensors_health & fence_bit): + raise NotAchievedException("Fence floor not breached") - self.progress("Fly above floor and check fence is not re-enabled") + self.change_mode("FBWA") + + self.progress("Fly above floor and check fence is enabled") self.set_rc(3, 2000) self.change_altitude(75, relative=True) m = self.mav.recv_match(type='SYS_STATUS', blocking=True) self.progress("Got (%s)" % str(m)) - if (m.onboard_control_sensors_enabled & fence_bit): - raise NotAchievedException("Fence Ceiling re-enabled") + if (not (m.onboard_control_sensors_enabled & fence_bit)): + raise NotAchievedException("Fence Floor not enabled") self.progress("Return to cruise alt") self.set_rc(3, 1500)