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 frontend] Support tag namespaces #292

Open
ivanpauno opened this issue Jul 26, 2019 · 1 comment
Open

[launch frontend] Support tag namespaces #292

ivanpauno opened this issue Jul 26, 2019 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ivanpauno
Copy link
Member

Feature request

Feature description

Actions and substitutions can be exposed from several packages.
Name collisions are possible, and sometimes desired (e.g.: GroupAction in launch_ros with extra ns argument, see ros2/design#207 (review)).
Adding namespace is a way of solving the problem.

<group>
  ...
</group>
<ros::group ns="my_ns">
  ...
</ros::group>

Using tags would be also desired:

<using name="ros::group"/>
<using namespace="ros"/>

Using tags should be allowed in launch and group tag (and any other future tag that accepts a list of subentities).

Implementation considerations

Actions and Substitutions are exposed to launch.frontend using decorators.
The decorators populates two dictionaries, action_parse_methods and substitution_parse_methods, in the format:

{'TAG_NAME': <action/substitution>, ...}

It can be easily change to a nested dict:

{'pkg_identifier': {'TAG_NAME': <action/substitution>, ...}}

This, together with a name and namespace context should solve the problem.
The parsing functions of LaunchDescription and Group should check/push/pop this context.
We could have a parse_children methods in Parser class, for better code reuse.

Alternatives

Some sort of overriding is also possible. It doesn't solve some corner cases, e.g.:

  • Launch exposes group action.
  • Two different packages inherit from it and use the same tag name.
@ivanpauno ivanpauno added enhancement New feature or request help wanted Extra attention is needed labels Jul 26, 2019
@hidmic
Copy link
Contributor

hidmic commented Jul 26, 2019

@ivanpauno I'd be inclined to use a single colon : instead of two :: to be consistent with XML namespaces syntax. Also, I'd make the operator markup-language dependent e.g. using colons : on a YAML launch file will confuse the parser, better use dots ..

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