module_config: support custom actuators_metadata backed by module-level params

This commit is contained in:
SalimTerryLi
2023-04-29 18:57:14 +08:00
committed by Beat Küng
parent 7eb6535273
commit 9c467198be
2 changed files with 40 additions and 26 deletions
@@ -264,7 +264,18 @@ def get_actuator_output(yaml_config, output_functions, timer_config_file, verbos
}
per_channel_params.append(param)
# TODO: support non-standard per-channel parameters
custom_params = group.get('custom_params', [])
for custom_param in custom_params:
# Simply pulls all custom params, assuming they are valid ones
param = {
'name': param_prefix+'_'+custom_param['name'],
}
# TODO: check and match the custom params in output_groups with module-level parameters
del custom_param['name']
for param_key in custom_param:
# '-' is used in actuators.schema.json, while '_' is used in module_schema.yml
param[param_key.replace('_', '-')] = custom_param[param_key]
per_channel_params.append(param)
subgroup['per-channel-parameters'] = per_channel_params