Skip to content

Commit

Permalink
Tools: Heli Autotune autotest - add tune check
Browse files Browse the repository at this point in the history
  • Loading branch information
bnsgeyer committed Apr 22, 2024
1 parent f248220 commit 33068d8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Tools/autotest/helicopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,34 @@ def AutoTune(self):
self.set_rc(8, 1000)
self.wait_disarmed()

# tune check
self.set_parameters({
"AUTOTUNE_AXES": 7,
"AUTOTUNE_SEQ": 16,
"AUTOTUNE_FRQ_MIN": 10,
"AUTOTUNE_FRQ_MAX": 80,
})

# Conduct testing from althold
self.takeoff(10, mode="ALT_HOLD")

# hold position in loiter
self.change_mode('AUTOTUNE')

tstart = self.get_sim_time()
self.wait_statustext('AutoTune: Success', timeout=1000)
now = self.get_sim_time()
self.progress("AUTOTUNE OK (%u seconds)" % (now - tstart))

self.change_mode('ALT_HOLD')
self.set_rc(3, 1000)
self.context_collect('STATUSTEXT')
self.wait_statustext(r"SIM Hit ground at ([0-9.]+) m/s",
check_context=True,
regex=True)
self.set_rc(8, 1000)
self.wait_disarmed()

def tests(self):
'''return list of all tests'''
ret = vehicle_test_suite.TestSuite.tests(self)
Expand Down

0 comments on commit 33068d8

Please sign in to comment.