Skip to content

Commit

Permalink
Tools: add InterActTest to show interaction with automated setup
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Oct 5, 2023
1 parent 46bec27 commit c5e12eb
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Tools/autotest/arduplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -4983,6 +4983,38 @@ def MAV_CMD_DO_LAND_START(self):

self.fly_home_land_and_disarm()

def start_flying_simple_rehome_mission(self, items):
'''uploads items, changes mode to auto, waits ready to arm and arms
vehicle. If the first item it a takeoff you can expect the
vehicle to fly after this method returns
'''

self.upload_simple_relhome_mission(items)

self.change_mode('AUTO')
self.wait_ready_to_arm()

self.arm_vehicle()

def InteractTest(self):
'''just takeoff'''

if self.mavproxy is None:
raise NotAchievedException("Must be started with --map")

self.start_flying_simple_rehome_mission([
(mavutil.mavlink.MAV_CMD_NAV_TAKEOFF, 0, 0, 30),
(mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 800, 0, 0),
(mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 800, 800, 0),
(mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 0, 400, 0),
])

self.wait_current_waypoint(4)

self.set_parameter('SIM_SPEEDUP', 1)

self.mavproxy.interact()

def tests(self):
'''return list of all tests'''
ret = super(AutoTestPlane, self).tests()
Expand Down Expand Up @@ -5081,10 +5113,12 @@ def tests(self):
self.MAV_CMD_DO_GO_AROUND,
self.MAV_CMD_DO_FLIGHTTERMINATION,
self.MAV_CMD_DO_LAND_START,
self.InteractTest,
])
return ret

def disabled_tests(self):
return {
"LandingDrift": "Flapping test. See https://github.com/ArduPilot/ardupilot/issues/20054",
"InteractTest": "requires user interaction",
}

0 comments on commit c5e12eb

Please sign in to comment.