Closed Kotochleb closed 6 months ago
@sea-bass I saw #185, but it did not solve this issue. I tested it once again after you comment and neither edfeb82 nor current main do not work. That is why I still want to keep this PR open.
As you suggested, I added check if {{struct_name}}
is not empty, and I also merged main to make sure everything will still work after adding #185.
Okay, I think I see the issue here. params_to_be_mapped
is referred to but it is not at the top-level scope. Currently, the library assumes that because it may be ambiguous in any other case. For example,
my_node:
params_to_be_mapped: {
type: string_array,
}
my_params:
params_to_be_mapped: {
type: string_array,
}
__map_params_to_mapped:
in_map_param: {
type: bool,
}
this is valid YAML but it is unclear which params_to_be_mapped is referred to. So we need a new syntax to support this. I think it would make sense to use a syntax like this: __map_my_params.params_to_mapped
.
The current change in this PR breaks the example file here: https://github.com/PickNikRobotics/generate_parameter_library/blob/main/example_python/generate_parameter_module_example/parameters.yaml
Thank you for clarification. Since the changes I proposed are breaking, I will simply modify my own code then. Feel free to close this PR without merging.
@Kotochleb Do you mind opening an issue for this? That way, this feature can potentially be added when I have some time.
Since the issue is open now I am closing this PR
This PR fixes incorrectly created parameters for maps in Python.
With this yaml:
Current Jinja template will create following code:
While the expected output is:
Namespace of
my_params
is not taken into account infor
loops of the mapped values.