Match the deformable flex and flexcomp schema to MuJoCo - #545
Open
adityasingh2400 wants to merge 1 commit into
Open
Match the deformable flex and flexcomp schema to MuJoCo#545adityasingh2400 wants to merge 1 commit into
adityasingh2400 wants to merge 1 commit into
Conversation
The PyMJCF spec for <deformable><flex> disagrees with MuJoCo in ways that make the element unusable. `vertex` was capped at five entries, but MuJoCo reads three floats per vertex, so even a single triangle needs nine and no valid flex could be parsed. `node` was capped at three for the same reason. `flatskin` is a boolean keyword in MuJoCo but was declared as a pair of floats, `group` is an int but was declared as a reference into a namespace that does not exist, and `dim` and `radius` were marked required even though MuJoCo defaults them to 2 and 0.005. The same `flatskin` mistype also appears on both copies of <flexcomp>, where it was declared as an int. That rejected the documented flatskin="true" and accepted flatskin="1", which MuJoCo then refuses to compile. Verified against mujoco 3.11.0, the version this repo pins.
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.
The PyMJCF spec for
<deformable><flex>disagrees with MuJoCo in several ways that together make the element unusable. Thevertexattribute was capped at five entries, but MuJoCo reads three floats per vertex, so even a single triangle needs nine and no valid flex could ever be parsed.nodewas capped at three for the same reason,flatskinis a boolean keyword in MuJoCo but was declared as a pair of floats,groupis an int but was declared as a reference into a namespace that does not exist, anddimandradiuswere marked required even though MuJoCo defaults them to 2 and 0.005.The same
flatskinmistype also appears on both copies of<flexcomp>, where it was declared as an int. That rejected the documentedflatskin="true"and acceptedflatskin="1", which MuJoCo then refuses to compile.This continues the type pass in cab6d38, which fixed
group,dim,radius,material,body,element,texcoordandelemtexcoordon the same element but left the remaining entries wrong. Everything here was verified against mujoco 3.11.0, the version this repo pins, and the added test compiles the round-tripped XML through MuJoCo.Verified by restoring
schema.xmltomainand rerunning: the round-trip test fails becausedimis demanded, the flexcomp test fails withExpect an integer value: got true, and supplyingdimandradiusby hand then hits thevertexcap withExpect array with no more than 5 entries: gotnine floats. With the change,dm_control/mjcf/is 152 passed and the suite and composer tests are 327 passed.This is disjoint from my open #543 and #544. The
schema.xmlhunks are at lines 1257, 1641 and 1810 against their 606 to 932 and 2102 to 2336, and I ran trial merges against both branches with no conflicts.