Skip to content

Commit

Permalink
autotest: add autotest for tuning loiter x/y speed
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Feb 5, 2025
1 parent a98dfcf commit d0badf8
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion Tools/autotest/arducopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def RecordThenPlayMission(self, side=50, timeout=300):
def do_RTL(self, distance_min=None, check_alt=True, distance_max=10, timeout=250, quiet=False):
"""Enter RTL mode and wait for the vehicle to disarm at Home."""
self.change_mode("RTL")
self.hover()
self.set_rc_default()
self.wait_rtl_complete(check_alt=check_alt, distance_max=distance_max, timeout=timeout, quiet=True)

def wait_rtl_complete(self, check_alt=True, distance_max=10, timeout=250, quiet=False):
Expand Down Expand Up @@ -11802,6 +11802,34 @@ def Ch6TuningWPSpeed(self):

self.do_RTL()

def Ch6TuningLoitMaxXYSpeed(self):
'''test loiter can be changed via Ch6 tuning knob'''
self.set_parameters({
"RC6_OPTION": 219, # RC6 used for tuning
"TUNE": 60, # 60 is x/y loiter speed
"TUNE_MIN": 0.02, # 20cm/s
"TUNE_MAX": 1000, # 10m/s
"AUTO_OPTIONS": 3,
})
self.set_rc(6, 2000)

self.takeoff(mode='LOITER')

self.set_rc(2, 1000)

self.wait_groundspeed(9.5, 10.5, minimum_duration=5)

self.set_rc(6, 1500)
self.wait_groundspeed(4.5, 5.5, minimum_duration=5)

self.set_rc(6, 2000)
self.wait_groundspeed(9.5, 10.5, minimum_duration=5)

self.set_rc(6, 1300)
self.wait_groundspeed(2.5, 3.5, minimum_duration=5)

self.do_RTL()

def PILOT_THR_BHV(self):
'''test the PILOT_THR_BHV parameter'''
self.start_subtest("Test default behaviour, no disarm on land")
Expand Down Expand Up @@ -12695,6 +12723,7 @@ def tests2b(self): # this block currently around 9.5mins here
self.TestTetherStuck,
self.ScriptingFlipMode,
self.CompassLearnCopyFromEKF,
self.Ch6TuningLoitMaxXYSpeed,
])
return ret

Expand Down

0 comments on commit d0badf8

Please sign in to comment.