Skip to content

Add manager-owned declarative collision filtering - #7636

Open
ooctipus wants to merge 10 commits into
isaac-sim:developfrom
ooctipus:codex/physics-manager-collision-filter
Open

Add manager-owned declarative collision filtering#7636
ooctipus wants to merge 10 commits into
isaac-sim:developfrom
ooctipus:codex/physics-manager-collision-filter

Conversation

@ooctipus

@ooctipus ooctipus commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Description

Add backend-neutral, physics-manager-owned collision filtering while making replicated-world isolation a default cloner policy.

Architecture

  • CloneCfg owns clone strategy, environment template, physics replication, and world isolation. isolate_environments=True is the default.
  • ClonePlan carries the resolved clone policy. InteractiveScene passes its complete cloner configuration into planning; it neither owns nor applies collision filtering.
  • cloner.replicate(plan) establishes one backend-independent assembly barrier: collider topology is assembled, the active PhysicsManager realizes collision policy, and native physics state is then built.
  • PhysicsCfg.collision_filter owns collider-granular policy through named CollisionGroupCfg entries. Prim selectors use whole-path regular-expression matching. Group relationships are symmetric, deny-wins, and support per-group allow-list inversion.

This supports non-transitive policies such as robot-object and object-support contact with robot-support disabled. It also supports multiple collider representations on one asset: nut/bolt SDF colliders can contact only each other while their convex colliders remain active against other objects.

Backend realization

  • Isaac Sim PhysX compiles assembled colliders into exclusive effective profiles, composes manager policy with world isolation, and preserves authored collision-group and filtered-pair denials.
  • Newton maps each authored collider to every generated native shape, including convex-decomposition pieces, and lowers policy to native shape-filter pairs during replicated builder assembly.
  • OVPhysX is a first-class implementation of the same manager contract. It uses native environment IDs for the GPU isolation-only fast path and full-stage realization for explicit semantic groups, non-native isolation, and composed authored policy.

Compatibility and migration

  • InteractiveSceneCfg.filter_collisions and InteractiveScene.filter_collisions() are removed; filtering is automatic at the physics-manager barrier.
  • CloneCfg.replicate_physics is canonical. The top-level InteractiveSceneCfg.replicate_physics field remains as a deprecated compatibility alias and is normalized into a copied CloneCfg.
  • isaaclab.cloner.filter_collisions(), legacy low-level plan arguments, and asset/terrain collision_group fields remain as deprecated compatibility surfaces.
  • Exact-path selection needs no extra flag: a selector can use an exact regular expression (optionally ending in $), while descendant selection is expressed directly with patterns such as .*/colliders/convex.

Type of change

  • New feature
  • Deprecation/migration
  • Documentation update

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Screenshots

Not applicable.

Validation

  • 65 focused cross-backend collision-filter, lifecycle, and clone-plan tests passed.
  • 103 core cloner tests, 49 Newton cloner tests, and 57 OVPhysX cloner/scene-backend tests passed.
  • Real OVPhysX 0.5.11 CPU and GPU stepping verified filtered bodies pass through while controls collide, including replicated semantic groups, authored-policy composition, and native GPU environment-ID isolation.
  • Task templates passed isolated generation and syntax/type validation.
  • Ruff formatting/lint, Python compilation, diff checks, and changelog validation against the PR base passed.
  • A centralized file/dependency audit confirmed there is no scene-owned filtering API, duplicate backend compiler, obsolete collision-filter wrapper, or descendant-selection flag.

Native Isaac Sim stepping was not available in this workspace and is left to CI.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@ooctipus
ooctipus requested a review from a team September 8, 2026 11:42
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Sep 8, 2026
@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces manager-owned declarative collision filtering and moves replicated-environment isolation into the clone lifecycle.

  • Adds named, regex-selected collision groups with symmetric deny-wins and allow-list inversion semantics.
  • Adds a collision-filter assembly barrier between USD authoring and native physics replication.
  • Implements backend-specific realization for Isaac Sim PhysX and Newton, with explicit capability handling for OvPhysX.
  • Migrates InteractiveScene, direct tasks, examples, documentation, and tests to pass isolation intent during replication.

Confidence Score: 5/5

