Replies: 1 comment 1 reply
-
|
Thank you for posting this. Each environment is still “seeing” the same USD because all your gap meshes are being spawned in the source env before calling In Isaac Lab,
A robust approach is:
def _setup_scene(self):
self.robot = Articulation(self.cfg.robot_cfg)
# ground first
spawn_ground_plane(prim_path="/World/ground", cfg=GroundPlaneCfg())
# clone and replicate only robots, sensors, etc.
self.scene.clone_environments(copy_from_source=False)
# now spawn per-env USDs under each env root
map_paths = [
f"{ISAAC_NUCLEUS_DIR}/Environments/Narrow_gap/localmap_02_collider.usd",
f"{ISAAC_NUCLEUS_DIR}/Environments/Narrow_gap/localmap_29_collider_1.usd",
]
num_envs = self.scene.cfg.num_envs
for env_idx in range(num_envs):
map_path = map_paths[env_idx % len(map_paths)]
# use the already-created env root
prim_path = f"/World/envs/env_{env_idx}/narrow_gap_localmap"
cfg = sim_utils.UsdFileCfg(
usd_path=map_path,
rigid_props=sim_utils.RigidBodyPropertiesCfg(
rigid_body_enabled=True,
kinematic_enabled=True,
disable_gravity=True,
),
collision_props=sim_utils.CollisionPropertiesCfg(
collision_enabled=True,
),
activate_contact_sensors=False,
)
cfg.func(
prim_path=prim_path,
cfg=cfg,
translation=(-1.0, -1.0, -0.1),
orientation=(1.0, 0.0, 0.0, 0.0),
)
# register robot & sensors AFTER cloning
self.scene.articulations["robot"] = self.robot
self.lidar_2d = MultiMeshRayCaster(self.cfg.lidar_2d)
self.scene.sensors["lidar_2d"] = self.lidar_2d
self.contact_sensor = ContactSensor(self.cfg.contact_sensor)
self.scene.sensors["contact_sensor"] = self.contact_sensorThis sequence makes sure:
Why lidar still saw same meshRay casting uses the shared PhysX scene; if multiple USDs share the same prim name and are cloned from the same source env, they all reference the same underlying collider setup. By spawning after cloning into env-specific prim paths, each gap map has its own collider prims, and Footnotes
|
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
when i use below code to set my env for parellel training, i cannot get different usd model correctly.
as the picture shows, all the lidar in different env percept same mesh, although they visual not same type. Beside, all the envs have same collider feature that shows in env0 usd file, maybe i am not use correct usd import function, Thanks for help me!
Build Info
Describe the versions that you are currently using:
Beta Was this translation helpful? Give feedback.
All reactions