rosmon_core: Add YAML merge key parsing functionality. #117
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #106.
Hello again @xqms. Over the past year I made a number of improvements and fixes to rosmon in one of my projects. I'll be rolling out these changes into PR's over the next few days.
This is a patch that enables YAML merge key functionality and somewhat addresses #106. While I am aware that
yaml-cpp
is technically the responsible party, their MR has still not yet been resolved, andYAML
proper is partially to blame. Given that we really needed this, I made this patch for my team's purposes and successfully saved a lot of time our our end being able to use YAML anchors.Here is an example
yaml
file I ran this patch over with success:I cross-compared the functionality of this and
roslaunch
and there is only one major difference in implementation (and I would argue this implementation is superior).rosmon result
This is the output from
rosparam dump
with the patchedrosmon
:roslaunch result
This is the output from
rosparam dump
with the standardroslaunch
on melodic:Difference
You'll notice that the override of
of a nested yaml struct in roslaunch completely replaces the structure, whereas in
rosmon
, it simply replaces the corresponding value in the struct with the new value, leaving all other values in place. I'd argue this is how this aught to be, but you can also make an argument that this 'doesn't align' with roslaunch, and therefore is 'unsatisfactory'. I'll leave this up to you.Let me know your thoughts!