Introduces a new "strain" equality mode (flex_edgeequality = 3) for flexcomps with trilinear interpolation. This mode enforces constraints on the three invariants of the Green-Lagrange strain tensor at 8 Gauss quadrature points within each flex element, resulting in 24 equality constraints per flexcomp.

Also fixes a bug when attaching a flex with constraints.

PiperOrigin-RevId: 881349765
Change-Id: I8e6df8239488bfdc87d7e5b473568975e38c737e
This commit is contained in:
Alessio Quaglino
2026-03-10 04:25:19 -07:00
committed by Copybara-Service
parent fe6c81ed93
commit 713b5524bc
23 changed files with 899 additions and 48 deletions
+64
View File
@@ -0,0 +1,64 @@
<!-- Copyright 2026 DeepMind Technologies Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<mujoco model="Gripper">
<include file="scene.xml"/>
<option cone="elliptic" impratio="10" integrator="implicitfast"/>
<worldbody>
<body>
<freejoint/>
<geom type="box" size=".46 .5 .4" pos="0 0 1.5" rgba=".5 .5 0 1" condim="6"/>
</body>
<body name="column_00" pos=".7 .4 .5">
<geom type="box" size=".1 .1 .5" rgba=".2 .2 .2 1"/>
<flexcomp type="box" pos="-.24 0 .1" dim="3" spacing=".03 .01 .01"
radius=".001" rgba="0 .7 .7 1" mass=".5" name="left" dof="trilinear">
<edge equality="strain"/>
<contact selfcollide="none" internal="false" friction="3"/>
<pin id="4 5 6 7"/>
</flexcomp>
</body>
<body name="column_01" pos=".7 -.4 .5">
<geom type="box" size=".1 .1 .5" rgba=".2 .2 .2 1"/>
<flexcomp type="box" pos="-.24 0 .1" dim="3" spacing=".03 .01 .01"
radius=".001" rgba="0 .7 .7 1" mass=".5" name="right" dof="trilinear">
<edge equality="strain"/>
<contact selfcollide="none" internal="false" friction="3"/>
<pin id="4 5 6 7"/>
</flexcomp>
</body>
<body name="column_02" pos=" -.7 .4 .5">
<geom type="box" size=".1 .1 .5" rgba=".2 .2 .2 1"/>
<flexcomp type="box" pos=".24 0 .1" dim="3" spacing=".03 .01 .01"
radius=".001" rgba="0 .7 .7 1" mass=".5" name="bottom" dof="trilinear">
<edge equality="strain"/>
<contact selfcollide="none" internal="false" friction="3"/>
<pin id="0 1 2 3"/>
</flexcomp>
</body>
<body name="column_03" pos="-.7 -.4 .5">
<geom type="box" size=".1 .1 .5" rgba=".2 .2 .2 1"/>
<flexcomp type="box" pos=".24 0 .1" dim="3" spacing=".03 .01 .01"
radius=".001" rgba="0 .7 .7 1" mass=".5" name="top" dof="trilinear">
<edge equality="strain"/>
<contact selfcollide="none" internal="false" friction="3"/>
<pin id="0 1 2 3"/>
</flexcomp>
</body>
</worldbody>
</mujoco>