Files
teleoperation/scripts/teleoperation.sh
2019-01-24 11:04:42 +01:00

28 lines
865 B
Bash
Executable File

#!/bin/bash
# Script to start the necessary ros functions for the Teleoperating NAO oproject
# Array of commands to run in different tabs
commands=(
# Start roscore
'cd ~/catkin_ws;source devel/setup.bash ;roscore'
# Bringup Nao
'sleep 1;cd ~/catkin_ws;source devel/setup.bash ;roslaunch nao_bringup nao_full.launch '
# Start speech recognition server
'sleep 3;cd ~/catkin_ws;source devel/setup.bash ;roslaunch nao_apps speech.launch'
# Launch nodes in teleoperation package
'sleep 5;cd ~/catkin_ws;source devel/setup.bash ;roslaunch teleoperation teleoperation.launch'
)
# Build final command with all the tabs to launch
finalCommand=""
for (( i = 0; i < ${#commands[@]} ; i++ )); do
finalCommand+="--tab -e 'bash -c \"${commands[$i]};exec bash\"' "
done
# Run the final command
eval "gnome-terminal "$finalCommand
exit 0