@@ -1069,7 +1069,7 @@ def test_attach_to_site(self):
1069
1069
child2 = mujoco .MjSpec ()
1070
1070
child2 .assets = {'cube2.obj' : 'cube2_content' }
1071
1071
body2 = child2 .worldbody .add_body (name = 'body' )
1072
- self .assertIsNotNone (parent .attach (child2 , site = site , prefix = 'child2- ' ))
1072
+ self .assertIsNotNone (parent .attach (child2 , site = site , suffix = '-child2 ' ))
1073
1073
self .assertIsNotNone (child2 .worldbody )
1074
1074
self .assertEqual (child2 .parent , parent )
1075
1075
body2 .pos = [- 1 , - 1 , - 1 ]
@@ -1081,13 +1081,13 @@ def test_attach_to_site(self):
1081
1081
np .testing .assert_array_equal (model2 .body_quat [1 ], [0 , 0 , 0 , 1 ])
1082
1082
np .testing .assert_array_equal (model2 .body_quat [2 ], [0 , 0 , 0 , 1 ])
1083
1083
self .assertEqual (parent .assets ['cube.obj' ], 'cube_content' )
1084
- self .assertEqual (parent .assets ['cube2.obj' ], 'cube2_content' )
1084
+ self .assertEqual (parent .assets ['cube2-child2 .obj' ], 'cube2_content' )
1085
1085
1086
1086
# Attach another spec to site (referenced by name) and compile again.
1087
1087
child3 = mujoco .MjSpec ()
1088
1088
child3 .assets = {'cube3.obj' : 'cube3_content' }
1089
1089
body3 = child3 .worldbody .add_body (name = 'body' )
1090
- self .assertIsNotNone (parent .attach (child3 , site = 'site' , prefix = 'child3- ' ))
1090
+ self .assertIsNotNone (parent .attach (child3 , site = 'site' , suffix = '-child3 ' ))
1091
1091
self .assertIsNotNone (child3 .worldbody )
1092
1092
self .assertEqual (child3 .parent , parent )
1093
1093
body3 .pos = [- 2 , - 2 , - 2 ]
@@ -1101,8 +1101,8 @@ def test_attach_to_site(self):
1101
1101
np .testing .assert_array_equal (model3 .body_quat [2 ], [0 , 0 , 0 , 1 ])
1102
1102
np .testing .assert_array_equal (model3 .body_quat [3 ], [0 , 0 , 0 , 1 ])
1103
1103
self .assertEqual (parent .assets ['cube.obj' ], 'cube_content' )
1104
- self .assertEqual (parent .assets ['cube2.obj' ], 'cube2_content' )
1105
- self .assertEqual (parent .assets ['cube3.obj' ], 'cube3_content' )
1104
+ self .assertEqual (parent .assets ['cube2-child2 .obj' ], 'cube2_content' )
1105
+ self .assertEqual (parent .assets ['cube3-child3 .obj' ], 'cube3_content' )
1106
1106
1107
1107
# Fail to attach to a site that does not exist.
1108
1108
child4 = mujoco .MjSpec ()
@@ -1150,7 +1150,7 @@ def test_attach_to_frame(self):
1150
1150
child2 .assets = {'cube2.obj' : 'cube2_content' }
1151
1151
body2 = child2 .worldbody .add_body (name = 'body' )
1152
1152
body2 .set_frame (child2 .worldbody .add_frame (pos = [- 1 , - 1 , 1 ]))
1153
- self .assertIsNotNone (parent .attach (child2 , frame = frame , prefix = 'child- ' ))
1153
+ self .assertIsNotNone (parent .attach (child2 , frame = frame , suffix = '-child ' ))
1154
1154
self .assertIsNotNone (child2 .worldbody )
1155
1155
self .assertEqual (child2 .parent , parent )
1156
1156
body2 .pos = [- 1 , - 1 , - 1 ]
@@ -1162,14 +1162,14 @@ def test_attach_to_frame(self):
1162
1162
np .testing .assert_array_equal (model2 .body_quat [1 ], [0 , 0 , 0 , 1 ])
1163
1163
np .testing .assert_array_equal (model2 .body_quat [2 ], [0 , 0 , 0 , 1 ])
1164
1164
self .assertEqual (parent .assets ['cube.obj' ], 'cube_content' )
1165
- self .assertEqual (parent .assets ['cube2.obj' ], 'cube2_content' )
1165
+ self .assertEqual (parent .assets ['cube2-child .obj' ], 'cube2_content' )
1166
1166
1167
1167
# Attach another spec to frame (referenced by name) and compile again.
1168
1168
child3 = mujoco .MjSpec ()
1169
1169
child3 .assets = {'cube2.obj' : 'new_cube2_content' }
1170
1170
body3 = child3 .worldbody .add_body (name = 'body' )
1171
1171
body3 .set_frame (child3 .worldbody .add_frame (pos = [- 1 , - 1 , 1 ]))
1172
- self .assertIsNotNone (parent .attach (child3 , frame = 'frame' , prefix = 'child3- ' ))
1172
+ self .assertIsNotNone (parent .attach (child3 , frame = 'frame' , suffix = '-child3 ' ))
1173
1173
self .assertIsNotNone (child3 .worldbody )
1174
1174
self .assertEqual (child3 .parent , parent )
1175
1175
body3 .pos = [- 2 , - 2 , - 2 ]
@@ -1183,7 +1183,7 @@ def test_attach_to_frame(self):
1183
1183
np .testing .assert_array_equal (model3 .body_quat [2 ], [0 , 0 , 0 , 1 ])
1184
1184
np .testing .assert_array_equal (model3 .body_quat [3 ], [0 , 0 , 0 , 1 ])
1185
1185
self .assertEqual (parent .assets ['cube.obj' ], 'cube_content' )
1186
- self .assertEqual (parent .assets ['cube2.obj' ], 'new_cube2_content' )
1186
+ self .assertEqual (parent .assets ['cube2-child3 .obj' ], 'new_cube2_content' )
1187
1187
1188
1188
# Fail to attach to a frame that does not exist.
1189
1189
child4 = mujoco .MjSpec ()
0 commit comments