Apply the mimic joint offset in GazeboSimSystem::write (backport #953) - #954
Merged
Conversation
(cherry picked from commit 9ca792a)
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.
Fixes #952.
URDF defines a mimic joint as
follower = multiplier * driver + offset.MimicJoint::offsetreaches the plugin and is printed at startup (gz_system.cpp:391), but the arithmetic that drives the follower never referenced it, so a URDF declaring an offset produced a follower trackingmultiplier * driverwith the offset silently dropped and no warning.gazebo_ros2_control, the sibling plugin in this org, already applies the full form ingazebo_system.cpp(lines 511 and 795).The existing mimic fixtures declare
<mimic joint="..."/>with no multiplier or offset, so the default offset of zero made this invisible to the test suite. This adds an explicit multiplier and offset to the position gripper fixture and asserts the follower satisfies the URDF relationship once it settles. The follower is driven by a velocity proportional to its position error, so the assertion samples until the position stabilises rather than taking the first/joint_statesmessage.Verification
Built and run against Gazebo 8.11 on the
jazzybranch, which carries the same code, using a gripper whose mimic joint declaresoffset="0.05":The error before the change is exactly the dropped offset.
passes with the change and fails without it, with the source change reverted and the test kept:
gripper_mimic_joint_effort_testfails in my environment both with and without this change, oncheck_controllers_running, so it looks unrelated to this patch.Credit
@omnilink-tech reported this in #952 with the analysis and the one-line patch, and noted they do not open PRs. The diff to
gz_system.cppis theirs; I verified it, added the fixture and test coverage, and am submitting it.This is an automatic backport of pull request #953 done by [Mergify](https://mergify.com).