From 87d30e27ca02fdc2c3cc742029999173795ac17f Mon Sep 17 00:00:00 2001 From: Tim Tuxworth Date: Sat, 11 Jan 2025 14:54:26 -0700 Subject: [PATCH] Tools: autotest for plane optional interlock on arm/disarm and EStop --- Tools/autotest/vehicle_test_suite.py | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Tools/autotest/vehicle_test_suite.py b/Tools/autotest/vehicle_test_suite.py index d77e00ec0bef5..fd550e2c9cdbd 100644 --- a/Tools/autotest/vehicle_test_suite.py +++ b/Tools/autotest/vehicle_test_suite.py @@ -10649,6 +10649,44 @@ def ArmFeatures(self): self.set_rc(interlock_channel, 1000) raise NotAchievedException("Motor interlock was changed while disarmed") self.set_rc(interlock_channel, 1000) + elif self.is_plane(): + self.start_subtest("Test arming failure with interlock enabled") + interlock_channel = 9 + self.set_parameter("RC%u_OPTION" % interlock_channel, 32) + # enable all plane interlock optons, 31 turns on all flags + self.set_parameter("ILCK_OPTIONS", 31) + # interlock must be help high to disable arm/disarm/interlock + self.reboot_sitl() # needed for CAM1_TYPE to take effect + self.set_rc(interlock_channel, 2000) + try: + self.arm_motors_with_rc_input() + except NotAchievedException: + pass + if self.armed(): + raise NotAchievedException( + "Armed with RC input when interlock enabled") + try: + self.arm_motors_with_switch(arming_switch) + except NotAchievedException: + pass + if self.armed(): + raise NotAchievedException("Armed with switch when interlock enabled") + self.disarm_vehicle() + + self.progress("arm with mavproxy") + mavproxy = self.start_mavproxy() + if self.mavproxy_arm_vehicle(mavproxy): + raise NotAchievedException("Armed with mavproxy with interlock enabled") + self.stop_mavproxy(mavproxy) + + self.wait_heartbeat() + self.set_rc(arming_switch, 1000) + self.set_rc(interlock_channel, 1000) + self.set_parameter("RC%u_OPTION" % interlock_channel, 0) + # enable all plane interlock optons, 31 turns on all flags + self.set_parameter("ILCK_OPTIONS", 1) + # interlock must be help high to disable arm/disarm/interlock + self.reboot_sitl() # needed to disable the interlock channel self.start_subtest("Test all mode arming") self.wait_ready_to_arm()