Skip to content

Commit bdccbcc

Browse files
kbayescopybara-github
authored andcommitted
Add multiccd fields to MJX and add simplex box-mesh model.
PiperOrigin-RevId: 813190617 Change-Id: Idc450da59d6420825077a642719525750f6551ec
1 parent 70d03ad commit bdccbcc

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

mjx/mujoco/mjx/_src/types.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,15 @@ class ModelC(PyTreeNode):
615615
D_colind: jax.Array # pylint:disable=invalid-name
616616
mapM2D: jax.Array # pylint:disable=invalid-name
617617
mapD2M: jax.Array # pylint:disable=invalid-name
618+
mesh_polynum: jax.Array
619+
mesh_polyadr: jax.Array
620+
mesh_polynormal: jax.Array
621+
mesh_polyvertadr: jax.Array
622+
mesh_polyvertnum: jax.Array
623+
mesh_polyvert: jax.Array
624+
mesh_polymapadr: jax.Array
625+
mesh_polymapnum: jax.Array
626+
mesh_polymap: jax.Array
618627

619628

620629
class ModelJAX(PyTreeNode):
@@ -649,6 +658,9 @@ class Model(PyTreeNode):
649658
nmeshtexcoord: int
650659
nmeshface: int
651660
nmeshgraph: int
661+
nmeshpoly: int
662+
nmeshpolyvert: int
663+
nmeshpolymap: int
652664
nhfield: int
653665
nhfielddata: int
654666
ntex: int
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<mujoco model="Box mesh with multiccd">
2+
<option>
3+
<flag multiccd="enable"/>
4+
</option>
5+
6+
<asset>
7+
<mesh name="box"
8+
vertex="-1 -1 -1
9+
1 -1 -1
10+
1 1 -1
11+
1 1 1
12+
1 -1 1
13+
-1 1 -1
14+
-1 1 1
15+
-1 -1 1"/>
16+
</asset>
17+
18+
<worldbody>
19+
<geom pos="0 0 -1" type="box" size="5 5 1"/>
20+
<body pos="0 0 0.9999">
21+
<freejoint/>
22+
<geom type="mesh" mesh="box"/>
23+
</body>
24+
</worldbody>
25+
</mujoco>

0 commit comments

Comments
 (0)