Skip to content

[Proposal] Fix Newton Object Collection Path Matching #6147

Closed

Description

@YizeWang

Proposal

Update Newton RigidObjectCollection path matching so it does not merge specific body paths into a broad wildcard. _build_combined_pattern() should not turn sibling paths such as /World/envs/env_*/Object_A, /World/envs/env_*/Object_B, and /World/envs/env_*/Object_C into /World/envs/env_*/* when that pattern can also match other rigid bodies.

The fix should make the Newton view bind only the configured collection bodies, or raise a clear error when exact matching is not possible.

Motivation

The current wildcard merge can include unrelated rigid bodies in the Newton ArticulationView. This breaks the collection's env/body counts and causes a runtime shape error.

Reproduction:

./isaaclab.sh -p scripts/demos/multi_asset.py --visualizer newton --physics newton_mjwarp --num_envs 1024

The same failure also reproduces with --visualizer none, so the issue is not specific to the Newton GL visualizer.

Observed failure:

RuntimeError: The size of tensor a (1706) must match the size of tensor b (1024) at non-singleton dimension 0

The demo reset expects num_envs == 1024, but Newton reports num_instances == 1706 for the collection:

scene.env_origins:       (1024, 3)
root_view.count:         5120
body_link_pose_w:        (1024, 5, 7)
default_body_pose:       (1706, 3, 7)
collection.num_bodies:   3
collection.num_instances: 1706

Configured collection paths:

/World/envs/env_.*/Object_A
/World/envs/env_.*/Object_B
/World/envs/env_.*/Object_C

Current combined pattern:

/World/envs/env_*/*

That pattern matches five bodies per env:

/World/envs/env_<i>/Robot/base
/World/envs/env_<i>/Object
/World/envs/env_<i>/Object_A
/World/envs/env_<i>/Object_B
/World/envs/env_<i>/Object_C

Only the last three belong to the collection.

Build Info

Checklist

  • I have checked that there is no similar issue in the repo (required)

Activity

  1. AntoineRichard commented on Jun 12, 2026

    @AntoineRichard
    Collaborator

    Thanks! Yes this is a known limitation of the selection API. As soon as newton-physics/newton#3071 lands and they modify the bare fnmatch with this new system in the main pattern matching method, we will be able to modify the newton collection code to send list of patterns. @adenzler-nvidia for viz.

  2. added
    enhancement
    on Jun 15, 2026
  3. yusufdxb commented on Sep 29, 2026

    @yusufdxb
    Contributor

    I reproduced this issue on current develop (eb6617c) with the Newton backend. With collection members Object_A and Object_B and an unrelated rigid body Object_Target in the same environment, the merged pattern /World/Env_*/Object_* matches three bodies per world and initialization fails. With members at different depths (Object_A, Shelf/Object_B), the combined pattern cannot be built at all.

    Newton 1.6.0, the pinned version, now accepts a list of patterns in ArticulationView. I have a small tested patch that implements the approach @AntoineRichard suggested above: pass the member patterns directly and remove _build_combined_pattern. It includes regression tests for both cases.

    @StafaH, are you already working on this? If not, are you okay with me opening the PR?

  4. StafaH commented on Sep 29, 2026

    @StafaH
    Collaborator

    Sure, feel free to open a PR for this and we can take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions