Browse Source

autotest: allow delaying the mavproxy instance in SITL

This useful when using X forwarding, as mavproxy can start to quickly, and then break the sim enviorment. If the argument isn't used there is no change in behaviour
master
Michael du Breuil 9 years ago committed by Andrew Tridgell
parent
commit
f19be28e89
  1. 10
      Tools/autotest/sim_vehicle.sh

10
Tools/autotest/sim_vehicle.sh

@ -27,6 +27,7 @@ EXTERNAL_SIM=0 @@ -27,6 +27,7 @@ EXTERNAL_SIM=0
MODEL=""
BREAKPOINT=""
OVERRIDE_BUILD_TARGET=""
DELAY_START=0
usage()
{
@ -59,6 +60,7 @@ Options: @@ -59,6 +60,7 @@ Options:
-H start HIL
-e use external simulator
-S SPEEDUP set simulation speedup (1 for wall clock time)
-d TIME delays the start of mavproxy by the number of seconds
mavproxy_options:
--map start with a map
@ -75,7 +77,7 @@ EOF @@ -75,7 +77,7 @@ EOF
# parse options. Thanks to http://wiki.bash-hackers.org/howto/getopts_tutorial
while getopts ":I:VgGcj:TA:t:L:l:v:hwf:RNHeMS:DB:b:" opt; do
while getopts ":I:VgGcj:TA:t:L:l:v:hwf:RNHeMS:DB:b:d:" opt; do
case $opt in
v)
VEHICLE=$OPTARG
@ -108,6 +110,9 @@ while getopts ":I:VgGcj:TA:t:L:l:v:hwf:RNHeMS:DB:b:" opt; do @@ -108,6 +110,9 @@ while getopts ":I:VgGcj:TA:t:L:l:v:hwf:RNHeMS:DB:b:" opt; do
D)
DEBUG_BUILD=1
;;
d)
DELAY_START="$OPTARG"
;;
B)
BREAKPOINT="$OPTARG"
;;
@ -447,6 +452,9 @@ fi @@ -447,6 +452,9 @@ fi
if [ $USE_MAVLINK_GIMBAL == 1 ]; then
options="$options --load-module=gimbal"
fi
if [ $DELAY_START != 0 ]; then
sleep $DELAY_START
fi
if [ -f /usr/bin/cygstart ]; then
cygstart -w "/cygdrive/c/Program Files (x86)/MAVProxy/mavproxy.exe" $options --cmd="$extra_cmd" $*

Loading…
Cancel
Save