mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-05 07:28:29 -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 binascii
|
||||||
import math
|
import math
|
||||||
|
|
||||||
from pymavlink import mavextra
|
|
||||||
from pysim import vehicleinfo
|
from pysim import vehicleinfo
|
||||||
|
|
||||||
|
|
||||||
@ -38,6 +37,12 @@ windowID = []
|
|||||||
autotest_dir = os.path.dirname(os.path.realpath(__file__))
|
autotest_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
root_dir = os.path.realpath(os.path.join(autotest_dir, '../..'))
|
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()
|
os.environ["SIM_VEHICLE_SESSION"] = binascii.hexlify(os.urandom(8)).decode()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user