Skip to content

Parse YAML respawn delay strings#990

Open
Old-Ding wants to merge 1 commit into
ros2:rollingfrom
Old-Ding:codex/parse-yaml-respawn-delay
Open

Parse YAML respawn delay strings#990
Old-Ding wants to merge 1 commit into
ros2:rollingfrom
Old-Ding:codex/parse-yaml-respawn-delay

Conversation

@Old-Ding

Copy link
Copy Markdown

Description

The YAML frontend accepts strings for attributes declared as float, but ExecuteProcess.parse() compared a string-valued respawn_delay with 0.0 before converting it. A launch file using respawn_delay: '2.0' therefore failed during parsing with TypeError: '<' not supported between instances of 'str' and 'float'.

Convert string-valued respawn delays at the existing frontend parsing boundary. Valid values reach ExecuteLocal as floats, while invalid strings fail immediately with a descriptive ValueError. Native float behavior and the runtime respawn state machine are unchanged.

Is this user-facing behavior change?

Yes. Quoted numeric respawn_delay values in YAML launch files now work consistently instead of failing with a comparison TypeError. Invalid strings produce a parse-time error.

Did you use Generative AI?

Yes. OpenAI Codex assisted with tracing the frontend data flow, preparing the focused fix and tests, and reviewing the result. I reviewed the diff and verification output.

Additional Information

Local verification:

  • reproduced the Rolling failure with respawn_delay: '2.0'
  • all 279 launch functional tests passed
  • all 18 launch_yaml functional tests passed
  • both package flake8 tests passed
  • targeted ament_mypy passed with zero errors
  • ament_flake8, ament_pep257, and ament_copyright passed for both changed files
  • compileall and git diff --check passed

Convert string-valued YAML respawn delays at the frontend boundary so valid floats reach ExecuteLocal and invalid values fail during parsing instead of raising a comparison TypeError.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
@mergify

mergify Bot commented Jul 12, 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

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.

1 participant