autotest: use builtin JSBSim support for plane testing

This commit is contained in:
Andrew Tridgell 2015-05-11 08:06:31 +10:00
parent bab94c8a04
commit aaff670ec4
2 changed files with 5 additions and 21 deletions

View File

@ -440,17 +440,7 @@ def fly_ArduPlane(viewerip=None, map=False):
if map:
options += ' --map'
cmd = util.reltopdir("Tools/autotest/jsb_sim/runsim.py")
cmd += " --speedup=100 --home=%s --wind=%s" % (HOME_LOCATION, WIND)
if viewerip:
cmd += " --fgout=%s:5503" % viewerip
runsim = pexpect.spawn(cmd, timeout=10)
runsim.delaybeforesend = 0
util.pexpect_autoclose(runsim)
runsim.expect('Simulator ready to fly')
sil = util.start_SIL('ArduPlane', wipe=True)
sil = util.start_SIL('ArduPlane', wipe=True, model='jsbsim', home=HOME_LOCATION, speedup=10)
print("Starting MAVProxy")
mavproxy = util.start_MAVProxy_SIL('ArduPlane', options=options)
util.expect_setup_callback(mavproxy, expect_callback)
@ -467,14 +457,8 @@ def fly_ArduPlane(viewerip=None, map=False):
# restart with new parms
util.pexpect_close(mavproxy)
util.pexpect_close(sil)
util.pexpect_close(runsim)
runsim = pexpect.spawn(cmd, logfile=sys.stdout, timeout=10)
runsim.delaybeforesend = 0
util.pexpect_autoclose(runsim)
runsim.expect('Simulator ready to fly')
sil = util.start_SIL('ArduPlane')
sil = util.start_SIL('ArduPlane', model='jsbsim', home=HOME_LOCATION, speedup=10)
mavproxy = util.start_MAVProxy_SIL('ArduPlane', options=options)
mavproxy.expect('Logging to (\S+)')
logfile = mavproxy.match.group(1)
@ -494,7 +478,7 @@ def fly_ArduPlane(viewerip=None, map=False):
mavproxy.expect('Received [0-9]+ parameters')
expect_list_clear()
expect_list_extend([runsim, sil, mavproxy])
expect_list_extend([sil, mavproxy])
print("Started simulator")
@ -568,7 +552,6 @@ def fly_ArduPlane(viewerip=None, map=False):
mav.close()
util.pexpect_close(mavproxy)
util.pexpect_close(sil)
util.pexpect_close(runsim)
if os.path.exists('ArduPlane-valgrind.log'):
os.chmod('ArduPlane-valgrind.log', 0644)

View File

@ -257,6 +257,7 @@ pushd $autotest/../../$VEHICLE || {
usage
exit 1
}
VEHICLEDIR=$(pwd)
if [ ! -f $autotest/../../config.mk ]; then
echo Generating a default configuration
make configure
@ -313,7 +314,7 @@ if [ $START_ANTENNA_TRACKER == 1 ]; then
popd
fi
cmd="/tmp/$VEHICLE.build/$VEHICLE.elf -S -I$INSTANCE --home $SIMHOME"
cmd="$VEHICLEDIR/$VEHICLE.elf -S -I$INSTANCE --home $SIMHOME"
if [ $WIPE_EEPROM == 1 ]; then
cmd="$cmd -w"
fi