fix(setup_assistant): use field defaults when controller params left blank#3723
Closed
darshmenon wants to merge 1 commit into
Closed
fix(setup_assistant): use field defaults when controller params left blank#3723darshmenon wants to merge 1 commit into
darshmenon wants to merge 1 commit into
Conversation
When a user leaves action_ns or default fields empty in the controller edit widget, getAdditionalParameters() previously stored empty strings, causing ros2_controllers.yaml to emit keys with no value (or empty strings). Fall back to getDefaultValue(controller_type) and skip the key entirely if the result is still empty, matching the behavior that typeChanged() already applies on type selection. Fixes #3434
fc0a590 to
9b7f17a
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #3434.
When a user opens the MoveIt Setup Assistant controller edit widget and leaves the action_ns or default additional-parameter fields blank (e.g. by clicking through without typing),
getAdditionalParameters()stored the empty string directly into the parameters map. The resultingros2_controllers.yamlthen contained:These empty-string values are semantically wrong and cause downstream parsing errors when the YAML is loaded by
ros2_control.Root Cause
typeChanged()(called on combo-box selection) already callsgetDefaultValue(controller_type)to pre-fill the fields. ButgetAdditionalParameters()(called when the user saves) never did the same fallback — it emitted whatever was in the text box, including empty strings.Fix
In
getAdditionalParameters():getControllerType()once (already a public method on the same class).getDefaultValue(controller_type).Test Plan
joint_trajectory_controller/JointTrajectoryControllercontroller, leave action_ns and default blank, export config — verifyros2_controllers.yamlnow containsaction_ns: follow_joint_trajectoryanddefault: "true"rather than empty strings.GripperCommandcontroller — verifyaction_ns: gripper_cmd.