Skip to content

Commit

Permalink
autotest: test mag fusion and origin backup
Browse files Browse the repository at this point in the history
Co-authored-by: Clyde McQueen <clyde@mcqueen.net>
  • Loading branch information
Williangalvani and clydemcqueen committed Jul 11, 2024
1 parent fe82d02 commit 1a84591
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Tools/autotest/ardusub.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,37 @@ def TerrainMission(self):
self.disarm_vehicle()
self.progress("Mission OK")

def backup_home(self):
"""Test ORIGIN_LAT and ORIGIN_LON parameters"""

self.context_push()
self.set_parameters({
'GPS1_TYPE': 0, # Disable GPS
'EK3_SRC1_POSXY': 0, # Make sure EK3_SRC parameters do not refer to GPS
'EK3_SRC1_VELXY': 0, # Make sure EK3_SRC parameters do not refer to GPS
'ORIGIN_LAT': 47.607584,
'ORIGIN_LON': -122.343911,
})
self.reboot_sitl()
self.context_collect('STATUSTEXT')

# Wait for the EKF to be happy in constant position mode
self.wait_ready_to_arm_const_pos()

if self.current_onboard_log_contains_message('ORGN'):
raise NotAchievedException("Found unexpected ORGN message")

# This should set the origin and write a record to ORGN
self.arm_vehicle()

self.wait_statustext('Using backup location', check_context=True)

if not self.current_onboard_log_contains_message('ORGN'):
raise NotAchievedException("Did not find expected ORGN message")

self.disarm_vehicle()
self.context_pop()

def tests(self):
'''return list of all tests'''
ret = super(AutoTestSub, self).tests()
Expand All @@ -669,6 +700,7 @@ def tests(self):
self.MAV_CMD_DO_CHANGE_SPEED,
self.MAV_CMD_CONDITION_YAW,
self.TerrainMission,
self.backup_home,
])

return ret

0 comments on commit 1a84591

Please sign in to comment.