Allow contact sensor subtree1/subtree2 to be any body.

PiperOrigin-RevId: 799632590
Change-Id: If9cd6c5a3a5f83d89ae024a8f64232ab1f1d603a
This commit is contained in:
Yuval Tassa
2025-08-26 10:59:44 -07:00
committed by Copybara-Service
parent 9eaa31af2f
commit 7443e685ac
7 changed files with 64 additions and 32 deletions
+28
View File
@@ -0,0 +1,28 @@
<mujoco model="contact subtree">
<worldbody>
<light pos="0 0 5"/>
<geom name="floor" type="plane" size="2 2 .01"/>
<body name="thigh" pos="-1 0 .1">
<joint type="slide"/>
<geom type="capsule" size=".1" fromto="0 0 0 .5 0 0"/>
<body name="shin" pos=".7 0 0">
<joint axis="0 1 0"/>
<geom type="capsule" size=".1" fromto="0 0 0 0 0 .5"/>
<body name="foot" pos="0 0 .7">
<joint axis="0 1 0"/>
<geom type="capsule" size=".1" fromto="0 0 0 -.7 0 0"/>
</body>
</body>
</body>
</worldbody>
<sensor>
<contact name="all"/>
<contact name="world" subtree1="world"/>
<contact name="thigh" subtree1="thigh"/>
<contact name="shin" subtree1="shin"/>
<contact name="foot" subtree1="foot"/>
<contact name="foot_w" subtree1="foot" body2="world"/>
<contact name="foot_w2" subtree1="foot" subtree2="world"/>
</sensor>
</mujoco>