2018-09-13 09:49:56 -03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
2016-06-14 06:03:37 -03:00
|
|
|
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
cd "$SCRIPT_DIR/jMAVSim"
|
|
|
|
|
2018-11-13 10:22:35 -04:00
|
|
|
tcp_port=4560
|
2016-10-20 11:50:35 -03:00
|
|
|
extra_args=
|
|
|
|
baudrate=921600
|
|
|
|
device=
|
2017-03-09 06:12:48 -04:00
|
|
|
ip="127.0.0.1"
|
2020-01-13 11:09:40 -04:00
|
|
|
while getopts ":b:d:p:qsr:f:i:lo" opt; do
|
2016-09-19 15:09:12 -03:00
|
|
|
case $opt in
|
2016-10-20 11:50:35 -03:00
|
|
|
b)
|
|
|
|
baudrate=$OPTARG
|
|
|
|
;;
|
|
|
|
d)
|
|
|
|
device="$OPTARG"
|
|
|
|
;;
|
2017-03-09 06:12:48 -04:00
|
|
|
i)
|
|
|
|
ip="$OPTARG"
|
|
|
|
;;
|
2016-09-19 15:09:12 -03:00
|
|
|
p)
|
2018-11-13 10:22:35 -04:00
|
|
|
tcp_port=$OPTARG
|
2016-09-19 15:09:12 -03:00
|
|
|
;;
|
2016-10-20 11:50:35 -03:00
|
|
|
q)
|
|
|
|
extra_args="$extra_args -qgc"
|
|
|
|
;;
|
2019-05-09 04:41:06 -03:00
|
|
|
s)
|
|
|
|
extra_args="$extra_args -sdk"
|
|
|
|
;;
|
2017-03-03 12:42:41 -04:00
|
|
|
r)
|
|
|
|
extra_args="$extra_args -r $OPTARG"
|
|
|
|
;;
|
2019-03-15 04:13:03 -03:00
|
|
|
l)
|
|
|
|
extra_args="$extra_args -lockstep"
|
|
|
|
;;
|
2020-01-13 11:09:40 -04:00
|
|
|
o)
|
|
|
|
extra_args="$extra_args -disponly"
|
|
|
|
;;
|
2016-09-19 15:09:12 -03:00
|
|
|
\?)
|
|
|
|
echo "Invalid option: -$OPTARG" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2016-10-20 11:50:35 -03:00
|
|
|
if [ "$device" == "" ]; then
|
2018-11-13 10:22:35 -04:00
|
|
|
device="-tcp $ip:$tcp_port"
|
2016-10-20 11:50:35 -03:00
|
|
|
else
|
|
|
|
device="-serial $device $baudrate"
|
|
|
|
fi
|
|
|
|
|
2019-08-22 12:29:46 -03:00
|
|
|
if [ "$HEADLESS" = "1" ]; then
|
2019-11-01 20:17:50 -03:00
|
|
|
extra_args="$extra_args -no-gui"
|
2019-08-22 12:29:46 -03:00
|
|
|
fi
|
|
|
|
|
2016-06-14 06:03:37 -03:00
|
|
|
ant create_run_jar copy_res
|
|
|
|
cd out/production
|
2017-10-26 10:02:20 -03:00
|
|
|
|
2020-05-07 04:03:54 -03:00
|
|
|
java -XX:GCTimeRatio=20 -Djava.ext.dirs= -jar jmavsim_run.jar $device $extra_args
|