Skip to content

Support choices lists for YAML launch arguments#986

Open
Old-Ding wants to merge 1 commit into
ros2:rollingfrom
Old-Ding:codex/yaml-argument-choices
Open

Support choices lists for YAML launch arguments#986
Old-Ding wants to merge 1 commit into
ros2:rollingfrom
Old-Ding:codex/yaml-argument-choices

Conversation

@Old-Ding

@Old-Ding Old-Ding commented Jul 11, 2026

Copy link
Copy Markdown

Description

YAML launch arguments currently support choices only through the XML-shaped form:

choice:
  - value: ur3
  - value: ur5e

Allow the natural YAML shorthand choices: [ur3, ur5e]. The YAML entity adapter validates the shorthand as a string list and maps it to the same choice/value entities already consumed by DeclareLaunchArgument.parse(). The existing syntax and common launch layer remain unchanged; providing both forms is still rejected by the existing unparsed-key validation.

Fixes #698.

Is this user-facing behavior change?

Yes. YAML launch files can now declare argument choices with a scalar list matching the Python API's choices spelling.

Did you use Generative AI?

Yes. OpenAI Codex assisted with root-cause analysis and preparing the focused code and regression test. I reviewed the diff and verification results.

Additional Information

Local verification:

  • all 20 launch_yaml functional tests passed
  • ament_flake8, ament_pep257, and ament_copyright passed for all 22 checked files
  • regression tests verify legacy syntax, mixed-type rejection, and ambiguous old/new key rejection
  • compileall and git diff --check passed
  • ament_mypy reports the same 16 pre-existing Entity/Parser annotation errors on both the clean baseline and this branch, with no new diagnostics

@mergify

mergify Bot commented Jul 11, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Map the YAML-specific choices shorthand to existing choice entities so list syntax matches Python launch files while preserving the legacy form.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
@Old-Ding Old-Ding force-pushed the codex/yaml-argument-choices branch from a9cecf5 to 9fa6db8 Compare July 12, 2026 19:13
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.

Difficult to specify YAML argument choices

1 participant