2016-06-14 06:03:37 -03:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
cd "$SCRIPT_DIR/jMAVSim"
|
|
|
|
|
2016-09-19 15:09:12 -03:00
|
|
|
udp_port=14560
|
2016-10-20 11:50:35 -03:00
|
|
|
extra_args=
|
|
|
|
baudrate=921600
|
|
|
|
device=
|
|
|
|
while getopts ":b:d:p:q" 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"
|
|
|
|
;;
|
2016-09-19 15:09:12 -03:00
|
|
|
p)
|
|
|
|
udp_port=$OPTARG
|
|
|
|
;;
|
2016-10-20 11:50:35 -03:00
|
|
|
q)
|
|
|
|
extra_args="$extra_args -qgc"
|
|
|
|
;;
|
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
|
|
|
|
device="-udp 127.0.0.1:$udp_port"
|
|
|
|
else
|
|
|
|
device="-serial $device $baudrate"
|
|
|
|
fi
|
|
|
|
|
2016-06-14 06:03:37 -03:00
|
|
|
ant create_run_jar copy_res
|
|
|
|
cd out/production
|
2016-10-20 11:50:35 -03:00
|
|
|
java -Djava.ext.dirs= -jar jmavsim_run.jar $device $extra_args
|