Fix binding issue with scalar attributes.
PiperOrigin-RevId: 720136044 Change-Id: I0846a93ef36a23371d1bd504adff02dcce0abcf9
This commit is contained in:
committed by
Copybara-Service
parent
d86900aac1
commit
d21f624264
@@ -367,7 +367,7 @@ class BindModel(object):
|
||||
self.id = ids
|
||||
|
||||
def __getattr__(self, name: str):
|
||||
return getattr(self.model, self.prefix + name)[self.id, :]
|
||||
return getattr(self.model, self.prefix + name)[self.id, ...]
|
||||
|
||||
|
||||
def _bind_model(self: Model, obj: Sequence[Any]) -> BindModel:
|
||||
|
||||
@@ -219,6 +219,7 @@ class SupportTest(parameterized.TestCase):
|
||||
)
|
||||
|
||||
np.testing.assert_array_equal(mx.bind(s.joints).axis, m.jnt_axis)
|
||||
np.testing.assert_array_equal(mx.bind(s.joints).qposadr, m.jnt_qposadr)
|
||||
for i in range(m.njnt):
|
||||
np.testing.assert_array_equal(m.bind(s.joints[i]).axis, m.jnt_axis[i, :])
|
||||
np.testing.assert_array_equal(mx.bind(s.joints[i]).axis, m.jnt_axis[i, :])
|
||||
|
||||
Reference in New Issue
Block a user