Skip to content

[rolling] Combined Parameter Files#530

Open
DLu wants to merge 3 commits into
ros2:rollingfrom
DLu:feature/jazzy/combo_param_files
Open

[rolling] Combined Parameter Files#530
DLu wants to merge 3 commits into
ros2:rollingfrom
DLu:feature/jazzy/combo_param_files

Conversation

@DLu
Copy link
Copy Markdown
Contributor

@DLu DLu commented Apr 1, 2026

Description

Fixes #517 in Rolling - Combined parameter files.

Is this user-facing behavior change?

Yes, adds a new way to combine parameter files in launch files.

Did you use Generative AI?

No.

Additional Information

After getting a little annoyed at #518, I decided to try another approach I mentioned in #517 where we add a new parameter type to parameter_descriptions.

Current State:

  • I developed this in jazzy. It should eventually go in rolling but I wanted to get feedback before I committed to it. Now its rolling
  • New description: CombinedParameterFiles allows for combining multiple yaml files and writing into a temp yaml file.
    • Issue: I'm not sure if I have the typing correct on the param_files argument
  • TempYamlFile class consolidates the functionality for maybe writing to a temp yaml file between this and ParameterFile
  • Updated the typing in parameters_type.py and added CombinedParameterFiles as a valid type in a couple of spots.
  • Added new parsing logic in Node.parse
  • Tests for core Python functionality in test_combined_param_files.py
  • Tests for parsing Yaml and XML in test_node_with_combo_file_params.py
    • Issue: I got the XML to work the way I wanted, but didn't get the YAML to parse the way I wanted. That test currently fails. Figured it out with @christophebedard

DLu added 2 commits May 1, 2026 11:28
Signed-off-by: David V. Lu <davidvlu@gmail.com>
Signed-off-by: David V. Lu <davidvlu@gmail.com>
@DLu DLu force-pushed the feature/jazzy/combo_param_files branch from 7397045 to f3475e9 Compare May 1, 2026 15:28
@DLu DLu changed the base branch from jazzy to rolling May 1, 2026 15:29
@DLu DLu changed the title [jazzy] Combined Parameter Files [rolling] Combined Parameter Files May 1, 2026
@DLu DLu marked this pull request as ready for review May 1, 2026 15:30
@DLu
Copy link
Copy Markdown
Contributor Author

DLu commented May 1, 2026

I have updated this PR to be based on rolling, and removed the draft status.

@christophebedard @emersonknapp I would welcome your feedback on the proper YAML format to mimic the XML test.

@christophebedard
Copy link
Copy Markdown
Member

Taking a look!

Comment on lines +60 to +64
param:
- file:
- path: {}
- file:
- path: {}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works:

Suggested change
param:
- file:
- path: {}
- file:
- path: {}
param:
- file:
- path: {}
- path: {}

The key is that param.get_attr('file', data_type=List[Entity], optional=True) is expected to be:

  1. In XML: a list of (i.e., multiple)<file .../> nested within <param>...</param>.
  2. In YAML: a single file with a list of dictionaries (- ...) under it.

For reference, look at how XML <let> and YAML let: are handled in IncludeLaunchDescription: https://github.com/ros2/launch/blob/a5a6dd7eb7865dbc64d0e18f0229b0ebad826082/launch/launch/actions/include_launch_description.py#L96-L116. I'm not entirely sure why it's

        launch:
            - node:
                # ...
                param:
                    - file:
                        - path: {}
                        - path: {}

and not

        launch:
            - node:
                # ...
                param:
                    file:
                        - path: {}
                        - path: {}

like param: is to node: here or how let: is to include: in IncludeLaunchDescription, but the parsing works 🤷 . Maybe because we have an extra nesting level here (all under param and not directly under node).

Copy link
Copy Markdown
Member

@christophebedard christophebedard May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe because we have an extra nesting level here (all under param and not directly under node).

ah, that is probably because where you put your new parsing code is supposed to handle a single param out of a list of param. YAML param: expects a list under it (and we can have multiple XML <param> under a <node>), hence the - file:. In other words, you need - file: here because you can have multiple params 🤯 totally not confusing

Signed-off-by: David V. Lu <davidvlu@gmail.com>
@DLu DLu force-pushed the feature/jazzy/combo_param_files branch from c428938 to c2ab6b6 Compare May 1, 2026 17:36
@christophebedard christophebedard self-requested a review May 8, 2026 19:17
@christophebedard christophebedard self-assigned this May 14, 2026
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.

Feature: Combined Parameter Substitution

2 participants