From 7b0046e75e7746321e565fa7c83bca2eada61c3e Mon Sep 17 00:00:00 2001 From: Kristian Klausen Date: Wed, 10 Sep 2014 18:50:48 +0200 Subject: [PATCH] Tools/autotest/sim_vehicle.sh: Added option to run the sim_vehicle framework with an external simulator --- Tools/autotest/sim_vehicle.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Tools/autotest/sim_vehicle.sh b/Tools/autotest/sim_vehicle.sh index 6d77c9db49..8c80118405 100755 --- a/Tools/autotest/sim_vehicle.sh +++ b/Tools/autotest/sim_vehicle.sh @@ -20,6 +20,7 @@ REVERSE_THROTTLE=0 NO_REBUILD=0 START_HIL=0 TRACKER_ARGS="" +EXTERNAL_SIM=0 usage() { @@ -45,6 +46,7 @@ Options: for planes can choose elevon or vtail -j NUM_PROC number of processors to use during build (default 1) -H start HIL + -e use external simulator mavproxy_options: --map start with a map @@ -61,7 +63,7 @@ EOF # parse options. Thanks to http://wiki.bash-hackers.org/howto/getopts_tutorial -while getopts ":I:VgGcj:TA:t:L:v:hwf:RNH" opt; do +while getopts ":I:VgGcj:TA:t:L:v:hwf:RNHe" opt; do case $opt in v) VEHICLE=$OPTARG @@ -113,6 +115,9 @@ while getopts ":I:VgGcj:TA:t:L:v:hwf:RNH" opt; do w) WIPE_EEPROM=1 ;; + e) + EXTERNAL_SIM=1 + ;; h) usage exit 0 @@ -302,11 +307,15 @@ trap kill_tasks SIGINT sleep 2 rm -f $tfile -$autotest/run_in_terminal_window.sh "Simulator" $RUNSIM || { - echo "Failed to start simulator: $RUNSIM" - exit 1 -} -sleep 2 +if [ $EXTERNAL_SIM == 0 ]; then + $autotest/run_in_terminal_window.sh "Simulator" $RUNSIM || { + echo "Failed to start simulator: $RUNSIM" + exit 1 + } + sleep 2 +else + echo "Using external simulator" +fi # mavproxy.py --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --out 127.0.0.1:14550 --out 127.0.0.1:14551 options=""