autotest: support -P2 option for SITL with MAVLink2

This commit is contained in:
Andrew Tridgell 2016-01-12 09:20:22 +11:00
parent 74121fdaeb
commit 511ca6d764

View File

@ -29,6 +29,7 @@ BREAKPOINT=""
OVERRIDE_BUILD_TARGET=""
DELAY_START=0
DEFAULTS_PATH=""
MAVLINK_PROTOCOL_VERSION="1"
usage()
{
@ -61,6 +62,7 @@ Options:
-H start HIL
-S SPEEDUP set simulation speedup (1 for wall clock time)
-d TIME delays the start of mavproxy by the number of seconds
-P VERSION mavlink protocol version (1 or 2)
mavproxy_options:
--map start with a map
@ -77,7 +79,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:d:" opt; do
while getopts ":I:VgGcj:TA:t:L:l:v:hwf:RNHeMS:DB:b:d:P:" opt; do
case $opt in
v)
VEHICLE=$OPTARG
@ -150,6 +152,9 @@ while getopts ":I:VgGcj:TA:t:L:l:v:hwf:RNHeMS:DB:b:d:" opt; do
b)
OVERRIDE_BUILD_TARGET="$OPTARG"
;;
P)
MAVLINK_PROTOCOL_VERSION="$OPTARG"
;;
h)
usage
exit 0
@ -348,6 +353,10 @@ if [ $DEBUG_BUILD == 1 ]; then
BUILD_TARGET="$BUILD_TARGET-debug"
fi
if [ $MAVLINK_PROTOCOL_VERSION == "2" ]; then
BUILD_TARGET="$BUILD_TARGET-mavlink2"
fi
if [ -n "$OVERRIDE_BUILD_TARGET" ]; then
BUILD_TARGET="$OVERRIDE_BUILD_TARGET"
fi
@ -491,6 +500,10 @@ if [ $DELAY_START != 0 ]; then
sleep $DELAY_START
fi
if [ $MAVLINK_PROTOCOL_VERSION == 2 ]; then
options="$options --mav20"
fi
if [ -f /usr/bin/cygstart ]; then
cygstart -w "/cygdrive/c/Program Files (x86)/MAVProxy/mavproxy.exe" $options --cmd="$extra_cmd" $*
else