Tools: autotest: add sailboat autotest

This commit is contained in:
Iampete1 2021-04-11 02:28:49 +01:00 committed by Peter Barker
parent 67edff1c7c
commit 0628aa9e29
2 changed files with 56 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import ardusub
import antennatracker
import quadplane
import balancebot
import sailboat
import examples
from pysim import util
@ -298,6 +299,7 @@ __bin_names = {
"QuadPlane": "arduplane",
"Sub": "ardusub",
"BalanceBot": "ardurover",
"Sailboat": "ardurover",
"SITLPeriphGPS": "sitl_periph_gp.AP_Periph",
"CAN": "arducopter",
}
@ -364,6 +366,7 @@ tester_class_map = {
"test.QuadPlane": quadplane.AutoTestQuadPlane,
"test.Rover": rover.AutoTestRover,
"test.BalanceBot": balancebot.AutoTestBalanceBot,
"test.Sailboat": sailboat.AutoTestSailboat,
"test.Helicopter": arducopter.AutoTestHeli,
"test.Sub": ardusub.AutoTestSub,
"test.Tracker": antennatracker.AutoTestTracker,
@ -733,7 +736,7 @@ def run_tests(steps):
return passed
vehicle_list = ['Sub', 'Copter', 'Plane', 'Tracker', 'Rover', 'QuadPlane', 'BalanceBot', 'Helicopter']
vehicle_list = ['Sub', 'Copter', 'Plane', 'Tracker', 'Rover', 'QuadPlane', 'BalanceBot', 'Helicopter', 'Sailboat']
def list_subtests():
@ -958,6 +961,7 @@ if __name__ == "__main__":
'defaults.Rover',
'test.Rover',
'test.BalanceBot',
'test.Sailboat',
'build.Copter',
'defaults.Copter',

View File

@ -0,0 +1,51 @@
#!/usr/bin/env python
'''
Drive a Sailboat in SITL
AP_FLAKE8_CLEAN
'''
from __future__ import print_function
import os
from rover import AutoTestRover
# get location of scripts
testdir = os.path.dirname(os.path.realpath(__file__))
def log_name(self):
return "Sailboat"
class AutoTestSailboat(AutoTestRover):
def vehicleinfo_key(self):
return "Rover"
def init(self):
if self.frame is None:
self.frame = 'sailboat'
super(AutoTestSailboat, self).init()
def tests(self):
'''return list of all tests'''
ret = ([])
ret.extend([
("DriveRTL",
"Drive an RTL Mission",
self.drive_rtl_mission),
("DriveMission",
"Drive Mission %s" % "balancebot1.txt",
lambda: self.drive_mission("balancebot1.txt", strict=False)),
])
return ret
def default_mode(self):
return 'MANUAL'