[rolling] Combined Parameter Files#530
Conversation
Signed-off-by: David V. Lu <davidvlu@gmail.com>
Signed-off-by: David V. Lu <davidvlu@gmail.com>
7397045 to
f3475e9
Compare
|
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. |
|
Taking a look! |
| param: | ||
| - file: | ||
| - path: {} | ||
| - file: | ||
| - path: {} |
There was a problem hiding this comment.
This works:
| 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:
- In XML: a list of (i.e., multiple)
<file .../>nested within<param>...</param>. - In YAML: a single
filewith 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).
There was a problem hiding this comment.
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>
c428938 to
c2ab6b6
Compare
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 rollingCombinedParameterFilesallows for combining multiple yaml files and writing into a temp yaml file.param_filesargumentTempYamlFileclass consolidates the functionality for maybe writing to a temp yaml file between this andParameterFileparameters_type.pyand addedCombinedParameterFilesas a valid type in a couple of spots.Node.parsetest_combined_param_files.pytest_node_with_combo_file_params.pyIssue: 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