#!/bin/bash
import subprocess
import time
#kill all terminals and running nodes
subprocess.call([‘killall’, ‘-9’, ‘gnome-terminal’])
subprocess.call([‘killall’, ‘-9’, ‘rosmaster’])
#wait for everything to be killed properly
time.sleep(3)
#launch the turtlebot
subprocess.Popen([‘gnome-terminal’, ‘-x’, ‘bash’, ‘-c’, ‘roslaunch turtlebot_bringup minimal.launch’])
#wait for the turtlebot to be fully launched
time.sleep(1)
#launch soundplay
subprocess.Popen([‘gnome-terminal’, ‘-x’, ‘bash’, ‘-c’,’rosrun sound_play soundplay_node.py’])
#may be good to make sure soundplay runs properly before launching the dialogue script
time.sleep(1)
#launch the saved map of the environment (if applicable)
subprocess.Popen([‘gnome-terminal’, ‘-x’, ‘bash’, ‘-c’,’roslaunch turtlebot_navigation amcl_demo.launch map_file:=/home/turtlebot/savedmaps/stations.yaml’])
#call the dialogue script
subprocess.call([‘gnome-terminal’, ‘-x’, ‘bash’, ‘-c’, ‘cd /opt/ros/indigo/share/pocketsphinx/demo/Ourstuff; python FinalDeliveryAndGuide.py’]) |