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:
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:
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:
Then if I was to plug them into the mutex, it would be nice to simply provide the following config file:
But, currently, I also have to add some remaps, for example:
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:
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.