Skip to content

Commit

Permalink
autotest: add test for Copter MISSION_START mavlink command
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Sep 19, 2023
1 parent b3dd5c2 commit c352de2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Tools/autotest/arducopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10170,6 +10170,23 @@ def BrakeZ(self):
self.wait_for_local_velocity(vx=0, vy=0, vz_up=0, timeout=10)
self.land_and_disarm()

def MISSION_START(self):
'''test mavlink command MAV_CMD_MISSION_START'''
self.upload_simple_relhome_mission([
(mavutil.mavlink.MAV_CMD_NAV_TAKEOFF, 0, 0, 200),
(mavutil.mavlink.MAV_CMD_NAV_RETURN_TO_LAUNCH, 0, 0, 0),
])
for command in self.run_cmd, self.run_cmd_int:
self.change_mode('LOITER')
self.set_current_waypoint(1)
self.wait_ready_to_arm()
self.arm_vehicle()
self.change_mode('AUTO')
command(mavutil.mavlink.MAV_CMD_MISSION_START)
self.wait_altitude(20, 1000, relative=True)
self.change_mode('RTL')
self.wait_disarmed()

def tests2b(self): # this block currently around 9.5mins here
'''return list of all tests'''
ret = ([
Expand Down Expand Up @@ -10206,6 +10223,7 @@ def tests2b(self): # this block currently around 9.5mins here
self.GroundEffectCompensation_touchDownExpected,
self.GroundEffectCompensation_takeOffExpected,
self.DO_CHANGE_SPEED,
self.MISSION_START,
self.AUTO_LAND_TO_BRAKE,
self.WPNAV_SPEED,
self.WPNAV_SPEED_UP,
Expand Down

0 comments on commit c352de2

Please sign in to comment.