mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
Tools: autotest: add sailboat autotest
This commit is contained in:
parent
67edff1c7c
commit
0628aa9e29
@ -27,6 +27,7 @@ import ardusub
|
|||||||
import antennatracker
|
import antennatracker
|
||||||
import quadplane
|
import quadplane
|
||||||
import balancebot
|
import balancebot
|
||||||
|
import sailboat
|
||||||
|
|
||||||
import examples
|
import examples
|
||||||
from pysim import util
|
from pysim import util
|
||||||
@ -298,6 +299,7 @@ __bin_names = {
|
|||||||
"QuadPlane": "arduplane",
|
"QuadPlane": "arduplane",
|
||||||
"Sub": "ardusub",
|
"Sub": "ardusub",
|
||||||
"BalanceBot": "ardurover",
|
"BalanceBot": "ardurover",
|
||||||
|
"Sailboat": "ardurover",
|
||||||
"SITLPeriphGPS": "sitl_periph_gp.AP_Periph",
|
"SITLPeriphGPS": "sitl_periph_gp.AP_Periph",
|
||||||
"CAN": "arducopter",
|
"CAN": "arducopter",
|
||||||
}
|
}
|
||||||
@ -364,6 +366,7 @@ tester_class_map = {
|
|||||||
"test.QuadPlane": quadplane.AutoTestQuadPlane,
|
"test.QuadPlane": quadplane.AutoTestQuadPlane,
|
||||||
"test.Rover": rover.AutoTestRover,
|
"test.Rover": rover.AutoTestRover,
|
||||||
"test.BalanceBot": balancebot.AutoTestBalanceBot,
|
"test.BalanceBot": balancebot.AutoTestBalanceBot,
|
||||||
|
"test.Sailboat": sailboat.AutoTestSailboat,
|
||||||
"test.Helicopter": arducopter.AutoTestHeli,
|
"test.Helicopter": arducopter.AutoTestHeli,
|
||||||
"test.Sub": ardusub.AutoTestSub,
|
"test.Sub": ardusub.AutoTestSub,
|
||||||
"test.Tracker": antennatracker.AutoTestTracker,
|
"test.Tracker": antennatracker.AutoTestTracker,
|
||||||
@ -733,7 +736,7 @@ def run_tests(steps):
|
|||||||
return passed
|
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():
|
def list_subtests():
|
||||||
@ -958,6 +961,7 @@ if __name__ == "__main__":
|
|||||||
'defaults.Rover',
|
'defaults.Rover',
|
||||||
'test.Rover',
|
'test.Rover',
|
||||||
'test.BalanceBot',
|
'test.BalanceBot',
|
||||||
|
'test.Sailboat',
|
||||||
|
|
||||||
'build.Copter',
|
'build.Copter',
|
||||||
'defaults.Copter',
|
'defaults.Copter',
|
||||||
|
51
Tools/autotest/sailboat.py
Normal file
51
Tools/autotest/sailboat.py
Normal 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'
|
Loading…
Reference in New Issue
Block a user