Skip to content

Commit

Permalink
Tools: allow to use sim_vehicle.py without pymavlink installed
Browse files Browse the repository at this point in the history
  • Loading branch information
khancyr authored and tridge committed Sep 3, 2021
1 parent 13b0e30 commit 575c608
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Tools/autotest/sim_vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import binascii
import math

from pymavlink import mavextra
from pysim import vehicleinfo


Expand All @@ -38,6 +37,12 @@
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()


Expand Down

0 comments on commit 575c608

Please sign in to comment.