Add __setattr__ to _MjBindModel and _MjBindData.
This allows setting attributes with bind using a list of mjSpec objects as arguments. PiperOrigin-RevId: 825456920 Change-Id: Ie6af956feab0a805175d7aaecf26e071401fbf05
This commit is contained in:
committed by
Copybara-Service
parent
80eb511620
commit
010d919244
@@ -1266,6 +1266,8 @@ class SpecsTest(absltest.TestCase):
|
||||
np.testing.assert_array_equal(mj_model.bind(joints).qposadr, [7, 8])
|
||||
np.testing.assert_array_equal(mj_data.bind([]).qpos, [])
|
||||
np.testing.assert_array_equal(mj_model.bind([]).qposadr, [])
|
||||
mj_data.bind(joints).qpos = np.array([1, 2])
|
||||
np.testing.assert_array_equal(mj_data.bind(joints).qpos, [1, 2])
|
||||
with self.assertRaisesRegex(
|
||||
AttributeError, "object has no attribute 'invalid'"
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user