Tools: autotest: add simple Rally test

This commit is contained in:
Peter Barker 2019-02-19 08:50:27 +11:00 committed by Peter Barker
parent e75dccfc71
commit a117e4571d
3 changed files with 30 additions and 0 deletions

View File

@ -906,6 +906,23 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm)
if ex is not None:
raise ex
def test_rally_points(self):
self.load_rally("rover-test-rally.txt")
self.wait_ready_to_arm()
self.arm_vehicle()
self.reach_heading_manual(10)
self.reach_distance_manual(50)
self.change_mode("RTL")
# location copied in from rover-test-rally.txt:
loc = mavutil.location(40.071553,
-105.229401,
0,
0)
self.wait_location(loc)
self.disarm_vehicle()
def tests(self):
'''return list of all tests'''
ret = super(AutoTestRover, self).tests()
@ -992,6 +1009,10 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm)
"Test enforcement of SYSID_MYGCS",
self.test_sysid_enforce),
("Rally",
"Test Rally Points",
self.test_rally_points),
("DownLoadLogs", "Download logs", lambda:
self.log_download(
self.buildlogs_path("APMrover2-log.bin"),

View File

@ -568,6 +568,13 @@ class AutoTest(ABC):
raise ValueError("count %u not handled" % count)
self.progress("Files same")
def load_rally(self, filename):
"""Load rally points from a file to flight controller."""
self.progress("Loading rally points (%s)" % filename)
path = os.path.join(self.mission_directory(), filename)
self.mavproxy.send('rally load %s\n' % path)
self.mavproxy.expect("Loaded")
def load_mission(self, filename):
"""Load a mission from a file to flight controller."""
self.progress("Loading mission (%s)" % filename)

View File

@ -0,0 +1,2 @@
RALLY 40.071553 -105.229401 0.000000 40.000000 0.000000 0
RALLY 40.072265 -105.231136 0.000000 40.000000 0.000000 0