mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +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"
|
cd "$SCRIPT_DIR/jMAVSim"
|
||||||
|
|
||||||
udp_port=14560
|
udp_port=14560
|
||||||
while getopts ":p:" opt; do
|
extra_args=
|
||||||
|
baudrate=921600
|
||||||
|
device=
|
||||||
|
while getopts ":b:d:p:q" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
|
b)
|
||||||
|
baudrate=$OPTARG
|
||||||
|
;;
|
||||||
|
d)
|
||||||
|
device="$OPTARG"
|
||||||
|
;;
|
||||||
p)
|
p)
|
||||||
udp_port=$OPTARG
|
udp_port=$OPTARG
|
||||||
;;
|
;;
|
||||||
|
q)
|
||||||
|
extra_args="$extra_args -qgc"
|
||||||
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo "Invalid option: -$OPTARG" >&2
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
exit 1
|
exit 1
|
||||||
@@ -16,6 +28,12 @@ while getopts ":p:" opt; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ "$device" == "" ]; then
|
||||||
|
device="-udp 127.0.0.1:$udp_port"
|
||||||
|
else
|
||||||
|
device="-serial $device $baudrate"
|
||||||
|
fi
|
||||||
|
|
||||||
ant create_run_jar copy_res
|
ant create_run_jar copy_res
|
||||||
cd out/production
|
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