Skip to content

Serialize Unity hinge reference with invariant culture - #3517

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

Serialize Unity hinge reference with invariant culture#3517
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/unity-hinge-ref-locale

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Summary

Make Unity-generated hinge joint ref values locale-independent.

MjHingeJoint.OnGenerateMjcf already uses MjEngineTool.MakeLocaleInvariant for range, but formats ref with the current process culture. On locales with a comma decimal separator, for example fr-FR, a reference value such as 1.5 can therefore be written as 1,5, which is not the intended MJCF numeric representation.

This change:

  • serializes hinge ref through MjEngineTool.MakeLocaleInvariant
  • adds a regression test that switches the current culture to fr-FR and verifies the generated value remains 1.5
  • does not change parsing or runtime joint behaviour

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