From f19be28e89fe172b2b5c9e2e69f9573876146175 Mon Sep 17 00:00:00 2001 From: Michael du Breuil Date: Mon, 30 Nov 2015 20:19:31 -0700 Subject: [PATCH] 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 --- Tools/autotest/sim_vehicle.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Tools/autotest/sim_vehicle.sh b/Tools/autotest/sim_vehicle.sh index fa652d3034..89ec56676c 100755 --- a/Tools/autotest/sim_vehicle.sh +++ b/Tools/autotest/sim_vehicle.sh @@ -27,6 +27,7 @@ EXTERNAL_SIM=0 MODEL="" BREAKPOINT="" OVERRIDE_BUILD_TARGET="" +DELAY_START=0 usage() { @@ -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 # 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 D) DEBUG_BUILD=1 ;; + d) + DELAY_START="$OPTARG" + ;; B) BREAKPOINT="$OPTARG" ;; @@ -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" $*