Automatically compile mjSpec in to_xml().
Also, move mj_compile from MjModelWrapper to MjSpec. PiperOrigin-RevId: 737640210 Change-Id: I93d2a31c33eb359452b0d966a29939183b4c5198
This commit is contained in:
committed by
Copybara-Service
parent
35774706ee
commit
da04688071
@@ -520,13 +520,9 @@ class SpecsTest(absltest.TestCase):
|
||||
np.testing.assert_array_equal(data_new.qpos[:4], data.qpos)
|
||||
np.testing.assert_array_equal(data_new.qvel[:3], data.qvel)
|
||||
|
||||
def test_uncompiled_spec_cannot_be_written(self):
|
||||
def test_uncompiled_spec_can_be_written(self):
|
||||
spec = mujoco.MjSpec()
|
||||
|
||||
# Cannot write XML of an uncompiled spec.
|
||||
expected_error = 'XML Write error: Only compiled model can be written'
|
||||
with self.assertRaisesWithLiteralMatch(mujoco.FatalError, expected_error):
|
||||
spec.to_xml()
|
||||
spec.to_xml()
|
||||
|
||||
def test_modelname_default_class(self):
|
||||
XML = textwrap.dedent("""\
|
||||
|
||||
Reference in New Issue
Block a user