Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions tactile/code/assets/deformable_cloth.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<mujoco model="deformable_cloth">
<!--
可变形布料场景
用于测试柔性织物材质的触觉反馈
-->

<compiler angle="radian" meshdir="." autolimits="true"/>

<option timestep="0.001" iterations="50" solver="Newton" gravity="0 0 -9.81">
<flag warmstart="enable"/>
</option>

<size memory="100M"/>

<visual>
<global offwidth="1920" offheight="1080"/>
<quality shadowsize="4096" offsamples="8"/>
</visual>

<asset>
<!-- 布料材质 - 柔性织物 -->
<texture name="cloth_texture" type="2d" builtin="checker" width="512" height="512"
rgb1="0.8 0.3 0.3" rgb2="0.6 0.2 0.2"/>
<material name="cloth_material" texture="cloth_texture" rgba="0.8 0.3 0.3 1"
specular="0.1" shininess="0.1"/>

<!-- 地面材质 -->
<texture name="grid" type="2d" builtin="checker" width="512" height="512"
rgb1="0.9 0.9 0.9" rgb2="0.7 0.7 0.7"/>
<material name="grid_material" texture="grid" texrepeat="8 8" reflectance="0.1"/>
</asset>

<worldbody>
<!-- 地面 -->
<geom name="floor" type="plane" size="2 2 0.1" material="grid_material"/>

<!-- 灯光 -->
<light directional="true" diffuse="0.8 0.8 0.8" specular="0.3 0.3 0.3" pos="0 0 3" dir="0 0 -1"/>
<light directional="true" diffuse="0.4 0.4 0.4" specular="0.1 0.1 0.1" pos="2 2 2" dir="-1 -1 -1"/>

<!-- 可变形布料 - 使用flex (2D网格),固定四角 -->
<flexcomp name="cloth_sheet" type="grid" count="15 15 1" spacing="0.02 0.02 0.02"
pos="0 0 1.0" radius="0.005" rgba="0.8 0.3 0.3 1"
mass="0.2" dim="2">
<contact friction="0.8" solimp="0.9 0.95 0.001" solref="0.01 1"/>
<edge equality="true" damping="5"/>
<!-- 固定四个角: 顶点索引 0, 14, 210, 224 -->
<pin id="0"/>
<pin id="14"/>
<pin id="210"/>
<pin id="224"/>
</flexcomp>

<!-- 探针 -->
<body name="probe" pos="0 0 1.3">
<freejoint name="probe_joint"/>
<geom name="probe_geom" type="sphere" size="0.015" rgba="0.2 0.6 1 1" mass="0.05"/>
<site name="probe_tip" pos="0 0 -0.015" size="0.01"/>
</body>

</worldbody>

<actuator>
<motor name="probe_x" joint="probe_joint" gear="1 0 0 0 0 0" ctrlrange="-1 1"/>
<motor name="probe_y" joint="probe_joint" gear="0 1 0 0 0 0" ctrlrange="-1 1"/>
<motor name="probe_z" joint="probe_joint" gear="0 0 1 0 0 0" ctrlrange="-1 1"/>
</actuator>

<sensor>
<force name="probe_contact_force" site="probe_tip"/>
</sensor>

</mujoco>