cmvr-es/model/xiaozhao/meshes/visual/README.md

40 lines
2.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# MuJoCo 轻量外观网格
MuJoCo 通过 `xml/xiaozhao.xml` 的 Geom group 1 显示本目录的 18 个减面 STL。
源文件是当前 `urdf/xiaozhao.urdf` 引用的 urdf9 网格,来自上一级 `meshes/` 目录,
包括基座、左右臂各 7 个连杆和 3 个颈部连杆。左右 `link4` 的源网格已对齐现用 URDF 的安装坐标。
本次 urdf9 外观由 1,899,320 个三角面减至 525,299 个,减少约 72.34%。每侧手部由 266,586 面减至 21,326 面。
颈部 J3 origin 为 `(0, 0.0035, -0.035) m`,头部相机挂在 `neck_Link3` 的
`(0.0325, 0.10347742, 0.08039297) m`,零位朝 Base `+X`、向下约 30.9°。
右手源 STL 是左手关于局部 XY 平面的镜像。脚本检查两侧源 STL 的三角面,然后对左手减面,
沿 Z 轴反号并反转三角面绕序,得到精确镜像的右手外观。
MuJoCo 的 Geom group 3 用于查看物理接触几何。基座和左右手分别引用
`meshes/base_link.obj`、`meshes/link7-left.obj` 和 `meshes/link7-right.obj`,其余连杆引用 `meshes/*.STL`。
旧的 `hand-right-mirrored` 文件是闲置资产,生成清单只统计 URDF 引用的网格。
在项目根目录重新生成(需要 Blender 4.5,使用其内置 Python/NumPy):
```bash
blender --background --factory-startup --threads 4 --python-exit-code 1 \
--python model/xiaozhao/simplify_visual_meshes.py
```
只重新生成手部时使用:
```bash
blender --background --factory-startup --threads 4 --python-exit-code 1 \
--python model/xiaozhao/simplify_visual_meshes.py -- --hands-only
```
两种命令只写本目录的外观 STL 和 `manifest.json`。手部从原面数的 8% 开始尝试减面,
对当前源与输出网格的全部顶点和三角面中心检查双向表面距离,并检查包围盒端点,阈值为 0.9 mm。
其他连杆从 10% 开始(小网格至少以 2,000 面为目标),对应阈值为 0.5 mm。
若误差过大,脚本会增加保留面数。外观沿用各连杆的局部坐标和米制单位。
`manifest.json` 记录源 STL 的 SHA-256、减面前后的面数、采样最大距离、均方根距离和包围盒端点变化。
这些距离描述所检查的离散样本。
使用源码模型时,重新加载 `model/xiaozhao/xml/scene.xml` 即可查看新的外观。
使用安装版 CMVR 时,先将更新的外观同步到 `output/bin/model/xiaozhao/meshes/visual/`,再重启仿真。