diff --git a/Tools/autotest/sim_vehicle.py b/Tools/autotest/sim_vehicle.py index 39301b0319a4a6..9c5e7fa5469354 100755 --- a/Tools/autotest/sim_vehicle.py +++ b/Tools/autotest/sim_vehicle.py @@ -28,7 +28,6 @@ import binascii import math -from pymavlink import mavextra from pysim import vehicleinfo @@ -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()