mjcf: restore schema declarations lost in the schema.xml regeneration - #553
Open
shoemoney wants to merge 1 commit into
Open
mjcf: restore schema declarations lost in the schema.xml regeneration#553shoemoney wants to merge 1 commit into
shoemoney wants to merge 1 commit into
Conversation
The schema regeneration in 985d094 dropped three declarations that MuJoCo 3.12 still accepts, breaking previously working PyMJCF models: - sensor lost its contact child element, so parsing a model with <sensor><contact .../></sensor> raises KeyError while raw MuJoCo loads it fine. - jointinparent on the nine actuator elements degraded from type="reference" reference_namespace="joint" to type="string", so attach() no longer prefixes the joint name and the composed model fails to compile with "unknown transmission target". - custom/numeric data degraded from a float array to a string, so add('numeric', name='x', data=[1, 2, 3]) raises ValueError. Restore the three declarations as they were before the regeneration and add regression tests covering all three.
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.
Fixes #552.
The schema regeneration in 985d094 dropped three declarations that the pre-regeneration
schema.xmlcarried and that MuJoCo 3.12 still accepts. Each one breaks a previously working PyMJCF model at HEAD:sensorlost itscontactchild element. Parsing a model with<sensor><contact .../></sensor>raisesKeyErrorwhile raw MuJoCo loads the same XML.jointinparenton the nine actuator elements degraded fromtype="reference" reference_namespace="joint"totype="string".attach()therefore emits the joint name unprefixed and the composed model fails to compile withunknown transmission target.custom/numericdatadegraded fromtype="array" array_type="float"totype="string", soroot.custom.add('numeric', name='x', data=[1, 2, 3])raisesValueError.This PR restores the three declarations exactly as they were in the pre-regeneration schema and adds a
SchemaRegressionTesttoschema_test.pycovering all three (parse and compile of a contact sensor, attach round-trip that must scopejointinparent, and array data on a custom numeric). All three tests fail at HEAD and pass with the fix; the fulldm_control/mjcftest suite passes (157 tests).If the preferred fix is in the schema generator rather than the checked-in file, the regression tests here should transfer directly.