From abd5daccbbd3b35a8dc97b3745782623129890c7 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 30 Sep 2021 13:16:32 +1000 Subject: [PATCH] autotest: augment HIGH_LATENCY2 test with location test --- Tools/autotest/common.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index 2a2e372a31..91c4e2489f 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -2484,6 +2484,17 @@ class AutoTest(ABC): if (m.failure_flags & mavutil.mavlink.HL_FAILURE_FLAG_GPS) == 0: raise NotAchievedException("Expected GPS to be failed") + self.start_subtest("HIGH_LATENCY2 location") + self.set_parameter("SIM_GPS_TYPE", 1) + self.delay_sim_time(10) + m = self.poll_message("HIGH_LATENCY2") + mavutil.dump_message_verbose(sys.stdout, m) + loc = mavutil.location(m.latitude, m.longitude, m.altitude, 0) + dist = self.get_distance_accurate(loc, self.sim_location_int()) + + if dist > 1: + raise NotAchievedException("Bad location from HIGH_LATENCY2") + def test_log_download(self): if self.is_tracker(): # tracker starts armed, which is annoying