From e7afecb544b5921e719c9a3acabb13009cd340d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Tue, 14 Jun 2016 11:03:37 +0200 Subject: [PATCH] Tools: add separate jmavsim_run.sh script It is useful to run jmavsim separately, for example when debugging mainapp separately, or running some other external tool on mainapp (like heap analysis) --- Tools/jmavsim_run.sh | 8 ++++++++ Tools/sitl_run.sh | 6 ++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100755 Tools/jmavsim_run.sh diff --git a/Tools/jmavsim_run.sh b/Tools/jmavsim_run.sh new file mode 100755 index 0000000000..4c853b0953 --- /dev/null +++ b/Tools/jmavsim_run.sh @@ -0,0 +1,8 @@ +#! /bin/bash + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "$SCRIPT_DIR/jMAVSim" + +ant create_run_jar copy_res +cd out/production +java -Djava.ext.dirs= -jar jmavsim_run.jar -udp 127.0.0.1:14560 diff --git a/Tools/sitl_run.sh b/Tools/sitl_run.sh index e887db4375..dc0123edde 100755 --- a/Tools/sitl_run.sh +++ b/Tools/sitl_run.sh @@ -64,10 +64,7 @@ SIM_PID=0 if [ "$program" == "jmavsim" ] && [ ! -n "$no_sim" ] then - cd $src_path/Tools/jMAVSim - ant create_run_jar copy_res - cd out/production - java -Djava.ext.dirs= -jar jmavsim_run.jar -udp 127.0.0.1:14560 & + ./Tools/jmavsim_run.sh & SIM_PID=`echo $!` cd ../.. elif [ "$program" == "gazebo" ] && [ ! -n "$no_sim" ] @@ -135,6 +132,7 @@ fi if [ "$program" == "jmavsim" ] then + pkill -9 -P $SIM_PID kill -9 $SIM_PID elif [ "$program" == "gazebo" ] then