ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I'm not entirely sure that I understand your question, but this sounds like exactly the kind of thing that launch files are used for. Using a launch file you could easily launch all of the nodes that you are interested in, automatically start a new roscore
if one is needed, and control the inputs and outputs for each individual node (if for example you wanted each node to launch in a different terminal window). All of this could be accomplished with a single call to roslaunch
. Here is a minimalist example that may do approximately what you want:
<launch>
<!-- start first node and roscore if needed: -->
<node pkg="teleop_twist_keyboard" name="keyboard_control"
type="teleop_twist_keyboard.py" output="screen"
respawn="true" launch-prefix="xterm -rv -e" />
<!-- start second node: -->
<node pkg="irobot_create_2_1" name="irobot_driver"
type="driver.py" output="screen" />
</launch>
Note that I have used the launch-prefix
tag in the first node entry to force the node to open in a new xterm
window. More about launch files can be found here and available XML tags here