Raise error if trying to bind with a spec with an empty name.
PiperOrigin-RevId: 731360983 Change-Id: I00365d158c1cae1cd912962ef453f43e93701080
This commit is contained in:
committed by
Copybara-Service
parent
ed16f2daf2
commit
1c240d8bad
@@ -333,6 +333,13 @@ class SupportTest(parameterized.TestCase):
|
||||
vdx.bind(mx, s.bodies[i]).xpos, [d.xpos[i, :]] * batch_size
|
||||
)
|
||||
|
||||
# test emtpy name
|
||||
s.worldbody.add_body()
|
||||
m = s.compile()
|
||||
mx = mjx.put_model(m)
|
||||
with self.assertRaises(KeyError, msg='cannot bind spec with empty name'):
|
||||
mx.bind(s.bodies)
|
||||
|
||||
_CONTACTS = """
|
||||
<mujoco>
|
||||
<worldbody>
|
||||
|
||||
Reference in New Issue
Block a user