Skip to content

Commit

Permalink
autotest: add test for PILOT_THR_BHV parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Apr 10, 2024
1 parent 29149fa commit 35d77ad
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Tools/autotest/arducopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from vehicle_test_suite import NotAchievedException, AutoTestTimeoutException, PreconditionFailedException
from vehicle_test_suite import Test
from vehicle_test_suite import MAV_POS_TARGET_TYPE_MASK
from vehicle_test_suite import WaitAndMaintainArmed

from pymavlink.rotmat import Vector3

Expand Down Expand Up @@ -10705,6 +10706,32 @@ def Ch6TuningWPSpeed(self):

self.do_RTL()

def PILOT_THR_BHV(self):
'''test the PILOT_THR_BHV parameter'''
self.start_subtest("Test default behaviour, no disarm on land")
self.set_parameters({
"DISARM_DELAY": 0,
})
self.takeoff(2, mode='GUIDED')
self.set_rc(3, 1500)
self.change_mode('LOITER')
self.set_rc(3, 1300)

maintain_armed = WaitAndMaintainArmed(self, minimum_duration=20)
maintain_armed.run()

self.start_subtest("Test THR_BEHAVE_DISARM_ON_LAND_DETECT")
self.set_parameters({
"PILOT_THR_BHV": 4, # Disarm on land detection
})
self.zero_throttle()
self.takeoff(2, mode='GUIDED')
self.set_rc(3, 1500)
self.change_mode('LOITER')
self.set_rc(3, 1300)

self.wait_disarmed()

def tests2b(self): # this block currently around 9.5mins here
'''return list of all tests'''
ret = ([
Expand Down Expand Up @@ -10779,6 +10806,7 @@ def tests2b(self): # this block currently around 9.5mins here
self.MAV_CMD_NAV_TAKEOFF,
self.MAV_CMD_NAV_TAKEOFF_command_int,
self.Ch6TuningWPSpeed,
self.PILOT_THR_BHV,
])
return ret

Expand Down

0 comments on commit 35d77ad

Please sign in to comment.