diff --git a/aerial_robot_base/scripts/gazebo_shutdown.py b/aerial_robot_base/scripts/gazebo_shutdown.py new file mode 100755 index 000000000..ffd6206a9 --- /dev/null +++ b/aerial_robot_base/scripts/gazebo_shutdown.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +# Code courtsy of Sihoj and cosmicog on Github +# https://github.com/Sihoj +# https://github.com/cosmicog + + +import sys, signal, subprocess, time + + +timeout_before_kill = 0.1 # [s] +timeout_after_kill = 0.1 # [s] + + +def signal_handler(sig, frame): + time.sleep(timeout_before_kill) + subprocess.call("killall -q gzclient & killall -q gzserver", shell=True) + time.sleep(timeout_after_kill) + subprocess.call("killall -9 -q gzclient & killall -9 -q gzserver", shell=True) + sys.exit(0) + + +if __name__ == "__main__": + signal.signal(signal.SIGINT, signal_handler) + input("aaaaaaa") \ No newline at end of file diff --git a/robots/mini_quadrotor/launch/bringup.launch b/robots/mini_quadrotor/launch/bringup.launch index d3382300e..b3937696e 100644 --- a/robots/mini_quadrotor/launch/bringup.launch +++ b/robots/mini_quadrotor/launch/bringup.launch @@ -99,4 +99,6 @@ + +