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

[launch_ros] use empty name for node namespace when only node name is given #283

Open
wjwwood opened this issue Oct 27, 2021 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@wjwwood
Copy link
Member

wjwwood commented Oct 27, 2021

Feature request

Feature description

At the moment, if you specify a node name but not a node namespace when using either Node or LifecycleNode, you will get something from launch like <node_namespace_unspecified>/foo when you ask for the full node name. This is likely surprising to users who are likely not thinking about the namespace when giving the name of the node.

My suggestion is to change this so that if you give only a node name to launch that launch should assume you mean that the node namespace should also be set to empty. That way you avoid the situation where launch knows the name of the node but not the namespace.

Implementation considerations

This will break users that are setting a namespace explicitly in the source code but not in their launch files. For example, if the user put "ping" as the namespace and "foo" as the node name in the source code, but then put only "bar" as the node name in the launch file, before this change it would result in the node name being "ping/bar", but after this change it would be just "/bar".

In my opinion, the new behavior is less surprising and people relying on the old behavior can easily change their logic.

We can also make it so that users can tell launch to not make this assumption (on a case by case basis or globally) to regain the old behavior if desired.

We can additionally deprecate this in a cycle, warning when providing only a node name for one release (with a way to suppress that warning) and make the assumption of empty namespace in the next release.

@wjwwood wjwwood added enhancement New feature or request help wanted Extra attention is needed labels Oct 27, 2021
@hidmic
Copy link
Contributor

hidmic commented Dec 8, 2021

In my opinion, the new behavior is less surprising and people relying on the old behavior can easily change their logic.

Hmm, if you have more than one node in the same process this would wreak havoc.


I agree these unspecified tokens are a bit terse, but they do reflect the fact that launch has no idea what the fully qualified node name is. Perhaps returning unknown or a question mark for its node name would emphasize that. Or maybe we can raise an informative exception on node name request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants