Add signature to mjSpec and mjModel and use it to perform safe bind to mjModel and mjData.
PiperOrigin-RevId: 740378879 Change-Id: If14b326942529494f172e7aedcae30195798b458
This commit is contained in:
committed by
Copybara-Service
parent
c931565fdc
commit
157b074116
@@ -1153,6 +1153,13 @@ class SpecsTest(absltest.TestCase):
|
||||
AttributeError, "object has no attribute 'invalid'"
|
||||
):
|
||||
print(mj_model.bind(joints).invalid)
|
||||
invalid_spec = mujoco.MjSpec()
|
||||
invalid_spec.worldbody.add_body(name='main')
|
||||
with self.assertRaisesRegex(
|
||||
ValueError,
|
||||
'The mjSpec does not match mjModel. Please recompile the mjSpec.',
|
||||
):
|
||||
print(mj_model.bind(invalid_spec.body('main')))
|
||||
|
||||
def test_incorrect_hfield_size(self):
|
||||
nrow = 300
|
||||
|
||||
Reference in New Issue
Block a user