Skip to content

Commit 5d254cc

Browse files
authored
Fix Factory collision prim resolution (#7093)
# Description Fixes `IsaacContrib-Factory-Franka` startup after segment-safe prim-path expressions were introduced in #6841. The Factory collision analyzer assumed cloned environment expressions contained `.*`. It rewrote that spelling to `0` to find a source prim, then rebuilt an `env_.*` expression. The current `{ENV_REGEX_NS}` expansion is `/World/envs/env_[^/]+`, so the rewrite no longer produced a concrete USD path and startup failed with: ```text ValueError: Prim at path /World/envs/env_[^/]+/Robot is not valid. ``` This change resolves each collision body through `resolve_matching_prims_from_source`, the clone-plan-owned resolver. Its returned destination path expression is passed directly to point-cloud sampling, removing both wildcard-spelling rewrites and keeping ownership of clone-path resolution in the cloning subsystem. No new dependencies or test files are introduced. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Screenshots Not applicable; this is an environment-startup fix. ## Validation - Reproduced the exact failure on unmodified latest `develop` with the existing consolidated Factory smoke case. - Existing `IsaacContrib-Factory-Franka` smoke case: **1 passed in 39.33s**, including two environments and 20 random-action steps. - Full `uv run isaaclab -f` equivalent repository hook suite: passed. - `git diff --check upstream/develop...HEAD`: passed. ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the pre-commit checks with `isaaclab -f` - [x] Documentation changes are not required; the changelog fragment documents the fix - [x] My changes generate no new warnings - [x] The existing consolidated Factory smoke test proves the fix; no new test file is required - [x] I have added a changelog fragment under `source/isaaclab_tasks/changelog.d/` - [x] My name already exists in `CONTRIBUTORS.md`
1 parent a779f1d commit 5d254cc

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Fixed
2+
^^^^^
3+
4+
* Fixed ``IsaacContrib-Factory-Franka`` startup with segment-safe environment prim-path expressions.

source/isaaclab_tasks/isaaclab_tasks/contrib/nist/utils/collision_analyzer.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import torch
1313
import warp as wp
1414

15-
from isaaclab.sim.utils import get_first_matching_child_prim
15+
from isaaclab.sim.utils import resolve_matching_prims_from_source
1616

1717
from isaaclab_tasks.contrib.nist.utils import mesh_ops as _mesh_ops
1818
from isaaclab_tasks.contrib.nist.utils.rigid_object_hasher import RigidObjectHasher
@@ -52,14 +52,15 @@ def __init__(self, cfg: CollisionAnalyzerCfg, env: ManagerBasedRLEnv):
5252
self.body_ids = []
5353
self.local_pts = []
5454
for body_name in body_names:
55-
prim = get_first_matching_child_prim(
56-
self.asset.cfg.prim_path.replace(".*", "0", 1),
55+
_, prim_path_pattern = resolve_matching_prims_from_source(
56+
self.asset.cfg.prim_path,
5757
predicate=lambda p: p.GetName() == body_name and p.HasAPI(UsdPhysics.RigidBodyAPI),
58-
)
58+
expected_num_matches=1,
59+
)[0]
5960
local_pts = _mesh_ops.sample_object_point_cloud(
6061
num_envs=env.num_envs,
6162
num_points=cfg.num_points,
62-
prim_path_pattern=str(prim.GetPath()).replace("env_0", "env_.*", 1),
63+
prim_path_pattern=prim_path_pattern,
6364
device=device,
6465
)
6566
if local_pts is not None:

0 commit comments

Comments
 (0)