Fix sibling URDF mimic multiplier relation#297
Open
moonbow721 wants to merge 1 commit into
Open
Conversation
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
Fix URDF
<mimic>constraints for sibling joints with a non-unit multiplier or non-zero offset.SAPIEN loads URDF
<mimic>joints as fixed tendons (python/py_package/wrapper/articulation_builder.py). The two topology branches order their tendon links differently:joint mimics parent):[grandparent, source_child, follower_child]2 children mimic each other):[root, follower_child, source_child]but both reuse the same coefficient vector
[0, -multiplier, 1]. Because the source-child and follower-child links sit in opposite positions, the-multipliercoefficient lands on the source in the chain case (correct) but on the follower in the sibling case (wrong). The sibling constraint therefore becomesinstead of the intended URDF relation
For the common
multiplier=1, offset=0case this is invisible, which is why it went unnoticed; but any non-unit ratio is inverted, and any non-zero offset is applied to the wrong joint. This PR changes the sibling coefficients to[0, 1, -multiplier]and the reciprocals to[0, 1, -1 / multiplier], matching the URDF convention. The chain branch is already correct and is left unchanged.Test
Adds
test_urdf_mimic_sibling_multiplier_offset: a minimal sibling-joint URDF withdrives
sourceand assertsq_follower ~= 2.0 * q_source + 0.1. This fails on the current code (the follower instead satisfies the inverted(q_source - 0.1) / 2) and passes with the fix.Validation
Loaded the sibling URDF on a SAPIEN 3.0.3 wheel (drive
sourceto 0.4, follower left free):(source - 0.1) / 2(inverted)2 * source + 0.1(URDF-correct)The chain topology satisfies
2 * source + 0.1both before and after, confirming the fix is scoped to the sibling branch only.Note: the repo's GitHub workflow builds wheels but does not run
unittest/, so the added regression test was run locally.