Skip to content

Commit

Permalink
Tools: autotest for plane optional interlock on arm/disarm and EStop
Browse files Browse the repository at this point in the history
  • Loading branch information
timtuxworth committed Jan 11, 2025
1 parent 9cad7a9 commit 87d30e2
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Tools/autotest/vehicle_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 87d30e2

Please sign in to comment.