ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can definitely run nodes in namespaces, and it is quite easy in lauch files. To run a node in a namespace, simply add the ns
attribute to a <node>
tag. For example:
<node pkg="foo" type="bar" name="my_node" ns="my_namespace" />
would run the bar
node with runtime name my_node
in the my_namespace
namespace. Therefore, if you ran rosnode list
now, you would see /my_namespace/my_node
.
Running a node in a namespace allows the following:
There are some fancy things you can do with namespaces in launch files, like running a bunch of things in a namespace using <group>
, or including other launch files and putting everything in those launch files into a namespace. Check out the roslaunch XML syntax documentation for more http://wiki.ros.org/roslaunch/XML