Skip to content

Support scoped=True for IncludeLaunchDescription action#953

Open
paulsohn wants to merge 2 commits intoros2:rollingfrom
paulsohn:feat/include-scoped
Open

Support scoped=True for IncludeLaunchDescription action#953
paulsohn wants to merge 2 commits intoros2:rollingfrom
paulsohn:feat/include-scoped

Conversation

@paulsohn
Copy link

@paulsohn paulsohn commented Mar 19, 2026

Description

Currently IncludeLaunchDescription (equivalently, <include> in xml) does not have any scoping option, so it leaks the launch configurations and set environment variables to the caller.

This variable leak is actually a feature that some ROS projects (e.g. Autoware) deliberately exploit to reuse common preset (i.e. the set of variables) -- so the backward compatibility should be kept, while we also need the ability to lint whether this leakage is intentional.

The behavior of <include scoped="true" (...) /> is equivalent to already possible <group scoped="true"><include (...) /></group>.

The implementation is mostly a duplication of group_action.py. The only difference is that I deferred the support of forwarding for now (it acts like forwarding=True.)

Fixes #801 after a discussion I found that #801 also exposes other issues, but nevertheless this PR is highly relevant for what we are missing.
Compared to its own importance, we've been spending too much time on orthogonal issue about how to make forwarding=False / filter what to forward to the includee.

Is this user-facing behavior change?

The change is backward compatible, as IncludeLaunchDescription(scoped=False) is the default behavior. On the other hand the user can specify IncludeLaunchDescription(scoped=True) to make scoped include.

Did you use Generative AI?

The implementation part is done by myself.
Claude Code (Opus 4.6) helped me in generating test cases. A thorough human review involved.

Additional Information

Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
@paulsohn paulsohn force-pushed the feat/include-scoped branch from 5c73d60 to 9ef7ea2 Compare March 19, 2026 03:17
@paulsohn paulsohn marked this pull request as ready for review March 19, 2026 03:32
@SuperJappie08
Copy link

I'm unsure if this completely addresses #801, as this forwards the external scope.

This unintentional forwarding could also affect the inner launchfile in unintended ways if it is not accounted for.

There are situations where this unintended passing is intended; however, this is not the case described in #801.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants