SITL: examples: sitl-on-hw.sh add -m for more defaults

This commit is contained in:
Peter Barker 2022-08-22 15:03:07 +10:00 committed by Peter Barker
parent d7d7bb6e77
commit c0ae7fa5f6

View File

@ -15,11 +15,11 @@ DEFAULTS_PATH=""
EXTRA_HWDEF=""
usage() {
echo "Usage: $0 [-v <plane|copter>] [-d DEFAULT_FILEPATH] [-b BOARDNAME]" >&2;
echo "Usage: $0 [-v <plane|copter>] [-d DEFAULT_FILEPATH] [-b BOARDNAME] [-m APPEND_DEFAULTS_PATH" >&2;
exit 1;
}
while getopts ":v:d:b:" o; do
while getopts ":v:d:b:m:" o; do
case "${o}" in
v)
VEHICLE=${OPTARG}
@ -28,6 +28,9 @@ while getopts ":v:d:b:" o; do
d)
DEFAULTS_PATH=${OPTARG}
;;
m)
MORE_DEFAULTS_PATH=${OPTARG}
;;
b)
BOARD=${OPTARG}
;;
@ -48,6 +51,13 @@ if [ -z "${DEFAULTS_PATH}" ]; then
fi
fi
if [ ! -z "${MORE_DEFAULTS_PATH}" ]; then
NEW_DEFAULTS_PATH="/tmp/some-defaults.param"
cp "$DEFAULTS_PATH" "$NEW_DEFAULTS_PATH"
cat "$MORE_DEFAULTS_PATH" >> "$NEW_DEFAULTS_PATH"
DEFAULTS_PATH="$NEW_DEFAULTS_PATH"
fi
pushd $ROOTDIR
./waf configure \