Exit simulator

This commit is contained in:
Lorenz Meier
2015-10-23 23:58:28 +02:00
parent bf09c46c2f
commit 292b87fe2c
+13
View File
@@ -1,17 +1,22 @@
#!/bin/bash #!/bin/bash
cp Tools/posix_lldbinit build_posix_sitl_simple/src/firmware/posix/.lldbinit cp Tools/posix_lldbinit build_posix_sitl_simple/src/firmware/posix/.lldbinit
cp Tools/posix.gdbinit build_posix_sitl_simple/src/firmware/posix/.gdbinit cp Tools/posix.gdbinit build_posix_sitl_simple/src/firmware/posix/.gdbinit
SIM_PID=0
if [ "$3" == "jmavsim" ] if [ "$3" == "jmavsim" ]
then then
cd Tools/jMAVSim cd Tools/jMAVSim
ant ant
java -Djava.ext.dirs= -cp lib/*:out/production/jmavsim.jar me.drton.jmavsim.Simulator -udp 127.0.0.1:14560 & java -Djava.ext.dirs= -cp lib/*:out/production/jmavsim.jar me.drton.jmavsim.Simulator -udp 127.0.0.1:14560 &
SIM_PID=echo $!
cd ../.. cd ../..
elif [ "$3" == "gazebo" ] elif [ "$3" == "gazebo" ]
then then
if [ -x "$(command -v gazebo)" ] if [ -x "$(command -v gazebo)" ]
then then
gazebo ${SITL_GAZEBO_PATH}/worlds/iris.world & gazebo ${SITL_GAZEBO_PATH}/worlds/iris.world &
SIM_PID=echo $!
else else
echo "You need to have gazebo simulator installed!" echo "You need to have gazebo simulator installed!"
exit 1 exit 1
@@ -31,3 +36,11 @@ then
else else
./mainapp ../../../../$1 ./mainapp ../../../../$1
fi fi
if [ "$3" == "jmavsim" ]
then
kill -9 $SIM_PID
elif [ "$3" == "gazebo" ]
then
kill -9 $SIM_PID
fi