autotest: add offset_location_heading_distance

This commit is contained in:
Peter Barker 2024-11-20 12:19:42 +11:00 committed by Andrew Tridgell
parent c6d05844dd
commit 52e5d2dcb4
1 changed files with 14 additions and 0 deletions

View File

@ -9427,6 +9427,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: