mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
Tools: allow to use sim_vehicle.py without pymavlink installed
This commit is contained in:
parent
13b0e3091d
commit
575c608688
@ -28,7 +28,6 @@ import shlex
|
||||
import binascii
|
||||
import math
|
||||
|
||||
from pymavlink import mavextra
|
||||
from pysim import vehicleinfo
|
||||
|
||||
|
||||
@ -38,6 +37,12 @@ windowID = []
|
||||
autotest_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
root_dir = os.path.realpath(os.path.join(autotest_dir, '../..'))
|
||||
|
||||
try:
|
||||
from pymavlink import mavextra
|
||||
except ImportError:
|
||||
sys.path.append(os.path.join(root_dir, "modules/mavlink"))
|
||||
from pymavlink import mavextra
|
||||
|
||||
os.environ["SIM_VEHICLE_SESSION"] = binascii.hexlify(os.urandom(8)).decode()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user