Skip to content

Commit 458ddcd

Browse files
committed
autotest:add test for autoland mode
1 parent 5b77cca commit 458ddcd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Tools/autotest/arduplane.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4201,6 +4201,20 @@ def FlyEachFrame(self):
42014201
self.fly_mission(mission_file, strict=False, quadplane=quadplane, mission_timeout=400.0)
42024202
self.wait_disarmed()
42034203

4204+
def AutoLandMode(self):
4205+
'''Test AUTOLAND mode'''
4206+
self.customise_SITL_commandline(["--home", "-35.362938,149.165085,585,173"])
4207+
self.context_collect('STATUSTEXT')
4208+
self.takeoff(alt=80, mode='TAKEOFF')
4209+
self.wait_text("Takeoff initial direction", check_context=True)
4210+
self.change_mode(26)
4211+
self.wait_disarmed(120)
4212+
self.progress("Check the landed heading matches takeoff")
4213+
self.wait_heading(173, accuracy=5, timeout=1)
4214+
loc = mavutil.location(-35.362938, 149.165085, 585, 173)
4215+
if self.get_distance(loc, self.mav.location()) > 35:
4216+
raise NotAchievedException("Did not land close to home")
4217+
42044218
def RCDisableAirspeedUse(self):
42054219
'''Test RC DisableAirspeedUse option'''
42064220
self.set_parameter("RC9_OPTION", 106)
@@ -6548,6 +6562,7 @@ def tests1b(self):
65486562
self.MAV_CMD_DO_AUX_FUNCTION,
65496563
self.SmartBattery,
65506564
self.FlyEachFrame,
6565+
self.AutoLandMode,
65516566
self.RCDisableAirspeedUse,
65526567
self.AHRS_ORIENTATION,
65536568
self.AHRSTrim,

0 commit comments

Comments
 (0)