A tool to remove autoware_launch config file dependencies from
*.parameter_set.yaml files by inlining only the parameter values that
actually differ from each package's own defaults.
*.parameter_set.yaml files in the autoware system designer framework can
reference config files from autoware_launch via param_files entries:
- node: /perception/object_recognition/detection/centerpoint/validation
param_files:
- obstacle_pointcloud_based_validator_param_path: >-
$(find-pkg-share autoware_launch)/config/perception/.../obstacle_pointcloud_based_validator.param.yaml
param_values: []This creates a hard dependency on autoware_launch at design time. The
refiner resolves each such reference, compares the autoware_launch override
against the package's own default config, and rewrites the entry so only the
differing values are kept as inline param_values:
- node: /perception/object_recognition/detection/centerpoint/validation
param_files: []
param_values:
- name: using_2d_validator
value: trueIf the two files are identical, the reference is removed with no param_values
added.
python3 inline_autoware_launch_params.py <parameter_set.yaml> [OPTIONS]| Option | Description |
|---|---|
--workspace-src DIR |
Root of the colcon src/ tree. Auto-detected from the input file path if omitted. |
--dry-run |
Print what would change without writing the file. |
--output FILE |
Write the result to FILE instead of modifying in place. |
python3 inline_autoware_launch_params.py /path/to/autoware/src/launcher/autoware_launch/autoware_sample_designs/design/parameter_set/sample_system_perception.parameter_set.yaml --workspace-src /path/to/autoware/srcFor each param_files entry referencing $(find-pkg-share autoware_launch)/...:
-
Resolve the autoware_launch config — maps the
$(find-pkg-share ...)substitution to an actual file path in the workspace. -
Find the matching
*.node.yaml— searches the workspace for node definitions that declare the sameparam_filekey. When multiple candidates exist (e.g. the genericparam_pathkey appears in many nodes), the best match is selected using this priority:- Node whose declared default filename matches the autoware_launch config filename (exact match).
- Node whose package contains
config/<autoware_launch_config_filename>. - Node whose package name best matches the directory path of the autoware_launch config (path-segment scoring).
-
Resolve the package default config — locates the baseline config file to compare against. Prefers
<pkg>/config/<autoware_launch_config_filename>(exact filename match) over the filename declared innode.yaml, to handle cases where a node.yaml's declared default points to a sibling config for a different mode. -
Diff recursively — compares the autoware_launch config against the package default using a recursive, leaf-level diff. Only the parameters that actually differ are recorded, using dotted-path names (e.g.
association.can_assign.unknown) so that identical sibling fields are not written. -
Rewrite the entry — appends the differing values to
param_values(skipping any already set), then removes theautoware_launchreference fromparam_files. Non-autoware_launchparam_filesentries are preserved unchanged.
-
Scalars:
value: true/value: 0.5 -
Arrays: inline flow style
value: [0.098, 0.147, 0.078] -
Nested dicts: block mapping under the dotted-path name, e.g.:
- name: association.can_assign.unknown value: [polygon_tracker, multi_vehicle_tracker, pedestrian_and_bicycle_tracker]
ruamel.yaml
Install with:
pip install ruamel.yaml