Skip to content

Fix Unity hinge reference import for radian models - #3515

Open
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/unity-hinge-ref-radian-import
Open

Fix Unity hinge reference import for radian models#3515
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/unity-hinge-ref-radian-import

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Summary

Fix Unity import of hinge joint ref values when the MJCF compiler uses radians.

MjHingeJoint already converts hinge ranges from radians to the degree-valued Unity fields, but ref was copied directly into Configuration, which is also stored and exposed in degrees. A model using angle="radian" therefore imported the reference angle with the wrong unit.

This change:

  • converts hinge ref from radians to degrees when MjSceneImportSettings.AnglesInDegrees is false
  • preserves existing degree-mode behaviour
  • adds focused regression coverage using a pi/2 reference and checking for 90 degrees

Validation

The branch is based directly on current main, is one commit ahead, and changes only MjHingeJoint.cs and its existing test file.

The Unity EditMode suite was not executed in this environment, so no local Unity test pass is claimed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant