From 90ea847cad4e501ce00f7a3dec2c176a0ffec8d8 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 14 Feb 2019 08:10:53 +1100 Subject: [PATCH] Tools: sim_vehicle.py: use gps functions from pymavlink rather than MAVProxy This should solve a problem on Windows where MAVProxy's libraries may not be generally available (packed into a .exe) --- Tools/autotest/sim_vehicle.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tools/autotest/sim_vehicle.py b/Tools/autotest/sim_vehicle.py index 941b2e14c6..3168312e76 100755 --- a/Tools/autotest/sim_vehicle.py +++ b/Tools/autotest/sim_vehicle.py @@ -22,7 +22,7 @@ import textwrap import time import shlex -from MAVProxy.modules.lib import mp_util +from pymavlink import mavextra from pysim import vehicleinfo # List of open terminal windows for macosx @@ -407,10 +407,10 @@ def find_new_spawn(loc, file_path): (instance, offset) = lines.split("=") if ((int)(instance) == (int)(cmd_opts.instance)): (x, y, z, head) = offset.split(",") - g = mp_util.gps_offset((float)(lat), (float)(lon), (float)(x), (float)(y)) + g = mavextra.gps_offset((float)(lat), (float)(lon), (float)(x), (float)(y)) loc = str(g[0])+","+str(g[1])+","+str(alt+z)+","+str(head) return loc - g = mp_util.gps_newpos((float)(lat), (float)(lon), 90, 20*(int)(cmd_opts.instance)) + g = mavextra.gps_newpos((float)(lat), (float)(lon), 90, 20*(int)(cmd_opts.instance)) loc = str(g[0])+","+str(g[1])+","+str(alt)+","+str(heading) return loc