feat(lekiwi): release V0.10.1 初步集成 LeKiwi,优化碰撞模型
web-platform-ci / TypeScript, lint, unit, build (push) Has been cancelled
web-platform-ci / Playwright E2E (push) Has been cancelled
lekiwi-compatibility / cpu-compatibility (push) Has been cancelled

集成通用机器人数值接口、本机控制桥、LeRobot 插件和统一键盘遥操作。采用离线 CoACD 全臂碰撞配方 revision 4、局部装配区切分与结构自接触,限制直接关节位姿写入并保留安全看门狗。同步版本号、变更记录、来源许可证和兼容性验证。
This commit is contained in:
2026-09-20 14:42:30 +08:00
parent da4d59c31a
commit 3ad29356c9
103 changed files with 23055 additions and 280 deletions
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+52
View File
@@ -0,0 +1,52 @@
# LeKiwi 碰撞数据来源与重建
## 当前配方:revision 4
`lekiwi-full-collision.json` 是 [SIGRobotics-UIUC/LeKiwi](https://github.com/SIGRobotics-UIUC/LeKiwi) 的派生模型数据,来源 revision 为 `efa608d7ee5a495a4803b1d28cd0c955b4f1e033`,按 [Apache-2.0](LeKiwi.LICENSE.txt) 分发。固定 URDF/STL SHA-256 与装配例外配置见 `lekiwi-collision-source.json`,生成结果也保存完整 `source`。
本项目修改:从 `Base_08q-v1` 子树的**全部 18 个视觉网格**离线 CoACD 得到 538 个凸包,再按装配配合区切分为 1,220 个独立碰撞凸包,包含固定焊接的舵机、安装板、相机支架及相机外壳;替代旧臂胶囊和手工分段配方。此处“整臂”不包含底盘/全向轮;它们仍使用独立简化配方。
- 使用 [CoACD](https://github.com/SarahWeiii/CoACD) 1.0.14,`real_metric=true`、`threshold=0.003`、固定 seed=42、4 个 OpenMP 线程,CoACD 阶段每包最多 96 个顶点,切分后预算为 256(当前最多 167);完整参数和版本存入 `generator`。**3 mm 是分解参数,不是已证明的全表面误差上限。**
- 输入按 URDF `scale` 转成米,输出保留原视觉网格局部坐标、顶点取整到 1 μm。运行时继承 visual geom 的 body/pose,不跨越两指合成凸包;碰撞体 `mass=0`,沿用显式惯性估计。
- 浏览器只读取生成数据,导入时校验源 STL 哈希、视觉覆盖清单和运动刚体归属;不会在线运行 CoACD,也不修改参考仓库、训练或 LeRobot 环境。
- 配方使用 1 ms 物理步长、CAD 接触 `solref=".002 1"`;不是加大安全超时或放宽关节范围。几何、关节过滤和这些接触参数共同形成 `recipeSha256`,导出 MJCF 携带 revision 与配方指纹。标记用于兼容性检查,不是防篡改签名。
### 相邻关节不能整对排除
MuJoCo 的默认父子过滤保持开启;显式加入 **5,581 对结构凸包接触**,包括 `Mirror / Square` 和两指指面。没有整对相邻 body 的 `<exclude>`。
唯一局部装配例外:一个**完整凸包**必须落在该关节审核过的轴承/舵机配合圆柱内,才可忽略它与直接相邻运动组的配合接触。半径分别为肩旋 23、肩俯仰/肘/夹爪 18.5、腕俯仰 16、腕旋 12.1 mm,轴向半长 55 mm;不是“中立位重叠就排除”。这些部件与外界及其他非相邻臂段仍参与碰撞。
跨越配合区边界的凸包先按内接 16 边棱柱切开(2 μm 内缩以容纳取整误差),**配合区和外侧各片都保留**,不挖掉对外碰撞几何。生成器检查切分体积的量化误差;单测覆盖体积保持和内部/结构区分类。否则同一个凸包跨越轴承与结构区,即使中立位不碰撞,转动后仍可能误锁轴承。CAD 审核在肩旋约 0.35 rad 发现了这种情况;修复后真实 WASM 肩旋可双向到达 ±0.942 rad,且没有配合区接触。
另外以整周旋转的轴向/径向包络保守剔除不可能相交的凸包对,保留 0.1 mm 数值余量。各关节的成员、显式接触对、配合例外/扫掠剔除数量都在 `jointPolicy`,改参数后必须重新审核和跑物理回归,不能只改指纹。
### 离线环境和重建
从仓库根目录执行,先按 [示例说明](../examples/lekiwi/README.md) 准备固定源资产:
```bash
python3 -m venv build/venvs/collision
env -u PYTHONPATH PYTHONNOUSERSITE=1 build/venvs/collision/bin/python \
-m pip install -r examples/lekiwi/requirements-collision.txt
env -u PYTHONPATH PYTHONNOUSERSITE=1 build/venvs/collision/bin/python \
examples/lekiwi/generate_full_collisions.py --check
# 确需写入重建数据时去掉 --check
```
默认源目录 `build/lekiwi/URDF`,缓存 `build/collision-cache`,均可通过 CLI 覆盖。缓存键包含源 STL 哈希、缩放、工具版本、参数与线程数;关节过滤每次重算。`--check` 比较完整生成结果,不改已发布 JSON;使用新的 `--cache` 目录可验证从零分解,而非只命中缓存。本机已完成一次无缓存重建一致性验证,不承诺任意平台/工具版本逐字节相同。
```bash
env -u PYTHONPATH PYTHONNOUSERSITE=1 build/venvs/collision/bin/python \
-m unittest discover -s examples/lekiwi/tests -v
```
生成器拒绝缺失/变更源、非法缩放、退化凸包、超预算包数/顶点数及采样覆盖不合格。`coverage.coacdSampleOutsidePlanesMaxM` 是抽样点相对 CoACD 阶段凸包平面的诊断值,**不是 Hausdorff 距离或连续全表面保证**。`coverage.coacdParts/parts` 分别记录切分前后数量。浏览器额外从原始 STL 独立取每个视觉网格的六向极值,做 108 次球体接触探测;另测六关节双向目标扫掠、相邻连杆主体阻挡/脱离、中立位、两指空隙/物体阻挡及真实 60 秒控制性能。仍未穷举多关节配置空间。
### 历史数据
`lekiwi-gripper-collision.json` / `generate_gripper_collisions.py`(revision 2)和 `lekiwi-arm-collision.json` / `generate_arm_collisions.py`(revision 3)保留历史重建用途,同样源自上述 Apache-2.0 资产;当前前端不再导入它们。旧方案是 STL 平面裁剪、1 mm 接缝重叠后取凸包,并非 CoACD。
旧 MJCF(包括 revision 3)必须从原始 URDF 重新转换。自动凸分解、局部装配例外和软接触仍是近似,不保证所有薄壁间隙、任意高速动作、可靠抓取或实体标定;观察到提前接触时,应检查具名接触对与原 CAD,不能靠扩大 body 排除或关闭自碰撞掩盖。当前仅支持上述固定 LeKiwi 资产,不是任意 URDF 的免审核导入开关。
开发期强制把 qpos 写入严重重叠姿态的几何查询曾使 WASM 触及 2 GiB 内存上限并原生中止;这不是支持的控制路径,也未在此修复引擎本身。profile 的普通关节编辑入口已禁止瞬移;验收使用有界执行器运动、正常初始姿态和有限场景,不能由此承诺任意穿透初态稳定。诊断失败记录保存在 `build/e2e/lekiwi-full-collision-geometry-diagnostic/`。
File diff suppressed because one or more lines are too long
@@ -0,0 +1,60 @@
{
"repository": "https://github.com/SIGRobotics-UIUC/LeKiwi",
"revision": "efa608d7ee5a495a4803b1d28cd0c955b4f1e033",
"urdfSha256": "36e102375e1e6ffdc1ca2d343c7406284b3cabc77ae16bfc001a3da89fddc6e1",
"license": "Apache-2.0",
"lerobotVersion": "0.6.1",
"rootLink": "Base_08q-v1",
"meshes": {
"meshes/Base_08q-v1.stl": "a05be37db52657615ac69423fe577979efa0cd0634a5e9546bbc85537f003172",
"meshes/WaveShare_Mounting_Plate_01d-v1.stl": "abde2af470078f125c6e001e64abcae7c4307bff02f27c3a10dc2a87f7039bed",
"meshes/Rotation_Pitch_08i-v1.stl": "747a37e0c99c8fa85ad52ccf9fbfbb945468d8f9f590a1b7faadf5188d741ba9",
"meshes/STS3215_03a-v1.stl": "07695009c2e9ef352787fe98814d85eb936228a1843a0c76d22ab1bb3d37eb92",
"meshes/SO_ARM100_08k_Asym_Mirror_Clip-v1.stl": "0f336a7f3940c943554252032ae8e351196353b8aa983827f045c4d7aa4cc52d",
"meshes/Passive_Horn_01-v1.stl": "fca61eb1fb63b4bb04ff0c80d395ae10ae69787a7da7e15414234d39b8b0ab7d",
"meshes/STS3215_03a-v1-1.stl": "07695009c2e9ef352787fe98814d85eb936228a1843a0c76d22ab1bb3d37eb92",
"meshes/SO_ARM100_08k_116_Square-v1.stl": "64fdc308759ff58756e3c39a0ea8018d6b37b551bc3d29238b6e86bc5acae666",
"meshes/STS3215_03a-v1-2.stl": "07695009c2e9ef352787fe98814d85eb936228a1843a0c76d22ab1bb3d37eb92",
"meshes/SO_ARM100_08k_Mirror-v1.stl": "f6a2abf909ddd6e27c6fef5791937497a7686221dc1d877a7b30820b91cc1ca6",
"meshes/STS3215_03a-v1-3.stl": "07695009c2e9ef352787fe98814d85eb936228a1843a0c76d22ab1bb3d37eb92",
"meshes/Wrist_Roll_Pitch_08i-v1.stl": "964cef356d5a120cd7d65018fcbd89a7f2dcd5f7a503d415720f94c452eb5da6",
"meshes/STS3215_03a_Wrist_Roll-v1.stl": "b390f54c455a7900687af22432c8f742f4060d3c1afb90091c2fbf1dc3a9b978",
"meshes/Wrist_Roll_08c-v1.stl": "87507f73f485c2cacb3dc83924a712069fbd68f72b82d4a31a2cfe7f58c9e4c9",
"meshes/STS3215_03a-v1-4.stl": "07695009c2e9ef352787fe98814d85eb936228a1843a0c76d22ab1bb3d37eb92",
"meshes/Moving_Jaw_08d-v1.stl": "71caabee267376791210950b3b4e2f7968d9b57b92ed3f57711c03f2b5666912",
"meshes/Wrist-Camera-Mount-v11.stl": "2bb123c754eff42c57c4605a533b94d14e7b51889a813764f798b7878489a98a",
"meshes/Camera-Model-v3-1.stl": "f5ff94543c19e91a6d5ffb540e2d25347d813d191793405ff2e4178230dec21e"
},
"assemblyCores": {
"arm_shoulder_pan": {
"radiusM": 0.023,
"axialHalfExtentM": 0.055,
"reason": "Bounded mating envelope with straddling hull partitioning: CAD clearance audit found a false bearing contact at radius 19.1mm; verify both pan directions remain free, while outside-core structural contacts stay enabled."
},
"arm_shoulder_lift": {
"radiusM": 0.0185,
"axialHalfExtentM": 0.055,
"reason": "Adjacent joint bearing/servo mating core only; outside-core structural hull pairs remain enabled."
},
"arm_elbow_flex": {
"radiusM": 0.0185,
"axialHalfExtentM": 0.055,
"reason": "Adjacent joint bearing/servo mating core only; outside-core structural hull pairs remain enabled."
},
"arm_wrist_flex": {
"radiusM": 0.016,
"axialHalfExtentM": 0.055,
"reason": "Adjacent joint bearing/servo mating core only; outside-core structural hull pairs remain enabled."
},
"arm_wrist_roll": {
"radiusM": 0.0121,
"axialHalfExtentM": 0.055,
"reason": "Adjacent joint bearing/servo mating core only; outside-core structural hull pairs remain enabled."
},
"arm_gripper": {
"radiusM": 0.0185,
"axialHalfExtentM": 0.055,
"reason": "Adjacent joint bearing/servo mating core only; outside-core structural hull pairs remain enabled."
}
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+98
View File
@@ -0,0 +1,98 @@
{
"id": "lekiwi-v1",
"version": 1,
"source": {
"repository": "https://github.com/SIGRobotics-UIUC/LeKiwi",
"revision": "efa608d7ee5a495a4803b1d28cd0c955b4f1e033",
"urdfSha256": "36e102375e1e6ffdc1ca2d343c7406284b3cabc77ae16bfc001a3da89fddc6e1",
"license": "Apache-2.0",
"lerobotVersion": "0.6.1"
},
"baseBody": "base_plate_layer1-v5",
"frame": "x-forward-y-left-z-up",
"mapping": {
"cadYawRad": -1.5707963267948966,
"armSigns": [1, 1, 1, 1, 1],
"armOffsetsRad": [0, 0, 0, 0, 0],
"gripperAxisSign": -1
},
"controlHz": 30,
"watchdogMs": 500,
"wheelRadius": 0.05,
"baseRadius": 0.125,
"wheelMaxRadS": 4.601942363656923,
"baseLinearLimit": 0.2,
"baseAngularLimit": 1.0471975511965976,
"wheels": ["base_left_wheel", "base_back_wheel", "base_right_wheel"],
"arm": [
{
"joint": "arm_shoulder_pan",
"min": -1.57,
"max": 1.57,
"neutral": 0,
"kp": 40,
"kv": 3,
"force": 8
},
{
"joint": "arm_shoulder_lift",
"min": -1.4,
"max": 1.4,
"neutral": 0,
"kp": 60,
"kv": 4,
"force": 10
},
{
"joint": "arm_elbow_flex",
"min": -1.4,
"max": 1.4,
"neutral": 0,
"kp": 50,
"kv": 3,
"force": 8
},
{
"joint": "arm_wrist_flex",
"min": -1.4,
"max": 1.4,
"neutral": 0,
"kp": 30,
"kv": 2,
"force": 5
},
{
"joint": "arm_wrist_roll",
"min": -3.14,
"max": 3.14,
"neutral": 0,
"kp": 20,
"kv": 1,
"force": 3
},
{
"joint": "arm_gripper",
"min": -0.18,
"max": 0.9,
"neutral": 0,
"kp": 15,
"kv": 1,
"force": 2
}
],
"simulation": {
"baseMass": 2.2,
"baseInertia": [0.014, 0.014, 0.022],
"armMasses": [0.1, 0.25, 0.22, 0.08, 0.09, 0.025],
"wheelMass": 0.06,
"rollerCount": 12,
"rollerMass": 0.003,
"wheelKv": 0.5,
"wheelTorqueLimit": 2.0
},
"parameterNotes": {
"kinematics": "Wheel radius/base radius and proportional wheel saturation follow LeRobot 0.6.1; raw 3000 ticks/s converts to wheelMaxRadS. CAD frame mapping is explicit in model enhancement. The CAD gripper axis is reversed so increasing canonical angle opens the jaws; the -0.18 rad closing limit leaves approximately 0.5 mm fingertip clearance.",
"dynamics": "Simulation-only estimated collision, mass, inertia, joint limits and servo gains. NOT measured hardware calibration or a sim-to-real model.",
"scope": "Flat ground low-speed control; no cameras, training, rough terrain or reliable grasping claim."
}
}