Skip to content

Support namespace and node name wildcards#1280

Closed
rpaaron wants to merge 3 commits intoros2:masterfrom
rpaaron:node-namespace-wildcards
Closed

Support namespace and node name wildcards#1280
rpaaron wants to merge 3 commits intoros2:masterfrom
rpaaron:node-namespace-wildcards

Conversation

@rpaaron
Copy link
Copy Markdown
Contributor

@rpaaron rpaaron commented Aug 18, 2020

Addresses #1265
I'd like to add tests but adding wildcards to params via arguments returns an error. Alternative is to add a .yml file, but im not sure about adding a filesystem dependency to the tests

@rpaaron rpaaron force-pushed the node-namespace-wildcards branch from da57c05 to e5c0208 Compare August 18, 2020 01:39
Copy link
Copy Markdown
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

besides inline comment, it would be nice to do test with possible combination.

Alternative is to add a .yml file, but im not sure about adding a filesystem dependency to the tests

test_resources_path / "test_parameters.yaml").string();

declare_parameter_with_cli_overrides test uses 'test_parameters.yaml, i think that you can refer to.

@rpaaron rpaaron force-pushed the node-namespace-wildcards branch from d7937c3 to c986bed Compare August 19, 2020 00:26
@rpaaron
Copy link
Copy Markdown
Contributor Author

rpaaron commented Aug 19, 2020

besides inline comment, it would be nice to do test with possible combination.

Alternative is to add a .yml file, but im not sure about adding a filesystem dependency to the tests

test_resources_path / "test_parameters.yaml").string();

declare_parameter_with_cli_overrides test uses 'test_parameters.yaml, i think that you can refer to.

thats great, thank you kindly

Copy link
Copy Markdown
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but like to hear from others about design.

@rpaaron rpaaron force-pushed the node-namespace-wildcards branch from c986bed to 4eb68a8 Compare August 25, 2020 21:09
namespace_wild: "namespace_wild"

ns:
"*":
Copy link
Copy Markdown
Collaborator

@iuhilnehc-ynos iuhilnehc-ynos Aug 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if * without double quotes in YAML is invalid, I still think the node wildcards without (") here should be supported, just like the namespace, such as (/*).

ns:
  /*:           # "*" can be also supported, but I think users like this style.
    ros__parameters:
      node_wild_in_ns: "node_wild_in_ns" 

It should be discussed with the maintainer. rcl_yaml_param_parser should be updated if the above suggestion is accepted.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supporting both /* and "*" makes sense to me 👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take back my previous comment. Name tokens separated by a YAML colon (:) should be treated as if they are separated with a slash (/). Therefore, the example:

ns:
  /*:
    ros__parameters:
      ...

Should resolve to the name /ns//*, which is invalid. The correct way to write it would be:

/ns/*:
  ros__parameters:
    ...

@clalancette
Copy link
Copy Markdown
Contributor

The same comment as #1265 (comment) applies to this PR.

@mabelzhang mabelzhang added the more-information-needed Further information is required label Oct 1, 2020
@mabelzhang
Copy link
Copy Markdown

@rpaaron Friendly ping. Have you had a chance to look into the design raised in the previous comment?

namespace_wild: "namespace_wild"

ns:
"*":
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supporting both /* and "*" makes sense to me 👍

ros__parameters:
full_wild: "full_wild"

/*:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have another test case for matching namespaces with multiple tokens. Following the design doc:

  • /* should match exactly one token (e.g. /foo or /bar, but not /foo/bar or /)
  • /** should match zero or more tokens (e.g. /foo or /bar or /foo/bar or /)

Signed-off-by: Aaron Lipinski <aaron.lipinski@roboticsplus.co.nz>
Signed-off-by: Aaron Lipinski <aaron.lipinski@roboticsplus.co.nz>
Signed-off-by: Aaron Lipinski <aaron.lipinski@roboticsplus.co.nz>
@rpaaron rpaaron force-pushed the node-namespace-wildcards branch from 4eb68a8 to 957432a Compare October 11, 2020 21:27
@rpaaron
Copy link
Copy Markdown
Contributor Author

rpaaron commented Oct 11, 2020

@rpaaron Friendly ping. Have you had a chance to look into the design raised in the previous comment?

thanks @mabelzhang can you advise what I need to change here?

@clalancette
Copy link
Copy Markdown
Contributor

thanks @mabelzhang can you advise what I need to change here?

Essentially this comment: #1265 (comment) . That is, some updates to the design document so that we are all on the same page.

@fujitatomoya
Copy link
Copy Markdown
Collaborator

@rpaaron can you rebase this on master?

@fujitatomoya
Copy link
Copy Markdown
Collaborator

fujitatomoya commented Dec 17, 2021

@rpaaron sorry for the confusion, i need to take back the previous request. could you help the review on #1839 instead, if you are available. (please see #1839 (review))

@fujitatomoya
Copy link
Copy Markdown
Collaborator

I will go ahead to close this one in favor of #1839.
CC: @rpaaron @iuhilnehc-ynos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

more-information-needed Further information is required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants