Skip to content

Commit 87d30e2

Browse files
committed
Tools: autotest for plane optional interlock on arm/disarm and EStop
1 parent 9cad7a9 commit 87d30e2

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

Tools/autotest/vehicle_test_suite.py

+38
Original file line numberDiff line numberDiff line change
@@ -10649,6 +10649,44 @@ def ArmFeatures(self):
1064910649
self.set_rc(interlock_channel, 1000)
1065010650
raise NotAchievedException("Motor interlock was changed while disarmed")
1065110651
self.set_rc(interlock_channel, 1000)
10652+
elif self.is_plane():
10653+
self.start_subtest("Test arming failure with interlock enabled")
10654+
interlock_channel = 9
10655+
self.set_parameter("RC%u_OPTION" % interlock_channel, 32)
10656+
# enable all plane interlock optons, 31 turns on all flags
10657+
self.set_parameter("ILCK_OPTIONS", 31)
10658+
# interlock must be help high to disable arm/disarm/interlock
10659+
self.reboot_sitl() # needed for CAM1_TYPE to take effect
10660+
self.set_rc(interlock_channel, 2000)
10661+
try:
10662+
self.arm_motors_with_rc_input()
10663+
except NotAchievedException:
10664+
pass
10665+
if self.armed():
10666+
raise NotAchievedException(
10667+
"Armed with RC input when interlock enabled")
10668+
try:
10669+
self.arm_motors_with_switch(arming_switch)
10670+
except NotAchievedException:
10671+
pass
10672+
if self.armed():
10673+
raise NotAchievedException("Armed with switch when interlock enabled")
10674+
self.disarm_vehicle()
10675+
10676+
self.progress("arm with mavproxy")
10677+
mavproxy = self.start_mavproxy()
10678+
if self.mavproxy_arm_vehicle(mavproxy):
10679+
raise NotAchievedException("Armed with mavproxy with interlock enabled")
10680+
self.stop_mavproxy(mavproxy)
10681+
10682+
self.wait_heartbeat()
10683+
self.set_rc(arming_switch, 1000)
10684+
self.set_rc(interlock_channel, 1000)
10685+
self.set_parameter("RC%u_OPTION" % interlock_channel, 0)
10686+
# enable all plane interlock optons, 31 turns on all flags
10687+
self.set_parameter("ILCK_OPTIONS", 1)
10688+
# interlock must be help high to disable arm/disarm/interlock
10689+
self.reboot_sitl() # needed to disable the interlock channel
1065210690

1065310691
self.start_subtest("Test all mode arming")
1065410692
self.wait_ready_to_arm()

0 commit comments

Comments
 (0)