mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-22 22:32:11 +08:00
jmavsim_run.sh: add additional arguments for HITL
This commit is contained in:
+20
-2
@@ -4,11 +4,23 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
cd "$SCRIPT_DIR/jMAVSim"
|
||||
|
||||
udp_port=14560
|
||||
while getopts ":p:" opt; do
|
||||
extra_args=
|
||||
baudrate=921600
|
||||
device=
|
||||
while getopts ":b:d:p:q" opt; do
|
||||
case $opt in
|
||||
b)
|
||||
baudrate=$OPTARG
|
||||
;;
|
||||
d)
|
||||
device="$OPTARG"
|
||||
;;
|
||||
p)
|
||||
udp_port=$OPTARG
|
||||
;;
|
||||
q)
|
||||
extra_args="$extra_args -qgc"
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
@@ -16,6 +28,12 @@ while getopts ":p:" opt; do
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$device" == "" ]; then
|
||||
device="-udp 127.0.0.1:$udp_port"
|
||||
else
|
||||
device="-serial $device $baudrate"
|
||||
fi
|
||||
|
||||
ant create_run_jar copy_res
|
||||
cd out/production
|
||||
java -Djava.ext.dirs= -jar jmavsim_run.jar -udp 127.0.0.1:$udp_port
|
||||
java -Djava.ext.dirs= -jar jmavsim_run.jar $device $extra_args
|
||||
|
||||
Reference in New Issue
Block a user