mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-05 06:41:36 +08:00
Exit simulator
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user