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

I think I'm understanding your question correctly. You would like to publish all of the same topics in the different nodelets, but not step on each other - so you'd like to publish to a sub-namespace? I had the same issue and I figured out a workaround. I created a base namespace that all nodelets would belong to and then remapped that namespace to a sub-namespace for each nodelet that needed it.

<launch>
   <group ns="my_sensors">
        <node pkg="nodelet" type="nodelet" name="nodelet_manager" args="manager"/>
        <node pkg="nodelet" type="nodelet" name="my_main" args="load MyMain nodelet_manager"/>
        <node pkg="nodelet" type="nodelet" name="my_nodelet1" args="load MyNodelet nodelet_manager">
             <remap from="/my_sensors" to="/my_sensors/ld1" />
        </node>
        <node pkg="nodelet" type="nodelet" name="my_nodelet2" args="load MyNodelet nodelet_manager">
             <remap from="/my_sensors" to="/my_sensors/ld2" />
        </node>
    </group>
</launch>

All of your publications will change to the sub-namespace, but not the subscriptions.

Hope this helps