Skip to content

Commit

Permalink
autotest: add test for moving from loiter to guided
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker authored and rmackay9 committed Apr 12, 2024
1 parent 3be1b9e commit 77cccd0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Tools/autotest/arducopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10828,6 +10828,21 @@ def CameraLogMessages(self):
if abs(got - want) > 1:
raise NotAchievedException(f"Incorrect relalt {want=} {got=}")

def LoiterToGuidedHomeVSOrigin(self):
'''test moving from guided to loiter mode when home is a different alt
to origin'''
self.set_parameters({
"TERRAIN_ENABLE": 1,
"SIM_TERRAIN": 1,
})
self.takeoff(10, mode='GUIDED')
here = self.mav.location()
self.set_home(here)
self.change_mode('LOITER')
self.wait_altitude(here.alt-1, here.alt+1, minimum_duration=10)
self.disarm_vehicle(force=True)
self.reboot_sitl() # to "unstick" home

def tests2b(self): # this block currently around 9.5mins here
'''return list of all tests'''
ret = ([
Expand Down Expand Up @@ -10906,6 +10921,7 @@ def tests2b(self): # this block currently around 9.5mins here
self.PILOT_THR_BHV,
self.GPSForYawCompassLearn,
self.CameraLogMessages,
self.LoiterToGuidedHomeVSOrigin,
])
return ret

Expand Down

0 comments on commit 77cccd0

Please sign in to comment.