-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewritten params yaml ignores duplicate node/namespace keys #1217
Comments
@bpwilcox based on your recent findings, is this still an issue? |
This is invalid YAML. The yaml parser used in the RCL layer accepts this input, but it shouldn't if it enforced the standard. I'm not sure we should fix this in the RewrittenYaml component. Rather, the YAML library used by the RCL layer should error out when it receives an invalid file like this. |
I'm not opposed to leaving as is if we consider the current version of the rcl yaml parser as having this as a bug, however, I'm also in favor of bringing this issue upstream in case they decide that this is an intended feature for ROS2. |
I've checked the
I've discovered that newly loaded yaml-file contains only one parameter tree:
This means that In the end, to keep both of trees in one yaml and process them correctly it might need to have a written our own ROS2 yaml-loader instead of PyYAML. |
Got it. To be clear, is this issue because of the I suppose what we could do is run each tree separately. I'm sure somehow we can find the lines with root items and then run each section of the params file over that and concatenate them? Second, larger question, is whether we "should". How often is it that people have 1 yaml file with multiple identical roots? I can't think that's a very common issue. I dont see any places in our code that we do or did that. Maybe worth closing as a will not fix? What do you think? |
This is initially the issue of duplicating keys (in this example: 2 duplicating
As I understand, But regarding the large question, I would rather agree with you that the problem is not so common to go out-of-standards and batter the loading mechanism in |
I think that’s a good analysis. Closing ticket as won’t fix, the core concept is invalid |
Bug report
Steps to reproduce issue
Add parameters in
nav2_params.yaml
as such:Expected behavior
/top_node
andtop_node/extended_node
Actual behavior
Additional information
Right now the
configured_params
created via therewritten_yaml.py
does not rewrite node parameters from duplicate key values. This limits the launch from using a params file yaml where there are duplicate keys, for instance if we want to specify parameters for a nested node. I wanted to do this in #1211 for/planner_server/global_costmap
andcontroller_server/local_costmap
, but the parameters weren't being set on the nodes because of this issue.Implementation considerations
After some investigation, it looks like the problem might be that the keys being iterated over in
getYamlLeafKeys
inrewritten_yaml.py
do not include duplicate values, thus the key mappings fromyamlData.keys()
are unique.I think that when you add multiple yaml file arguments to the node, the new one will overwrite the previous one if there are any duplicates, so one solution could be to pass in the newly generated yaml in addition to the the original one. For cleanliness/efficiency, we might only include the substituted parameters in the generated yaml.
The text was updated successfully, but these errors were encountered: