Add Newton USD Schemas as a dependency for MjcPhysics Schemas#3156
Open
andrewkaufman wants to merge 2 commits intogoogle-deepmind:mainfrom
Open
Add Newton USD Schemas as a dependency for MjcPhysics Schemas#3156andrewkaufman wants to merge 2 commits intogoogle-deepmind:mainfrom
andrewkaufman wants to merge 2 commits intogoogle-deepmind:mainfrom
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.
Newton USD Schemas provide extensions to OpenUSD's UsdPhysics specification, focussed on robotics use cases. As Newton supports MuJoCo simulation (via mujoco_warp), many of these attributes are directly applicable to MjcPhysics.
Here we deprecate equivalent attributes in MjcPhysics and apply the corresponding Newton schemas as built-ins. By unifying the USD attributes between Newton & MjcPhysics, we provide a more straightforward USD authoring experience for consumers.
There is no official USD schema deprecation mechanism today, so instead we apply the following changes:
There are also a couple semi-controvertial changes here that I want to callout for visibility:
MjcMaterialAPIis now deprecated. SinceNewtonMaterialAPIprovides the exact same attributes (albeit with different fallback values) I didn't see a reason to retain the schemanewton:contactMargin = mjc:margin - mjc:gapnewton:contactGap = mjc:gapMjcEqualityJointAPInow prependsNewtonMimicAPIrather thanMjcEqualityAPIMjcEqualityAPIare replicated onMjcEqualityJointAPI, excludingmjc:targetsince that is redundant withnewton:mimicJointMjcEqualityJointAPImore as a higher order extension of mimics, rather than as another mujoco equality.Build Issues
Newton USD Schemas are a codeless schema, which makes the build dependency fairly trivial, just downloading the schemas from GitHub & installing them. Unfortunately, this benefit comes with a drawback in that we need to hardcode the schema tokens in the mujoco cc files.
Additionally, there is no way currently for an external to run the necessary
usdGenSchemaand clang formatting calls needed when editing the MjcPhyiscs schemas. That will need to be done internally after this is accepted.I'd recommend also adding a proper C++
[[deprecated]](or mujoco equivalent) decorator on the generated schema attributes if possible. It will be much more discoverable for folks that way.