@@ -37,9 +37,7 @@ def sim():
3737
3838def test_spawn_multiple_shapes_with_global_settings (sim ):
3939 """Test spawning of shapes randomly with global rigid body settings."""
40- num_clones = 10
41- for i in range (num_clones ):
42- prim_utils .create_prim (f"/World/env_{ i } " , "Xform" , translation = (i , i , 0 ))
40+ prim_utils .create_prim ("/World/template" , "Xform" , translation = (0 , 0 , 0 ))
4341
4442 cfg = sim_utils .MultiAssetSpawnerCfg (
4543 assets_cfg = [
@@ -58,19 +56,18 @@ def test_spawn_multiple_shapes_with_global_settings(sim):
5856 visual_material = sim_utils .PreviewSurfaceCfg (diffuse_color = (0.0 , 0.0 , 1.0 ), metallic = 0.2 ),
5957 ),
6058 ],
61- random_choice = True ,
6259 rigid_props = sim_utils .RigidBodyPropertiesCfg (
6360 solver_position_iteration_count = 4 , solver_velocity_iteration_count = 0
6461 ),
6562 mass_props = sim_utils .MassPropertiesCfg (mass = 1.0 ),
6663 collision_props = sim_utils .CollisionPropertiesCfg (),
6764 )
68- prim = cfg .func ("/World/env_.* /Cone" , cfg )
65+ prim = cfg .func ("/World/template /Cone/asset_.* " , cfg )
6966
7067 assert prim .IsValid ()
71- assert prim_utils .get_prim_path (prim ) == "/World/env_0 /Cone"
72- prim_paths = prim_utils .find_matching_prim_paths ("/World/env_* /Cone" )
73- assert len (prim_paths ) == num_clones
68+ assert prim_utils .get_prim_path (prim ) == "/World/template /Cone/asset_0 "
69+ prim_paths = prim_utils .find_matching_prim_paths ("/World/template /Cone/asset_.* " )
70+ assert len (prim_paths ) == 3
7471
7572 for prim_path in prim_paths :
7673 prim = prim_utils .get_prim_at_path (prim_path )
@@ -79,9 +76,7 @@ def test_spawn_multiple_shapes_with_global_settings(sim):
7976
8077def test_spawn_multiple_shapes_with_individual_settings (sim ):
8178 """Test spawning of shapes randomly with individual rigid object settings."""
82- num_clones = 10
83- for i in range (num_clones ):
84- prim_utils .create_prim (f"/World/env_{ i } " , "Xform" , translation = (i , i , 0 ))
79+ prim_utils .create_prim ("/World/template" , "Xform" , translation = (0 , 0 , 0 ))
8580
8681 mass_variations = [2.0 , 3.0 , 4.0 ]
8782 cfg = sim_utils .MultiAssetSpawnerCfg (
@@ -109,14 +104,13 @@ def test_spawn_multiple_shapes_with_individual_settings(sim):
109104 collision_props = sim_utils .CollisionPropertiesCfg (),
110105 ),
111106 ],
112- random_choice = True ,
113107 )
114- prim = cfg .func ("/World/env_.* /Cone" , cfg )
108+ prim = cfg .func ("/World/template /Cone/asset_.* " , cfg )
115109
116110 assert prim .IsValid ()
117- assert prim_utils .get_prim_path (prim ) == "/World/env_0 /Cone"
118- prim_paths = prim_utils .find_matching_prim_paths ("/World/env_* /Cone" )
119- assert len (prim_paths ) == num_clones
111+ assert prim_utils .get_prim_path (prim ) == "/World/template /Cone/asset_0 "
112+ prim_paths = prim_utils .find_matching_prim_paths ("/World/template /Cone/asset_.* " )
113+ assert len (prim_paths ) == 3
120114
121115 for prim_path in prim_paths :
122116 prim = prim_utils .get_prim_at_path (prim_path )
@@ -130,16 +124,13 @@ def test_spawn_multiple_shapes_with_individual_settings(sim):
130124
131125def test_spawn_multiple_files_with_global_settings (sim ):
132126 """Test spawning of files randomly with global articulation settings."""
133- num_clones = 10
134- for i in range (num_clones ):
135- prim_utils .create_prim (f"/World/env_{ i } " , "Xform" , translation = (i , i , 0 ))
127+ prim_utils .create_prim ("/World/template" , "Xform" , translation = (0 , 0 , 0 ))
136128
137129 cfg = sim_utils .MultiUsdFileCfg (
138130 usd_path = [
139131 f"{ ISAACLAB_NUCLEUS_DIR } /Robots/ANYbotics/ANYmal-C/anymal_c.usd" ,
140132 f"{ ISAACLAB_NUCLEUS_DIR } /Robots/ANYbotics/ANYmal-D/anymal_d.usd" ,
141133 ],
142- random_choice = True ,
143134 rigid_props = sim_utils .RigidBodyPropertiesCfg (
144135 disable_gravity = False ,
145136 retain_accelerations = False ,
@@ -154,9 +145,9 @@ def test_spawn_multiple_files_with_global_settings(sim):
154145 ),
155146 activate_contact_sensors = True ,
156147 )
157- prim = cfg .func ("/World/env_.* /Robot" , cfg )
148+ prim = cfg .func ("/World/template /Robot/asset_.* " , cfg )
158149
159150 assert prim .IsValid ()
160- assert prim_utils .get_prim_path (prim ) == "/World/env_0 /Robot"
161- prim_paths = prim_utils .find_matching_prim_paths ("/World/env_* /Robot" )
162- assert len (prim_paths ) == num_clones
151+ assert prim_utils .get_prim_path (prim ) == "/World/template /Robot/asset_0 "
152+ prim_paths = prim_utils .find_matching_prim_paths ("/World/template /Robot/asset_.* " )
153+ assert len (prim_paths ) == 2
0 commit comments