Fix setting slice of multidimensional arrays in mjx bind

PiperOrigin-RevId: 727834258
Change-Id: Id8fa25ab3aacb02603f2e0ec701f89bb69a7ac7e
This commit is contained in:
Silvia Cruciani
2025-02-17 05:51:54 -08:00
committed by Copybara-Service
parent 7f11a0df12
commit 0a4eda5065
2 changed files with 8 additions and 3 deletions
+4
View File
@@ -276,6 +276,10 @@ class SupportTest(parameterized.TestCase):
np.testing.assert_array_equal(
dx7.bind(mx, s.bodies[1]).xfrc_applied, [1, 2, 3, 4, 5, 6]
)
for body in s.bodies[:1] + s.bodies[2:]:
np.testing.assert_array_equal(
dx7.bind(mx, body).xfrc_applied, [0, 0, 0, 0, 0, 0]
)
# test invalid name
with self.assertRaises(AttributeError):