Skip to content

Commit

Permalink
Plane: add test for MAV_CMD_NAV_LOITER_TO_ALT
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Sep 26, 2024
1 parent decf484 commit beb4226
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Tools/autotest/arduplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -6206,6 +6206,22 @@ def BadRollChannelDefined(self):
'''ensure we don't die with a bad Roll channel defined'''
self.set_parameter("RCMAP_ROLL", 17)

def MAV_CMD_NAV_LOITER_TO_ALT(self):
'''test loiter to alt mission item'''
self.upload_simple_relhome_mission([
(mavutil.mavlink.MAV_CMD_NAV_TAKEOFF, 0, 0, 30),
(mavutil.mavlink.MAV_CMD_NAV_LOITER_TO_ALT, 0, 0, 500),
(mavutil.mavlink.MAV_CMD_NAV_LOITER_TO_ALT, 0, 0, 100),
(mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 800, 0, 0),
])
self.change_mode('AUTO')
self.wait_ready_to_arm()
self.arm_vehicle()
self.wait_altitude(450, 475, relative=True, timeout=600)
self.wait_altitude(75, 125, relative=True, timeout=600)
self.wait_current_waypoint(4)
self.fly_home_land_and_disarm()

def tests(self):
'''return list of all tests'''
ret = super(AutoTestPlane, self).tests()
Expand Down Expand Up @@ -6258,6 +6274,7 @@ def tests(self):
self.AdvancedFailsafe,
self.LOITER,
self.MAV_CMD_NAV_LOITER_TURNS,
self.MAV_CMD_NAV_LOITER_TO_ALT,
self.DeepStall,
self.WatchdogHome,
self.LargeMissions,
Expand Down

0 comments on commit beb4226

Please sign in to comment.