ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi,

I'm not familiar with Stage, but if you just want to repeat a bunch of launch files, you could use bash scripting.

There are a bunch of online tutorials to do this, such as: http://linuxconfig.org/bash-scripting-tutorial

For each launch file, I use a separate script. So I have one main script, say, "everything.sh", which then runs the separate launch files. So in "everything.sh", you might have the following lines:

#!/bin/bash
source /opt/ros/hydro/setup.bash
gnome-terminal -e /home/turtlebot/Scripts/roscore.sh
sleep 5
rosparam set use_sim_time true
a=1
gnome-terminal -e '/home/turtlebot/Scripts/playbag.sh '"$a"
let a=a+1

You would need to enclose some loop around the scripts you wanted repeated, of course. Here, each "gnome-terminal" opens the new script as a separate window so you can put a .launch file in each, running it as you would in a normal typed terminal. For instance, in my playbag.sh script I have:

#!/bin/bash
echo "Running bag "$1

source /opt/ros/hydro/setup.bash
cd ~/NewMapDump
rosbag play --clock -r 1 /tmp/newurgmount-straight-2.bag
rosrun map_server map_saver -f ''$1