From cdd26f142799873db21a5d9897ea2156087dffc9 Mon Sep 17 00:00:00 2001 From: "GLEN TURNER (8GT6)" <8gt6@queensu.ca> Date: Mon, 1 Jun 2015 11:05:07 -0400 Subject: [PATCH] Change launch.bash so it launches in two seperate windows and added back in the bagger.py launch --- launch.bash | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/launch.bash b/launch.bash index 45720d9..45ae8b3 100644 --- a/launch.bash +++ b/launch.bash @@ -1,5 +1,24 @@ #!/bin/bash -killall -9 rosmaster -roslaunch rosbridge_GUI_example all.launch & -python -m SimpleHTTPServer 8000 + +kill_child_processes() { + isTopmost=$1 + curPid=$2 + childPids=`ps -o pid --no-headers --ppid ${curPid}` + for childPid in $childPids + do + kill_child_processes 0 $childPid + done + if [ $isTopmost -eq 0 ]; then + kill -9 $curPid 2> /dev/null + fi +} + +# Ctrl-C trap. Catches INT signal +trap "kill_child_processes 1 $$; exit 0" INT + +chmod a+x src/bagger.py + +x-terminal-emulator -e "roslaunch rosbridge_GUI_example all.launch " & +x-terminal-emulator -e "python -m SimpleHTTPServer 8000" +