From ef18e9bc84fbcf722ff2e184eb037a12d05e5b57 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 20 Nov 2024 12:19:42 +1100 Subject: [PATCH] autotest: add offset_location_heading_distance --- Tools/autotest/vehicle_test_suite.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Tools/autotest/vehicle_test_suite.py b/Tools/autotest/vehicle_test_suite.py index 7302b78506..7767ab811c 100644 --- a/Tools/autotest/vehicle_test_suite.py +++ b/Tools/autotest/vehicle_test_suite.py @@ -9428,6 +9428,20 @@ Also, ignores heartbeats not from our target system''' location.alt, location.heading) + def offset_location_heading_distance(self, location, bearing, distance): + (target_lat, target_lng) = mavextra.gps_newpos( + location.lat, + location.lng, + bearing, + distance + ) + return mavutil.location( + target_lat, + target_lng, + location.alt, + location.heading + ) + def monitor_groundspeed(self, want, tolerance=0.5, timeout=5): tstart = self.get_sim_time() while True: