Skip to content

flex-flex collisions - #1496

Open
thowell wants to merge 1 commit into
google-deepmind:mainfrom
thowell:flexflexcollision
Open

flex-flex collisions#1496
thowell wants to merge 1 commit into
google-deepmind:mainfrom
thowell:flexflexcollision

Conversation

@thowell

@thowell thowell commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

add flex-flex collisions


<mujoco model="flex_flex">
  <include file="scene.xml"/>
  <option solver="CG" tolerance="1e-6" timestep="0.001" integrator="Euler"/>
  <size nconmax="40000" njmax="20000"/>

  <worldbody>
    <camera pos="0 -1.5 0.5" euler="70 0 0 "/>

    <!-- Cube 1: Resting on the plane -->
    <flexcomp name="cube1" type="grid" count="8 8 8" spacing="0.07 0.07 0.07" pos="-0.2 0 0.27"
              radius="0.001" dim="3" mass="5.0" dof="trilinear">
      <contact selfcollide="none" internal="false"/>
      <elasticity young="1e4" damping="0.01" poisson="0.1"/>
    </flexcomp>

    <!-- Cube 2: Falling from above onto the corner of Cube 1 -->
    <flexcomp name="cube2" type="grid" count="8 8 8" spacing="0.07 0.07 0.07" pos="0.1 0 1.0"
              radius="0.001" dim="3" mass="5.0" dof="trilinear">
      <contact selfcollide="none" internal="false"/>
      <elasticity young="1e4" damping="0.01" poisson="0.1"/>
    </flexcomp>
  </worldbody>
</mujoco>
mjwarp-viewer mujoco_warp/test_data/flex/flex_flex_cubes.xml --nconmax=8192 --njmax=17000 --engine=warp
flexflexcollision.mov

@thowell
thowell force-pushed the flexflexcollision branch 5 times, most recently from 6849f08 to 8cf5098 Compare July 7, 2026 12:03
@thowell
thowell marked this pull request as ready for review July 7, 2026 12:10
@thowell
thowell requested a review from quagla July 7, 2026 12:11
@thowell
thowell force-pushed the flexflexcollision branch 3 times, most recently from 0338059 to 580d0b9 Compare July 11, 2026 15:31
@thowell

thowell commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator Author

@quagla the implementation is updated and it looks like the flex-flex collisions are working correctly now.

2 notes:

  • there is an issue with resets + warmstarts + flex + the viewer -- not sure what the issue is but can follow up in a future pr
  • the existing sap broadphase is silently overflowing as a result we should probably expect some performance regression on the aloha cloth benchmark since we likely need to increase nconmax / naconmax to avoid overflow. can follow up with changes related to that benchmark in a future pr

@thowell
thowell force-pushed the flexflexcollision branch 8 times, most recently from f89580b to 527ff07 Compare July 20, 2026 12:30
Comment thread mujoco_warp/_src/io.py Outdated
Comment thread mujoco_warp/_src/collision_flex.py Outdated
Comment thread mujoco_warp/_src/io.py Outdated
Comment thread mujoco_warp/_src/collision_flex.py Outdated
@thowell
thowell force-pushed the flexflexcollision branch 2 times, most recently from 31fe348 to fc9c43e Compare July 21, 2026 12:22
@thowell
thowell force-pushed the flexflexcollision branch 2 times, most recently from d7f1208 to 6fbbedb Compare July 30, 2026 19:42
@thowell

thowell commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator Author

@kbayes please take a look at the changes to _polytope3. think there is a bug where a vector is not normalized. thanks!

@kbayes

kbayes commented Jul 30, 2026

Copy link
Copy Markdown
Member

@thowell oh yes! I had this fixed in an old PR that I closed but forgot to add the fix back in. Thanks!

@thowell
thowell force-pushed the flexflexcollision branch 2 times, most recently from bd58aae to 6741904 Compare July 31, 2026 15:09
@thowell
thowell force-pushed the flexflexcollision branch from 6741904 to 361d5be Compare July 31, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants