mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
autotest: use FG_SCENERY for fgear scenery path
This commit is contained in:
parent
dd8593273f
commit
fdaa760aec
@ -157,10 +157,23 @@ def fly_ArduPlane(viewerip=None):
|
|||||||
'''
|
'''
|
||||||
global expect_list, homeloc
|
global expect_list, homeloc
|
||||||
|
|
||||||
sil = util.start_SIL('ArduPlane', wipe=True)
|
|
||||||
options = '--fgout=127.0.0.1:5502 --fgin=127.0.0.1:5501 --out=127.0.0.1:19550 --streamrate=5'
|
options = '--fgout=127.0.0.1:5502 --fgin=127.0.0.1:5501 --out=127.0.0.1:19550 --streamrate=5'
|
||||||
if viewerip:
|
if viewerip:
|
||||||
options += ' --out=%s:14550' % viewerip
|
options += ' --out=%s:14550' % viewerip
|
||||||
|
|
||||||
|
sil = util.start_SIL('ArduPlane', wipe=True)
|
||||||
|
mavproxy = util.start_MAVProxy_SIL('ArduPlane', options=options)
|
||||||
|
mavproxy.expect('Received [0-9]+ parameters')
|
||||||
|
|
||||||
|
# setup test parameters
|
||||||
|
mavproxy.send("param load %s/ArduPlane.parm\n" % testdir)
|
||||||
|
mavproxy.expect('Loaded [0-9]+ parameters')
|
||||||
|
|
||||||
|
# restart with new parms
|
||||||
|
util.pexpect_close(mavproxy)
|
||||||
|
util.pexpect_close(sil)
|
||||||
|
|
||||||
|
sil = util.start_SIL('ArduPlane')
|
||||||
mavproxy = util.start_MAVProxy_SIL('ArduPlane', options=options)
|
mavproxy = util.start_MAVProxy_SIL('ArduPlane', options=options)
|
||||||
mavproxy.expect('Logging to (\S+)')
|
mavproxy.expect('Logging to (\S+)')
|
||||||
logfile = mavproxy.match.group(1)
|
logfile = mavproxy.match.group(1)
|
||||||
@ -174,12 +187,12 @@ def fly_ArduPlane(viewerip=None):
|
|||||||
|
|
||||||
mavproxy.expect('Received [0-9]+ parameters')
|
mavproxy.expect('Received [0-9]+ parameters')
|
||||||
|
|
||||||
# setup test parameters
|
|
||||||
mavproxy.send("param load %s/ArduPlane.parm\n" % testdir)
|
|
||||||
mavproxy.expect('Loaded [0-9]+ parameters')
|
|
||||||
|
|
||||||
util.expect_setup_callback(mavproxy, expect_callback)
|
util.expect_setup_callback(mavproxy, expect_callback)
|
||||||
|
|
||||||
|
fg_scenery = os.getenv("FG_SCENERY")
|
||||||
|
if not fg_scenery:
|
||||||
|
raise RuntimeError("You must set the FG_SCENERY environment variable")
|
||||||
|
|
||||||
fgear_options = '''
|
fgear_options = '''
|
||||||
--generic=socket,in,25,,5502,udp,MAVLink \
|
--generic=socket,in,25,,5502,udp,MAVLink \
|
||||||
--generic=socket,out,50,,5501,udp,MAVLink \
|
--generic=socket,out,50,,5501,udp,MAVLink \
|
||||||
@ -210,10 +223,10 @@ def fly_ArduPlane(viewerip=None):
|
|||||||
--fog-disable \
|
--fog-disable \
|
||||||
--disable-specular-highlight \
|
--disable-specular-highlight \
|
||||||
--disable-skyblend \
|
--disable-skyblend \
|
||||||
--fg-scenery="/home/tridge/project/UAV/fgdata/Scenery" \
|
--fg-scenery=%s \
|
||||||
--disable-anti-alias-hud \
|
--disable-anti-alias-hud \
|
||||||
--wind=0@0 \
|
--wind=0@0 \
|
||||||
'''
|
''' % fg_scenery
|
||||||
# start fgear
|
# start fgear
|
||||||
if os.getenv('DISPLAY'):
|
if os.getenv('DISPLAY'):
|
||||||
cmd = 'fgfs %s' % fgear_options
|
cmd = 'fgfs %s' % fgear_options
|
||||||
@ -224,6 +237,7 @@ def fly_ArduPlane(viewerip=None):
|
|||||||
fgear = pexpect.spawn(cmd, logfile=sys.stdout, timeout=10)
|
fgear = pexpect.spawn(cmd, logfile=sys.stdout, timeout=10)
|
||||||
fgear.xvfb_server_num = 42
|
fgear.xvfb_server_num = 42
|
||||||
util.pexpect_autoclose(fgear)
|
util.pexpect_autoclose(fgear)
|
||||||
|
fgear.expect('creating 3D noise', timeout=30)
|
||||||
|
|
||||||
expect_list.extend([fgear, sil, mavproxy])
|
expect_list.extend([fgear, sil, mavproxy])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user