Robotics StackExchange | Archived questions

is it possible to use a nodelet manager across multiple namespaces?

I want to launch multiple cameras as nodelets and have them share the same nodelet manager. The idea is that my slam package will also launch as a nodelet under this same manager. It would be very efficient passing the image data to slam this way.

However, cameras usually are launched as individual namespaces. I am not able to get my nodelet manager to work unless all my nodelets are in the same namespaces. It doesn't even work even if the nodelet manager is in a parent namespace and the nodelets are in a child namespace.

is there a way to get past this or is it impossible to achieve what I want here? I've only seen examples so far of nodelet managers for each camera

Asked by mugetsu on 2020-05-20 19:11:58 UTC

Comments

I think you just need to remap the topics for the inputs and outputs for each to be correct. Its hard to say without seeing configuration / code, but I want to say from experience, that its just a game of making sure that all the namespaces are remapped for the ins and outs, and maybe using the leading / for global to on inputs to make sure you can get them.

Asked by stevemacenski on 2020-05-20 20:44:39 UTC

@mugetsu have you figured out a way how to do this?

Asked by Mehdi. on 2021-04-22 11:42:16 UTC

Answers

The way I made it work is by specifying the full path to the nodelet manager when loading a nodelet from a namespace

for example

<node pkg="nodelet" type="nodelet" name="my_nodelet_manager" args="manager" cwd="node" output="screen" />

<group ns="camera1">
  <node node pkg="nodelet" type="nodelet" name="my_nodelet" args="load pkg_name/nodelet_name /my_nodelet_manager" />
</group>

adding the slash in front of my_nodelet_manager in the nodelet loading command will make sure it won't look for the nodelet manager inside the namespace "camera1" but will try finding it using its global path. This also works with subnamespaces. If you want your camera and also the nodelet manager to be inside the slam namespace just do

<group ns="slam">
    <node pkg="nodelet" type="nodelet" name="my_nodelet_manager" args="manager" cwd="node" output="screen" />
    <group ns="camera1">
      <node node pkg="nodelet" type="nodelet" name="my_nodelet"
       args="load pkg_name/nodelet_name /slam/my_nodelet_manager" />
    </group>

Asked by Mehdi. on 2021-04-23 09:48:31 UTC

Comments