Tools: AP_Arming ensures mission items present when in auto mode

Co-authored-by: Henry Wurzburg <hwurzburg@yahoo.com>
This commit is contained in:
Peter Barker 2023-04-12 15:23:26 +10:00 committed by Peter Barker
parent 941bb6a45b
commit 5cc046b9cc
4 changed files with 16 additions and 0 deletions

View File

@ -9854,6 +9854,7 @@ class AutoTestCopter(AutoTest):
self.IMUConsistency,
self.AHRSTrimLand,
self.GuidedYawRate,
self.NoArmWithoutMissionItems,
])
return ret

View File

@ -4571,6 +4571,7 @@ class AutoTestPlane(AutoTest):
self.MissionJumpTags,
self.GCSFailsafe,
self.SDCardWPTest,
self.NoArmWithoutMissionItems,
])
return ret

View File

@ -7309,6 +7309,19 @@ class AutoTest(ABC):
# Check fence is not enabled
self.assert_not_receiving_message('FENCE_STATUS', timeout=timeout)
def NoArmWithoutMissionItems(self):
'''ensure we can't arm in auto mode without mission items present'''
# load a trivial mission
items = []
items.append((mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 0, 0, 20000),)
items.append((mavutil.mavlink.MAV_CMD_NAV_RETURN_TO_LAUNCH, 0, 0, 0))
self.upload_simple_relhome_mission(items)
self.change_mode('AUTO')
self.clear_mission(mavutil.mavlink.MAV_MISSION_TYPE_ALL)
self.assert_prearm_failure('Mode requires mission',
other_prearm_failures_fatal=False)
def assert_prearm_failure(self,
expected_statustext,
timeout=5,

View File

@ -6354,6 +6354,7 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm)
self.GCSFailsafe,
self.InitialMode,
self.DriveMaxRCIN,
self.NoArmWithoutMissionItems,
])
return ret