The PR appears safe to merge with no concrete correctness, security, or repository-rule violations identified.

The manager barrier, clone-plan propagation, and backend realizations are internally consistent, and the added tests cover the principal policy, lifecycle, isolation, and authored-filter preservation paths.

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/cloner/replicate_session.py Splits context dispatch around a validated, one-shot collision-filter assembly barrier and forwards environment-isolation intent.
source/isaaclab/isaaclab/physics/physics_manager.py Adds collision-policy configuration, validation, barrier enforcement, backend dispatch, and lifecycle cleanup.
source/isaaclab/isaaclab/physics/_collision_filter.py Compiles selector membership and symmetric deny-wins group semantics.
source/isaaclab_physx/isaaclab_physx/physics/collision_filter.py Compiles assembled USD colliders, authored constraints, manager policy, and environment isolation into exclusive PhysX profiles.
source/isaaclab_newton/isaaclab_newton/cloner/collision_filter.py Maps authored collider endpoints to Newton shapes and lowers declarative and authored denials into native filter pairs.
source/isaaclab_ov/isaaclab_ov/physics/ovphysx_manager.py Realizes environment isolation through native environment IDs or deferred full-stage USD groups and rejects unsupported semantic groups.
source/isaaclab/isaaclab/scene/interactive_scene.py Moves automatic isolation into scene replication and guards the deprecated post-barrier filtering API.

Sequence Diagram

sequenceDiagram
    participant C as Scene or direct caller
    participant R as Cloner
    participant U as USD contexts
    participant M as Physics manager
    participant P as Native physics contexts
    C->>R: Publish ClonePlan and isolation intent
    R->>U: Replicate negative-priority stage rows
    U-->>R: Assembled collider topology
    R->>M: Apply isolation and declarative policy
    M-->>R: Backend-specific filtering realized
    R->>P: Replicate priority-zero-or-later rows
    P-->>C: Constructed physics model
Loading

Reviews (1): Last reviewed commit: "Add manager-owned collision filter polic..." | Re-trigger Greptile

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isaac Lab Review Bot

The manager-owned collision-filter policy and clone-lifecycle barrier are coherently integrated across PhysX, Newton, and OvPhysX. One scalability concern remains in the default PhysX environment-isolation path: generated collision groups enumerate every collider instead of retaining compact environment-root membership.

  • Design and architecture: The negative-priority stage contexts → manager collision-filter barrier → native physics contexts ordering is coherent, with environment isolation owned by cloning and semantic collider policy owned by PhysicsCfg. No actionable architecture issue was established beyond the PhysX representation-size concern.
  • API: The new CollisionFilterCfg, CollisionGroupCfg, ClonePlan.env_template, and isolate_environments surfaces are exported, documented, and accompanied by migration guidance for the deprecated post-cloning filtering workflow. No supported public API break was demonstrated by the candidate findings.
  • Implementation: PhysX currently emits explicitOnly generated groups containing one relationship target per collider. For the common isolation-only case, this replaces the previous single expandPrims environment-root target with collider-count-proportional authored data, materially increasing stage size for large replicated scenes. Preserve compact environment-root membership when an effective profile covers the whole environment.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

)
expansion_rule.default = Usd.Tokens.explicitOnly
includes = Sdf.RelationshipSpec(group_spec, "collection:colliders:includes", False)
for path in profiles[profile]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Implementation — Per-collider includes scale environment isolation

Generated groups use explicitOnly with one relationship target per collider path. On the default PhysX path (filter_collisions=True, no collision_filter cfg) each world forms a single profile, so authored targets grow from one env-root expandPrims include per environment to the total collider count across the stage — a large multiplier at thousands of environments. Keep env-root expandPrims includes when a profile covers a whole environment.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in a23a984. The isolation-only path now returns through the existing compact _author_collision_groups helper, so it authors one expandPrims environment-root target per environment and never discovers or enumerates colliders. Per-collider explicit membership is retained only when a semantic collider-level policy is configured.

@github-actions github-actions Bot added isaac-mimic Related to Isaac Mimic team infrastructure labels Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation infrastructure isaac-lab Related to Isaac Lab team isaac-mimic Related to Isaac Mimic team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant