Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[yocs_cmd_vel_mux] Topics are in private namespace #133

Open
jacobperron opened this issue May 9, 2018 · 0 comments
Open

[yocs_cmd_vel_mux] Topics are in private namespace #133

jacobperron opened this issue May 9, 2018 · 0 comments

Comments

@jacobperron
Copy link

jacobperron commented May 9, 2018

Topic names provided in a config file are prefixed with the name of the node. This is because a private NodeHandle is used to create the subscribers. The same is true for published topics. This is inconvenient for integration with other nodes because a remap is required for each topic listed in the config file, meaning any change to the input topics also requires a corresponding remap change in a launch file.

As an example, say I have a few nodes publishing velocities to the following topics:

    /cmd_vel_0
    /cmd_vel_1
    /my_node/cmd_vel

Then if I was to plug them into the mutex, it would be nice to simply provide the following config file:

subscribers:
  -
    name    : cmd_vel_0
    topic   : cmd_vel_0
    timeout : 0.5
    priority: 1
  -
    name    : cmd_vel_1
    topic   : cmd_vel_1
    timeout : 0.5
    priority: 2
  -
    name    : my_node_cmd_vel
    topic   : my_node/cmd_vel
    timeout : 0.5
    priority: 3

publisher: cmd_vel

But, currently, I also have to add some remaps, for example:

<remap from="yocs_cmdl_vel_mux/cmd_vel_0" to="cmd_vel_0" />
<remap from="yocs_cmdl_vel_mux/cmd_vel_1" to="cmd_vel_1" />
<remap from="yocs_cmdl_vel_mux/my_node/cmd_vel" to="my_node/cmd_vel" />

Of course we can put the topic names in a global namespace, but then we lose the nice feature of including all of our nodes (including yocs_cmd_vel_mux) in a common namespace at the launch level, for example:

<group ns="my_robot">
    <node pkg="nodelet" type="nodelet" name="yocs_cmd_vel_mux"
        args="load yocs_cmd_vel_mux/CmdVelMuxNodelet $(arg nodelet_manager_name)">
        <param name="yaml_cfg_file" value="path/to/my/config"/>
    </node>

    <node pkg="my_node" type="my_node" name="my_node" />

    ...

</group>

The same issue exists for yocs_velocity_smoother as well (and possibly other yocs packages?).

I believe it is a common practice to use a relative namespace for topics. This is mentioned for drivers specifically as part of REP-0135.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant