@@ -200,6 +200,10 @@ def test_bind(self):
200
200
# test getting
201
201
np .testing .assert_array_equal (mx .bind (s .bodies ).pos , m .body_pos )
202
202
np .testing .assert_array_equal (dx .bind (mx , s .bodies ).xpos , d .xpos )
203
+ np .testing .assert_array_equal (m .bind (s .bodies [0 ]).mass , m .body_mass [0 ])
204
+ np .testing .assert_array_equal (m .bind (s .bodies [0 :1 ]).mass , [m .body_mass [0 ]])
205
+ np .testing .assert_array_equal (mx .bind (s .bodies [0 ]).mass , m .body_mass [0 ])
206
+ np .testing .assert_array_equal (mx .bind (s .bodies [0 :1 ]).mass , [m .body_mass [0 ]])
203
207
for i in range (m .nbody ):
204
208
np .testing .assert_array_equal (m .bind (s .bodies [i ]).pos , m .body_pos [i , :])
205
209
np .testing .assert_array_equal (mx .bind (s .bodies [i ]).pos , m .body_pos [i , :])
@@ -224,6 +228,8 @@ def test_bind(self):
224
228
np .testing .assert_array_equal (mx .bind (s .joints ).axis , m .jnt_axis )
225
229
np .testing .assert_array_equal (mx .bind (s .joints ).qposadr , m .jnt_qposadr )
226
230
np .testing .assert_array_equal (mx .bind (s .joints ).dofadr , m .jnt_dofadr )
231
+ np .testing .assert_array_equal (dx .bind (mx , s .joints [1 ]).id , 1 )
232
+ np .testing .assert_array_equal (dx .bind (mx , s .joints [1 :2 ]).id , [1 ])
227
233
qposnum = [4 , 1 , 1 ] # one ball joint (4) and two slide joints (1)
228
234
dofnum = [3 , 1 , 1 ] # one ball joint (3) and two slide joints (1)
229
235
for i in range (m .njnt ):
0 commit comments