You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keep generated MoveIt parameters out of ParameterBuilder state - #4014
Fixes#4012. Merge generated MoveIt parameters into a fresh dictionary instead of changing the underlying ParameterBuilder state.
Checklist
Formatting and repository pre-commit checks
Regression test for repeated conversion and the opt-out flag
Tutorial, migration or GUI changes (not applicable)
Review another open PR
Validation: regression fails before the fix; 4 targeted Python tests pass afterward. Full ROS integration is pending CI.
Summary by CodeRabbit
Bug Fixes
Generating a full MoveIt configuration no longer changes the builder’s stored custom parameters. Returned configuration dictionaries can be modified without affecting later results, and configurations without MoveIt settings continue to contain only the custom parameters provided.
No actionable comments were generated in the recent review.
Walkthrough
to_dict() now copies the builder’s stored parameters before adding MoveIt configuration values. A new test checks that opt-out results exclude generated values and that modifying a returned dictionary does not change the builder’s custom parameter.
Changes: Builder dictionary behavior
Layer / File(s)
Summary
Copy parameters and verify dictionary results moveit_configs_utils/moveit_configs_utils/moveit_configs_builder.py, moveit_configs_utils/test/test_config_builder_dict.py
to_dict() copies stored parameters before adding MoveIt configuration values. The test checks opt-out results, full-config results, and whether changing the returned dictionary affects the builder’s custom parameter.
to_dict() now returns a copy of the builder's parameters, so generated MoveIt values and edits to the returned dictionary no longer leak into builder state. The change is small and has a regression test, and merge risk is minimal pending the normal CI run.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title says generated MoveIt parameters are kept out of ParameterBuilder state. The change copies self._parameters in MoveItConfigsBuilder.to_dict() before adding MoveIt config values, so the build…
Linked Issues check
[#4012] The issue requires to_dict(include_moveit_configs=False) to return only explicitly loaded ParameterBuilder parameters after a full conversion, and requires that mutating the returned top-lev…
Out of Scope Changes check
The whole-PR diff against the merge base changes one line in moveit_configs_utils/moveit_configs_utils/moveit_configs_builder.py (copy of self._parameters in to_dict) and adds one regression tes…
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title says generated MoveIt parameters are kept out of ParameterBuilder state. The change copies self._parameters in MoveItConfigsBuilder.to_dict() before adding MoveIt config values, so the builder's stored parameters are no longer mutated. The added test checks that generating the full config does not store generated parameters in the builder. The title names the main change and matches the linked issue #4012 and the objectives.
Full details: Linked Issues check
Explanation
[#4012] The issue requires to_dict(include_moveit_configs=False) to return only explicitly loaded ParameterBuilder parameters after a full conversion, and requires that mutating the returned top-level dictionary not change builder state. At head, to_dict() sets parameters = self._parameters.copy() before the include_moveit_configs branch adds generated values through parameters.update(...). The stored _parameters dictionary therefore no longer receives generated MoveIt keys, and top-level mutation of the returned full dictionary does not reach _parameters. The added test test_to_dict_does_not_store_generated_parameters checks the issue's sequence: opt-out returns {"custom": 42} before and after a full conversion, the full dictionary contains custom and robot_description, and mutating full["custom"] leaves builder.to_dict()["custom"] == 42. I did not execute the test. The test source and the one-line code change support the expected behavior. The fix is a shallow copy, so nested dictionaries supplied by the user are not protected. The issue does not require that protection.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff against the merge base changes one line in moveit_configs_utils/moveit_configs_utils/moveit_configs_builder.py (copy of self._parameters in to_dict) and adds one regression test in moveit_configs_utils/test/test_config_builder_dict.py. Both changes directly implement or verify the objective of #4012. No unrelated changes appear in the reviewed evidence. The PR description's claim of four passing targeted tests was not verified by me; this does not affect the scope verdict.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.
Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.
Queue this pull request once it meets the queue conditions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Description
Fixes #4012. Merge generated MoveIt parameters into a fresh dictionary instead of changing the underlying ParameterBuilder state.
Checklist
Validation: regression fails before the fix; 4 targeted Python tests pass afterward. Full ROS integration is pending CI.
Summary by CodeRabbit