diff --git a/Tools/autotest/autotest.py b/Tools/autotest/autotest.py index 7b9540308c..7356556603 100755 --- a/Tools/autotest/autotest.py +++ b/Tools/autotest/autotest.py @@ -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', diff --git a/Tools/autotest/sailboat.py b/Tools/autotest/sailboat.py new file mode 100644 index 0000000000..94672a1cc5 --- /dev/null +++ b/Tools/autotest/sailboat.py @@ -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'