mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-11 17:13:56 -03:00
Tools: sim_vehicle: add local mavproxy modules path to PYTHONPATH
That's helpful for users that don't have that in their PYTHONPATH environment variable and want to load a local module.
This commit is contained in:
parent
ede0360ee1
commit
41f5602fea
@ -8,6 +8,7 @@ import optparse
|
||||
import sys
|
||||
import atexit
|
||||
import os
|
||||
import os.path
|
||||
import subprocess
|
||||
import tempfile
|
||||
import getpass
|
||||
@ -618,7 +619,12 @@ def start_mavproxy(opts, stuff):
|
||||
if len(extra_cmd):
|
||||
cmd.extend(['--cmd', extra_cmd])
|
||||
|
||||
run_cmd_blocking("Run MavProxy", cmd)
|
||||
local_mp_modules_dir = os.path.abspath(
|
||||
os.path.join(__file__, '..', '..', 'mavproxy_modules'))
|
||||
env = dict(os.environ)
|
||||
env['PYTHONPATH'] = local_mp_modules_dir + os.pathsep + env.get('PYTHONPATH', '')
|
||||
|
||||
run_cmd_blocking("Run MavProxy", cmd, env=env)
|
||||
progress("MAVProxy exitted")
|
||||
|
||||
frame_options = options_for_frame(opts.frame, opts.vehicle, opts)
|
||||
|
Loading…
Reference in New Issue
Block a user