mirror of https://github.com/ArduPilot/ardupilot
Tools: autotest: add simple Rally test
This commit is contained in:
parent
e75dccfc71
commit
a117e4571d
|
@ -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"),
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue