ros2 / ros2/launch

[launch frontend] Support tag namespaces

Open
#292 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
Python
Stars
155
Forks
182
Avg merge
2d 14h
Merged PRs (30d)
6

Description

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 https://github.com/ros2/design/pull/207#pullrequestreview-260917648).
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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing launch.frontend's decorator-populated action_parse_methods and substitution_parse_methods registries, then inspect the parsing functions of LaunchDescription, Group, and Parser. Determine how name and namespace context would flow through child parsing. Done means namespaced actions and substitutions, plus the proposed using tags in launch and group child lists, are supported without collisions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.