Skip to content

Fix PhysX collision filtering in direct tasks - #6855

Open
kellyguo11 wants to merge 2 commits into
isaac-sim:developfrom
kellyguo11:kellyguo11/fix-direct-physx-collision-filtering
Open

Fix PhysX collision filtering in direct tasks#6855
kellyguo11 wants to merge 2 commits into
isaac-sim:developfrom
kellyguo11:kellyguo11/fix-direct-physx-collision-filtering

Conversation

@kellyguo11

@kellyguo11 kellyguo11 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #5302.
Fixes #6853.

Manual direct-workflow tasks call the cloner after spawning their assets, but most of them only authored per-environment collision groups on CPU—or did not author them at all. The PhysX replication path currently uses USD collision filtering instead of PhysX environment IDs, so CUDA replicas could collide across environments and constrain articulated joints despite valid effort targets.

This change:

  • applies collision filtering on every PhysX simulation device for all in-repo tasks using the manual direct-workflow cloning path;
  • preserves each task's global ground or terrain collision paths;
  • guards the filtering by backend so Newton behavior is unchanged;
  • adds a Cartpole regression that verifies every cloned articulation accelerates consistently under a constant effort.

The deterministic 4,096-environment reproduction now reports identical cart velocity in every environment after 20 steps at 100 N:

min=6.7209768 m/s, max=6.7209768 m/s, mean=6.7209768 m/s

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots

Not applicable.

Validation

  • Confirmed the new regression fails without the fix: all four cart velocities remain near 10^-6 m/s.
  • Confirmed the regression passes with the fix.
  • Confirmed the original 4,096-environment constant-effort diagnostic produces identical velocities across replicas.
  • Confirmed the Newton MJWarp control remains consistent across four replicas.
  • uv run isaaclab -f
  • uv run --no-sync python tools/changelog/cli.py check issue-5302-base
  • Confirmed Cartpole rendering correctness passes for the PhysX/Isaac Sim RTX and PhysX/Newton renderer combinations (2 passed).
  • Confirmed the registered Cartpole and Shadow Hand camera tasks match their updated collision-group stage goldens.

Checklist

  • I have read and understood the contribution guidelines.
  • I have run the pre-commit checks.
  • Documentation changes are not required for this behavior-only fix.
  • My changes generate no new warnings.
  • I have added a test that proves the fix is effective.
  • I have added a changelog fragment for the touched package.
  • My name already exists in CONTRIBUTORS.md.

Apply per-environment collision groups for manual direct-workflow
cloning on every PhysX simulation device. Without these groups, CUDA
replicas collide across environments and joint efforts become ineffective.

Add a Cartpole regression that verifies every cloned articulation
accelerates consistently under a constant effort.

Fixes isaac-sim#5302
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Aug 3, 2026
@kellyguo11
kellyguo11 marked this pull request as ready for review August 3, 2026 02:52
@kellyguo11
kellyguo11 requested a review from a team August 3, 2026 02:52
@greptile-apps

greptile-apps Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extends explicit inter-environment collision filtering from CPU-only execution to every PhysX simulation device in manually cloned direct-workflow tasks, while leaving non-PhysX backends unchanged.

  • Applies backend-guarded collision filtering across eleven direct task environments.
  • Preserves each task’s configured global terrain or ground paths where required.
  • Adds a CUDA PhysX Cartpole regression that checks consistent actuation across cloned environments.
  • Adds an isaaclab_tasks changelog fragment.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code failure established.

The collision-filtering calls are consistently restricted to PhysX, preserve identified shared collider paths, and the new regression exercises the affected CUDA replication path with compatible action and articulation data shapes.

Important Files Changed

Filename Overview
source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env.py Broadens collision filtering from CPU-only execution to all PhysX devices after Cartpole replication.
source/isaaclab_tasks/isaaclab_tasks/contrib/factory/factory_env.py Broadens Factory collision filtering to all PhysX devices; the existing no-argument global-path behavior remains unchanged.
source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_env.py Adds PhysX-only replica filtering while preserving the shared /World/ground collider.
source/isaaclab_tasks/isaaclab_tasks/core/reorient/reorient_direct_env.py Adds PhysX-only replica filtering and retains the manually spawned global ground plane.
source/isaaclab_tasks/test/core/test_cartpole_direct_physx_actuation.py Adds a CUDA PhysX regression that applies constant effort and compares cart velocities across four cloned environments.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Spawn environment 0 assets] --> B[Build clone plan]
    B --> C[Replicate environments]
    C --> D{Physics backend contains physx?}
    D -- Yes --> E[Filter collisions between environment replicas]
    D -- No --> F[Leave backend behavior unchanged]
    E --> G[Register cloned assets with scene]
    F --> G
Loading

Reviews (1): Last reviewed commit: "Fix PhysX collision filtering in direct ..." | 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

Reviewed the backend-based collision-filtering change across all 11 manual direct-workflow cloning paths, including the newly added calls in handover and reorient environments, plus the Cartpole regression and changelog fragment. The patch consistently extends filtering from CPU-only execution to every PhysX device while leaving Newton paths unchanged.

  • Design and architecture: Collision filtering remains immediately after cloner.replicate() and before scene registration. Gating on scene.physics_backend rather than the simulation device aligns the behavior with the PhysX replication mechanism without altering Newton execution.
  • API: No public signatures, exports, configuration fields, or defaults change. Existing filtering calls preserve their global terrain or ground paths, while newly added calls use the ground prims spawned by their environments or an empty global path list where no ground is spawned.
  • Implementation: The changed setup paths and their ground or terrain prims were traced across all 11 environment files. The Cartpole test directly exercises CUDA PhysX replicas under constant effort and checks both acceleration and cross-environment consistency. Non-blocking tradeoffs are the test's intentional cuda:0 dependency and the pre-existing argument-free filter_collisions() call in Factory, which is now also exercised on CUDA PhysX.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

Record the per-environment collision groups introduced by the direct-task filtering fix so rendering correctness tests validate the intended stage.
@kellyguo11 kellyguo11 moved this to In review in Isaac Lab Aug 3, 2026
@@ -0,0 +1,49 @@
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).

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.

Is this test necessary? I think there are other tests (test_environments) that already provide this coverage

@AntoineRichard AntoineRichard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Agree with @StafaH on the test

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

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

3 participants