Add external sphere and cylinder wrapping for spatial tendons to MJX.

PiperOrigin-RevId: 681808698
Change-Id: I37612e2c6b781b759f9009e1bc6ae10b4e861c8d
This commit is contained in:
Taylor Howell
2024-10-03 03:55:17 -07:00
committed by Copybara-Service
parent dfd1f8fefc
commit c7c2edf758
10 changed files with 590 additions and 37 deletions
@@ -0,0 +1,58 @@
<mujoco model="fixed_site_wrap">
<option>
<flag contact="disable" gravity="disable"/>
</option>
<worldbody>
<body>
<joint name="joint0" type="hinge" axis="0 1 0"/>
<geom type="capsule" size="0.05 0.5" fromto="0 0 0 0.5 0 0"/>
<site name="site0" pos="0.25 0 0.1" size="0.025"/>
<geom name="sphere0" type="sphere" pos="0.5 0 0.125" size="0.085"/>
<body pos="0.5 0 0">
<joint name="joint1" type="hinge" axis="0 1 0"/>
<geom type="capsule" size="0.05 0.5" fromto="0 0 0 0.5 0 0"/>
<site name="site1" pos="0.25 0 0.1" size="0.025"/>
<geom name="sphere1" type="sphere" pos="0.5 0 0.125" size="0.085"/>
<body pos="0.5 0 0">
<joint name="joint2" type="hinge" axis="0 1 0"/>
<geom type="capsule" size="0.05 0.5" fromto="0 0 0 0.5 0 0"/>
<site name="site2" pos="0.25 0 0.1" size="0.025"/>
<geom name="cylinder2" type="cylinder" contype="0" conaffinity="0" pos="0.5 0 0.25" euler="90 0 0" size="0.085 0.1"/>
<body pos="0.5 0 0">
<joint name="joint3" type="hinge" axis="0 1 0"/>
<geom type="capsule" size="0.05 0.5" fromto="0 0 0 0.5 0 0"/>
<site name="site3" pos="0.25 0 0.1" size="0.025"/>
</body>
</body>
</body>
</body>
</worldbody>
<tendon>
<spatial width="0.0125">
<site site="site2"/>
<site site="site3"/>
</spatial>
<fixed>
<joint joint="joint0" coef=".1"/>
<joint joint="joint1" coef=".2"/>
<joint joint="joint2" coef=".3"/>
</fixed>
<spatial width="0.0125">
<site site="site0"/>
<geom geom="sphere0"/>
<site site="site1"/>
<geom geom="sphere1"/>
<site site="site2"/>
<geom geom="cylinder2"/>
<site site="site3"/>
</spatial>
<spatial name="tendon2" width="0.0125">
<site site="site0"/>
<geom geom="sphere0"/>
<site site="site2"/>
<geom geom="cylinder2"/>
<site site="site3"/>
</spatial>
</tendon>
</mujoco>
@@ -0,0 +1,54 @@
<mujoco model="site_wrap">
<option>
<flag contact="disable" gravity="disable"/>
</option>
<worldbody>
<light pos="0 0 10"/>
<body>
<joint name="joint0" type="hinge" axis="0 1 0"/>
<geom type="capsule" size="0.05 0.5" fromto="0 0 0 0.5 0 0"/>
<site name="site0" pos="0.25 0 0.1" size="0.025"/>
<geom name="sphere0" type="sphere" pos="0.5 0 0.125" size="0.085"/>
<body pos="0.5 0 0">
<joint name="joint1" type="hinge" axis="0 1 0"/>
<geom type="capsule" size="0.05 0.5" fromto="0 0 0 0.5 0 0"/>
<site name="site1" pos="0.25 0 0.1" size="0.025"/>
<geom name="sphere1" type="sphere" pos="0.5 0 0.125" size="0.085"/>
<body pos="0.5 0 0">
<joint name="joint2" type="hinge" axis="0 1 0"/>
<geom type="capsule" size="0.05 0.5" fromto="0 0 0 0.5 0 0"/>
<site name="site2" pos="0.25 0 0.1" size="0.025"/>
<geom name="cylinder2" type="cylinder" contype="0" conaffinity="0" pos="0.5 0 0.25" euler="90 0 0" size="0.085 0.1"/>
<body pos="0.5 0 0">
<joint name="joint3" type="hinge" axis="0 1 0"/>
<geom type="capsule" size="0.05 0.5" fromto="0 0 0 0.5 0 0"/>
<site name="site3" pos="0.25 0 0.1" size="0.025"/>
</body>
</body>
</body>
</body>
</worldbody>
<tendon>
<spatial width="0.0125">
<site site="site0"/>
<geom geom="sphere0"/>
<site site="site1"/>
<geom geom="sphere1"/>
<site site="site2"/>
<geom geom="cylinder2"/>
<site site="site3"/>
</spatial>
<spatial width="0.0125">
<site site="site2"/>
<site site="site3"/>
</spatial>
<spatial width="0.0125">
<site site="site0"/>
<geom geom="sphere0"/>
<site site="site2"/>
<geom geom="cylinder2"/>
<site site="site3"/>
</spatial>
</tendon>
</mujoco>
@@ -0,0 +1,52 @@
<mujoco model="wrap_sidesite">
<option>
<flag contact="disable" gravity="disable"/>
</option>
<worldbody>
<light pos="0 0 10"/>
<body>
<joint name="joint0" type="hinge" axis="0 1 0"/>
<geom type="capsule" size="0.05 0.5" fromto="0 0 0 0.5 0 0"/>
<site name="site0" pos="0.25 0 0.1" size="0.025"/>
<geom name="sphere0" type="sphere" pos="0.5 0 0.125" size="0.085"/>
<site name="sidesite0" pos="0.5 0 0.25"/>
<body pos="0.5 0 0">
<joint name="joint1" type="hinge" axis="0 1 0"/>
<geom type="capsule" size="0.05 0.5" fromto="0 0 0 0.5 0 0"/>
<site name="site1" pos="0.25 0 0.1" size="0.025"/>
<geom name="sphere1" type="sphere" pos="0.5 0 0.125" size="0.085"/>
<body pos="0.5 0 0">
<joint name="joint2" type="hinge" axis="0 1 0"/>
<geom type="capsule" size="0.05 0.5" fromto="0 0 0 0.5 0 0"/>
<site name="site2" pos="0.25 0 0.1" size="0.025"/>
<geom name="cylinder2" type="cylinder" contype="0" conaffinity="0" pos="0.5 0 0.25" euler="90 0 0" size="0.085 0.1"/>
<site name="sidesite2" pos="0.5 0 0.5"/>
<body pos="0.5 0 0">
<joint name="joint3" type="hinge" axis="0 1 0"/>
<geom type="capsule" size="0.05 0.5" fromto="0 0 0 0.5 0 0"/>
<site name="site3" pos="0.25 0 0.1" size="0.025"/>
</body>
</body>
</body>
</body>
</worldbody>
<tendon>
<spatial width="0.0125">
<site site="site0"/>
<geom geom="sphere0" sidesite="sidesite0"/>
<site site="site1"/>
<geom geom="sphere1"/>
<site site="site2"/>
<geom geom="cylinder2" sidesite="sidesite2"/>
<site site="site3"/>
</spatial>
<spatial width="0.0125">
<site site="site0"/>
<geom geom="sphere0"/>
<site site="site2"/>
<geom geom="cylinder2" sidesite="sidesite2"/>
<site site="site3"/>
</spatial>
</tendon>
</mujoco>