[FEATURE] IPC Robot-Cloth Coupling #2352
Merged
duburcqa merged 4 commits intoGenesis-Embodied-AI:mainfrom Feb 18, 2026
Merged
Conversation
alanray-tech
commented
Feb 3, 2026
Contributor
Author
There was a problem hiding this comment.
Add a test assertion:
The cloth is free falling, so every vertex can be predicted manually.
and
Check it with proper tolerance.
ACMLCZH
reviewed
Feb 17, 2026
duburcqa
added a commit
to duburcqa/Genesis
that referenced
this pull request
Feb 17, 2026
Add IPCCoupler as a new coupler plugin for Incremental Potential Contact simulation using libuipc. This enables cloth, FEM, and rigid body contact resolution through the UIPC engine. - Add FEM.Cloth thin shell material with thickness and bending_stiffness - Add IPCCouplerOptions to configure IPC solver parameters - Add IPCCoupler with zero-copy data transfer to/from UIPC - Extend rigid solver to use SAP-like velocity/position split for IPC - Skip FEM solver physics when IPC is active (IPC handles it) - Add 5 IPC examples: cloth draping, grasping, arm+cloth, cloth band twisting, and rigid-FEM contact - Add IPC unit tests preserving original PR Genesis-Embodied-AI#2352 test scenarios - Register IPC examples in test_examples.py with uipc dependency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
duburcqa
added a commit
to duburcqa/Genesis
that referenced
this pull request
Feb 17, 2026
Add IPCCoupler as a new coupler plugin for Incremental Potential Contact simulation using libuipc. This enables cloth, FEM, and rigid body contact resolution through the UIPC engine. - Add FEM.Cloth thin shell material with thickness and bending_stiffness - Add IPCCouplerOptions to configure IPC solver parameters - Add IPCCoupler with zero-copy data transfer to/from UIPC - Extend rigid solver to use SAP-like velocity/position split for IPC - Skip FEM solver physics when IPC is active (IPC handles it) - Add 5 IPC examples: cloth draping, grasping, arm+cloth, cloth band twisting, and rigid-FEM contact - Add IPC unit tests preserving original PR Genesis-Embodied-AI#2352 test scenarios - Register IPC examples in test_examples.py with uipc dependency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
duburcqa
added a commit
to duburcqa/Genesis
that referenced
this pull request
Feb 17, 2026
Add IPCCoupler as a new coupler plugin for Incremental Potential Contact simulation using libuipc. This enables cloth, FEM, and rigid body contact resolution through the UIPC engine. - Add FEM.Cloth thin shell material with thickness and bending_stiffness - Add IPCCouplerOptions to configure IPC solver parameters - Add IPCCoupler with zero-copy data transfer to/from UIPC - Extend rigid solver to use SAP-like velocity/position split for IPC - Skip FEM solver physics when IPC is active (IPC handles it) - Add 5 IPC examples: cloth draping, grasping, arm+cloth, cloth band twisting, and rigid-FEM contact - Add IPC unit tests preserving original PR Genesis-Embodied-AI#2352 test scenarios - Register IPC examples in test_examples.py with uipc dependency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
duburcqa
added a commit
to duburcqa/Genesis
that referenced
this pull request
Feb 17, 2026
Add IPCCoupler as a new coupler plugin for Incremental Potential Contact simulation using libuipc. This enables cloth, FEM, and rigid body contact resolution through the UIPC engine. - Add FEM.Cloth thin shell material with thickness and bending_stiffness - Add IPCCouplerOptions to configure IPC solver parameters - Add IPCCoupler with zero-copy data transfer to/from UIPC - Extend rigid solver to use SAP-like velocity/position split for IPC - Skip FEM solver physics when IPC is active (IPC handles it) - Add 5 IPC examples: cloth draping, grasping, arm+cloth, cloth band twisting, and rigid-FEM contact - Add IPC unit tests preserving original PR Genesis-Embodied-AI#2352 test scenarios - Register IPC examples in test_examples.py with uipc dependency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
duburcqa
added a commit
to duburcqa/Genesis
that referenced
this pull request
Feb 17, 2026
Add IPCCoupler as a new coupler plugin for Incremental Potential Contact simulation using libuipc. This enables cloth, FEM, and rigid body contact resolution through the UIPC engine. - Add FEM.Cloth thin shell material with thickness and bending_stiffness - Add IPCCouplerOptions to configure IPC solver parameters - Add IPCCoupler with zero-copy data transfer to/from UIPC - Extend rigid solver to use SAP-like velocity/position split for IPC - Skip FEM solver physics when IPC is active (IPC handles it) - Add 5 IPC examples: cloth draping, grasping, arm+cloth, cloth band twisting, and rigid-FEM contact - Add IPC unit tests preserving original PR Genesis-Embodied-AI#2352 test scenarios - Register IPC examples in test_examples.py with uipc dependency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
duburcqa
added a commit
to duburcqa/Genesis
that referenced
this pull request
Feb 17, 2026
Add IPCCoupler as a new coupler plugin for Incremental Potential Contact simulation using libuipc. This enables cloth, FEM, and rigid body contact resolution through the UIPC engine. - Add FEM.Cloth thin shell material with thickness and bending_stiffness - Add IPCCouplerOptions to configure IPC solver parameters - Add IPCCoupler with zero-copy data transfer to/from UIPC - Extend rigid solver to use SAP-like velocity/position split for IPC - Skip FEM solver physics when IPC is active (IPC handles it) - Add 5 IPC examples: cloth draping, grasping, arm+cloth, cloth band twisting, and rigid-FEM contact - Add IPC unit tests preserving original PR Genesis-Embodied-AI#2352 test scenarios - Register IPC examples in test_examples.py with uipc dependency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
duburcqa
added a commit
to duburcqa/Genesis
that referenced
this pull request
Feb 17, 2026
Add IPCCoupler as a new coupler plugin for Incremental Potential Contact simulation using libuipc. This enables cloth, FEM, and rigid body contact resolution through the UIPC engine. - Add FEM.Cloth thin shell material with thickness and bending_stiffness - Add IPCCouplerOptions to configure IPC solver parameters - Add IPCCoupler with zero-copy data transfer to/from UIPC - Extend rigid solver to use SAP-like velocity/position split for IPC - Skip FEM solver physics when IPC is active (IPC handles it) - Add 5 IPC examples: cloth draping, grasping, arm+cloth, cloth band twisting, and rigid-FEM contact - Add IPC unit tests preserving original PR Genesis-Embodied-AI#2352 test scenarios - Register IPC examples in test_examples.py with uipc dependency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
duburcqa
added a commit
to duburcqa/Genesis
that referenced
this pull request
Feb 17, 2026
Add IPCCoupler as a new coupler plugin for Incremental Potential Contact simulation using libuipc. This enables cloth, FEM, and rigid body contact resolution through the UIPC engine. - Add FEM.Cloth thin shell material with thickness and bending_stiffness - Add IPCCouplerOptions to configure IPC solver parameters - Add IPCCoupler with zero-copy data transfer to/from UIPC - Extend rigid solver to use SAP-like velocity/position split for IPC - Skip FEM solver physics when IPC is active (IPC handles it) - Add 5 IPC examples: cloth draping, grasping, arm+cloth, cloth band twisting, and rigid-FEM contact - Add IPC unit tests preserving original PR Genesis-Embodied-AI#2352 test scenarios - Register IPC examples in test_examples.py with uipc dependency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ACMLCZH
reviewed
Feb 18, 2026
duburcqa
added a commit
to duburcqa/Genesis
that referenced
this pull request
Feb 18, 2026
Adapts the original PR Genesis-Embodied-AI#2352 tests to the refactored API plus one additional test: 1. test_ipc_cloth (n_envs=[0, 2]): cloth + rigid (two_way) + FEM ball. Per-step kinematic validation (10 steps, 1% tolerance). 2. test_ipc_cloth_gravity_freefall (n_envs=[0]): cloth free-fall, no ground. Displacement = 0.5 * g * t^2 over 50 steps (1% tolerance). 3. test_ipc_two_way_revolute (n_envs=[0]): revolute URDF robot, 100 steps, sinusoidal joint target. Checks Genesis ↔ IPC transform consistency when coupler exposes abd_data_by_link (< 1 mm pos, < 0.1 rad rot). 4. test_ipc_two_way_prismatic (n_envs=[0]): same as above for prismatic joint. 5. test_ipc_rigid_fem_contact (n_envs=[0, 2]): needs_coup=False exclusion (box falls through ground) + FEM ball ground contact (no penetration). API changes applied vs original PR: - Removed from IPCCouplerOptions: dt, gravity, contact_friction_mu, IPC_self_contact, two_way_coupling, disable_genesis_contact, enable_ipc_gui. - Added enable_abd_self_contact=False where IPC_self_contact=False was used. - Replaced set_entity_coupling_type() calls with coupling_mode="two_way" on Rigid material. - Replaced _ipc_scene with _scene (coupler attribute name). - Module-level uipc import via pytest.importorskip. Code quality: top-level numpy import, shared helpers (_get_cloth_vertex_positions, _rotmat_to_euler) extracted as module-level functions, fixed f-string print bugs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
duburcqa
added a commit
to duburcqa/Genesis
that referenced
this pull request
Feb 18, 2026
Adapts the original PR Genesis-Embodied-AI#2352 tests to the refactored API plus one additional test: 1. test_ipc_cloth (n_envs=[0, 2]): cloth + rigid (two_way) + FEM ball. Per-step kinematic validation (10 steps, 1% tolerance). 2. test_ipc_cloth_gravity_freefall (n_envs=[0]): cloth free-fall, no ground. Displacement = 0.5 * g * t^2 over 50 steps (1% tolerance). 3. test_ipc_two_way_revolute (n_envs=[0]): revolute URDF robot, 100 steps, sinusoidal joint target. Checks Genesis ↔ IPC transform consistency when coupler exposes abd_data_by_link (< 1 mm pos, < 0.1 rad rot). 4. test_ipc_two_way_prismatic (n_envs=[0]): same as above for prismatic joint. 5. test_ipc_rigid_fem_contact (n_envs=[0, 2]): needs_coup=False exclusion (box falls through ground) + FEM ball ground contact (no penetration). API changes applied vs original PR: - Removed from IPCCouplerOptions: dt, gravity, contact_friction_mu, IPC_self_contact, two_way_coupling, disable_genesis_contact, enable_ipc_gui. - Added enable_abd_self_contact=False where IPC_self_contact=False was used. - Replaced set_entity_coupling_type() calls with coupling_mode="two_way" on Rigid material. - Replaced _ipc_scene with _scene (coupler attribute name). - Module-level uipc import via pytest.importorskip. Code quality: top-level numpy import, shared helpers (_get_cloth_vertex_positions, _rotmat_to_euler) extracted as module-level functions, fixed f-string print bugs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4e99c70 to
f9a0065
Compare
|
🔴 Benchmark Regression Detected ➡️ Report |
03b5fb1 to
bcf6f1c
Compare
53a3ab2 to
c8d8845
Compare
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR refactors the IPC (Incremental Potential Contact) coupler implementation from a monolithic single-file structure into a modular package architecture. The main changes include:
Code organization: Split
genesis/engine/couplers/ipc_coupler.pyinto a well-organized package structure:genesis/engine/couplers/ipc_coupler/coupler.py: MainIPCCouplerclass with core coupling logicgenesis/engine/couplers/ipc_coupler/data.py: Data-oriented classes for Taichi field management (IPCTransformData,IPCCouplingData)genesis/engine/couplers/ipc_coupler/utils.py: Stateless utility functions for transform computation, entity categorization, and scene configurationgenesis/engine/couplers/ipc_coupler/__init__.py: Module exportsExample updates: Updated all IPC examples to work with the new package structure:
examples/IPC_Solver/ipc_cloth.pyexamples/IPC_Solver/ipc_grasp.pyexamples/IPC_Solver/ipc_arm_cloth.pyexamples/IPC_Solver/genesis_ipc_motion_test.pyexamples/IPC_Solver/ipc_twist_cloth_band.py(deprecated example)Asset additions: Added
genesis/assets/xml/franka_emika_panda/panda_non_overlap.xmlfor improved robot model supportConfiguration updates: Enhanced
IPCCouplerOptionsingenesis/options/solvers.pywith additional configuration parametersTest compatibility: Updated
tests/test_ipc.pyto work with the new package structureMotivation and Context
The original IPC coupler implementation was contained in a single thousand-line file, making it difficult to:
By organizing the code into a modular package structure with clear separation of concerns:
data.py): Isolated Taichi field definitions and data structurescoupler.py): Main coupling algorithms and state managementutils.py): Reusable helper functions that can be tested independentlyHow Has This Been / Can This Be Tested?
Testing approach:
Unit tests: Run the existing IPC test suite:
Example verification: Test all IPC examples to ensure they work with the refactored code:
Checklist:
Submitting Code Changessection of CONTRIBUTING document.