@@ -1072,6 +1072,7 @@ def test_attach_to_frame(self):
1072
1072
child2 = mujoco .MjSpec ()
1073
1073
child2 .assets = {'cube2.obj' : 'cube2_content' }
1074
1074
body2 = child2 .worldbody .add_body (name = 'body' )
1075
+ body2 .set_frame (child2 .worldbody .add_frame (pos = [- 1 , - 1 , 1 ]))
1075
1076
self .assertIsNotNone (parent .attach (child2 , frame = frame , prefix = 'child-' ))
1076
1077
self .assertIsNotNone (child2 .worldbody )
1077
1078
self .assertEqual (child2 .parent , parent )
@@ -1080,7 +1081,7 @@ def test_attach_to_frame(self):
1080
1081
self .assertIsNotNone (model2 )
1081
1082
self .assertEqual (model2 .nbody , 3 )
1082
1083
np .testing .assert_array_equal (model2 .body_pos [1 ], [0 , 1 , 4 ])
1083
- np .testing .assert_array_equal (model2 .body_pos [2 ], [2 , 3 , 2 ])
1084
+ np .testing .assert_array_equal (model2 .body_pos [2 ], [3 , 4 , 3 ])
1084
1085
np .testing .assert_array_equal (model2 .body_quat [1 ], [0 , 0 , 0 , 1 ])
1085
1086
np .testing .assert_array_equal (model2 .body_quat [2 ], [0 , 0 , 0 , 1 ])
1086
1087
self .assertEqual (parent .assets ['cube.obj' ], 'cube_content' )
@@ -1090,6 +1091,7 @@ def test_attach_to_frame(self):
1090
1091
child3 = mujoco .MjSpec ()
1091
1092
child3 .assets = {'cube2.obj' : 'new_cube2_content' }
1092
1093
body3 = child3 .worldbody .add_body (name = 'body' )
1094
+ body3 .set_frame (child3 .worldbody .add_frame (pos = [- 1 , - 1 , 1 ]))
1093
1095
self .assertIsNotNone (parent .attach (child3 , frame = 'frame' , prefix = 'child3-' ))
1094
1096
self .assertIsNotNone (child3 .worldbody )
1095
1097
self .assertEqual (child3 .parent , parent )
@@ -1098,8 +1100,8 @@ def test_attach_to_frame(self):
1098
1100
self .assertIsNotNone (model3 )
1099
1101
self .assertEqual (model3 .nbody , 4 )
1100
1102
np .testing .assert_array_equal (model3 .body_pos [1 ], [0 , 1 , 4 ])
1101
- np .testing .assert_array_equal (model3 .body_pos [2 ], [2 , 3 , 2 ])
1102
- np .testing .assert_array_equal (model3 .body_pos [3 ], [3 , 4 , 1 ])
1103
+ np .testing .assert_array_equal (model3 .body_pos [2 ], [3 , 4 , 3 ])
1104
+ np .testing .assert_array_equal (model3 .body_pos [3 ], [4 , 5 , 2 ])
1103
1105
np .testing .assert_array_equal (model3 .body_quat [1 ], [0 , 0 , 0 , 1 ])
1104
1106
np .testing .assert_array_equal (model3 .body_quat [2 ], [0 , 0 , 0 , 1 ])
1105
1107
np .testing .assert_array_equal (model3 .body_quat [3 ], [0 , 0 , 0 , 1 ])
0 commit comments