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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4b6da0e
79e17fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# Placement Assets 资产库

这是一个面向机器人仿真与 placement 任务的统一资产库,当前托管在 Hugging Face Dataset:

```text
https://huggingface.co/datasets/yuchi233/Placement_Assets
```

本仓库不是 RoboCasa 的镜像,也不是基于 RoboCasa 单独建立的资产库。RoboCasa、DISCOVERSE、TinyForge、Hunter 和第三方资产站都被视为不同的资产来源,统一纳入同一套存储、命名、索引和溯源规范。

## 当前已入库资产

- RoboCasa 洗碗机 fixture:
  - 路径:`assets/robocasa/raw/fixtures/dishwashers/`
  - 数量:25 个 MJCF 资产
  - 每个资产保留 `model.xml``visuals/` 和本地 `metadata.yaml`
- RoboCasa 洗碗机相关辅助文件:
  - registry:`assets/robocasa/raw/fixtures/fixture_registry/dishwasher.yaml`
  - fixture 实现参考:`docs/source_notes/robocasa/dishwasher_fixture.py`
- DISCOVERSE models 集合:
  - 路径:`assets/discoverse/raw/collections/models/discoverse_models/`
  - 内容:MJCF、URDF、mesh、PNG/reference image 等
  - 处理方式:作为 collection-level asset 入库,内部保持 DISCOVERSE upstream 的 `models/` 目录结构,避免破坏 MJCF include 和 mesh 相对路径

## 统一目录结构

原始资产使用 `raw/`,保留来源结构和相对引用:

```text
assets/<source>/raw/<asset_type>/<category>/<asset_id>/
```

示例:

```text
assets/robocasa/raw/fixtures/dishwashers/Dishwasher031/
```

派生资产使用 `derived/`,用于保存凸分解、collision mesh、清洗结果、格式转换等生成物:

```text
assets/<source>/derived/<asset_type>/<category>/<asset_id>/
```

如果要创建凸分解脚手架,可以先运行:

```bash
python scripts/scaffold_convex_decomposition.py assets/robocasa/raw/fixtures/dishwashers/Dishwasher031
```

大规模 upstream 资产树如果包含大量内部相对引用,也使用 `raw/` 结构,但可作为集合资产保存:

```text
assets/<source>/raw/<asset_type>/<category>/<asset_id>/
```

示例:

```text
assets/discoverse/raw/collections/models/discoverse_models/
├── metadata.yaml
├── mjcf/
├── meshes/
└── urdf/
```

## 命名规则

目录字段:

```text
assets/<source>/raw/<asset_type>/<category>/<asset_id>/
```

- `source`:资产来源,使用小写 snake_case,例如 `robocasa`、`discoverse`、`tinyforge`、`hunter`、`third_party`
- `asset_type`:资产类型,例如 `fixtures``objects``scenes``robots``collections`
- `category`:类别,例如 `dishwashers``models``cups``cabinets`
- `asset_id`:优先保留 upstream 稳定 ID,例如 `Dishwasher031`

全局 asset_id:

```text
<source>.<asset_type>.<category>.<upstream_id>
```

示例:

```text
robocasa.fixtures.dishwashers.Dishwasher031
discoverse.collections.models.discoverse_models
```

## 仓库结构

```text
.
├── AGENTS.md                         # 给 agent / 后续维护者的仓库使用说明
├── README.md                         # 英文 README
├── README_zh.md                      # 中文 README
├── assets/                           # 实际资产文件
│   ├── discoverse/
│   ├── hunter/
│   ├── robocasa/
│   ├── third_party/
│   └── tinyforge/
├── templates/                        # 元数据模板
├── docs/                             # 规范、来源说明、调研记录
│   ├── asset_readiness_classification.md
│   ├── convex_decomposition_spec.md
│   ├── external_source_catalog.md
│   ├── naming_spec.md
│   ├── placement_asset_notes.md
│   ├── primitive_collision_proxy_spec.md
│   ├── structure_mapping.md
│   ├── source_notes/
│   └── storage_spec.md
├── manifest/
│   ├── assets.jsonl                  # 全局资产索引,一行一个资产
│   ├── licenses.yaml                 # license 字典
│   └── sources.yaml                  # 来源与候选第三方来源
└── scripts/
    ├── run_convex_decomposition.py
    ├── run_primitive_collision_proxy.py
    ├── scaffold_convex_decomposition.py
    ├── download_from_hf.sh
    ├── upload_to_hf.sh
    └── validate_asset.py
```

## 索引与 metadata

全局索引文件:

```text
manifest/assets.jsonl
```

每个资产目录也必须包含:

```text
metadata.yaml
```

必需字段包括:

- `asset_id`
- `source`
- `source_asset_id`
- `asset_type`
- `category`
- `format`
- `entry_file`
- `license`
- `origin_url`
- `path`
- `tags`

推荐字段包括:

- `readiness_level`
- `source_commit`
- `retrieval_date`
- `conversion_tool`
- `conversion_notes`
- `raw_sha256`
- `validation_status`

## 原始结构与当前结构映射

如果导入时修改了 upstream 的目录结构,必须记录原始结构和当前结构的对应关系。

统一记录位置:

```text
docs/structure_mapping.md
docs/source_notes/<source>.md
```

当前例子:

```text
DISCOVERSE upstream:
  /home/yuchi/projects/DISCOVERSE/models/

当前仓库:
  assets/discoverse/raw/collections/models/discoverse_models/
```

RoboCasa 洗碗机则是一对一映射:

```text
robocasa/models/assets/fixtures/dishwashers/Dishwasher031/
→ assets/robocasa/raw/fixtures/dishwashers/Dishwasher031/
```

## 资产就绪度 L0–L5

资产存进仓库不代表可以直接用于产数。就绪度单独记录:

- L0:已通过目标任务、机器人 embodiment、policy、verifier 和 episode replay 验收,可稳定产数
- L1:在原仿真器中是完整可运行资产,但尚未适配目标产数链路
- L2:已有 articulated 结构,但物理、碰撞、任务语义等信息不完整
- L3:可动部件已分离,但缺少可靠 joint
- L4:完整静态整件
- L5:原始、缺件、未装配或需要显著修复的静态 mesh

完整标准见:

```text
docs/asset_readiness_classification.md
```

当前状态:

- RoboCasa dishwasher:`L1_candidate`
- DISCOVERSE collection:`L1_L2_candidate_by_subasset`

## 凸分解结果存放方式

凸分解结果属于派生资产,不能覆盖原始 mesh,也不能直接混进 upstream 的 `raw/` 目录。

统一存放路径:

```text
assets/<source>/derived/convex_decompositions/<category>/<asset_id>/
```

示例:

```text
assets/robocasa/derived/convex_decompositions/dishwashers/Dishwasher031_vhacd_v1/
├── metadata.yaml
├── source_refs.yaml
├── meshes/
│   ├── door/
│   │   ├── part_000.obj
│   │   └── part_001.obj
│   └── rack0/
├── mjcf/
│   ├── convex_assets_include.xml
│   ├── convex_geoms_include.xml
│   └── convex_collision_include.xml
└── logs/
    └── decomposition.json
```

其中:

- `metadata.yaml`:记录派生资产 ID、license、来源、算法、参数文件、验证状态
- `source_refs.yaml`:记录对应的原始 asset、原始 XML、原始 mesh 路径
- `meshes/`:保存凸分解后的 convex pieces
- `mjcf/convex_assets_include.xml`:在 MJCF 顶层 include,用来注册 convex part mesh
- `mjcf/convex_geoms_include.xml`:在目标 body 内 include,用来添加 collision geoms
- `mjcf/convex_collision_include.xml`:带 wrapper body 的独立预览/便利 include
- `logs/decomposition.json`:记录 VHACD / CoACD 等工具版本、参数、输入输出 hash
- `logs/parts_summary.csv`:记录每个 part 的 bbox 尺寸、中心、体积、面积、顶点数和面数,方便筛查过小/过大的 collision part

实际运行 CoACD 凸分解:

```bash
pip install trimesh coacd

python scripts/run_convex_decomposition.py \
  assets/robocasa/raw/fixtures/dishwashers/Dishwasher031 \
  --mesh visuals/door.obj \
  --mesh visuals/rack0.obj \
  --variant coacd_v1 \
  --register-manifest
```

MuJoCo 接入方式:

```xml
<!-- MJCF 顶层 -->
<include file="path/to/mjcf/convex_assets_include.xml"/>

<!-- 目标 body 内部 -->
<include file="path/to/mjcf/convex_geoms_include.xml"/>
```

不要直接修改 `raw/` 里的 `model.xml`。如果要替换原始 collision,应该在下游任务工程里选择性 include 派生 collision 文件。

凸分解后的 part 尺寸不能直接通过“目标长度/目标体积”指定,CoACD 主要通过粒度参数间接控制:

```text
--threshold        越小通常越细,part 更多/更小;越大越粗,part 更少/更大
--max-convex-hull  限制最多生成多少个 convex hull;越小越粗
--no-merge         禁止合并 hull,通常会保留更多/更小的 part
--mcts-max-depth   允许更深层递归切分,可能得到更细的结果
--resolution       提高几何采样/细节分辨率
```

粗 collision 示例:

```bash
python scripts/run_convex_decomposition.py <raw_asset_dir> \
  --mesh <mesh.obj> \
  --threshold 0.08 \
  --max-convex-hull 8
```

细 collision 示例:

```bash
python scripts/run_convex_decomposition.py <raw_asset_dir> \
  --mesh <mesh.obj> \
  --threshold 0.02 \
  --max-convex-hull 32 \
  --no-merge \
  --mcts-max-depth 4
```

完整规范见:

```text
docs/convex_decomposition_spec.md
```

该文档包含 `scripts/run_convex_decomposition.py` 的完整使用方法、所有 CLI 参数说明、粗/细分解参数 preset,以及 rack / wire-like 资产的注意事项。

## Primitive collision proxy 结果存放方式

对于洗碗机 rack、钢丝架、栅格、插槽隔板这类 thin rod / wire-like 资产,如果 CoACD / VHACD 会把功能空隙填死,优先使用 primitive collision proxy。

统一存放路径:

```text
assets/<source>/derived/primitive_collision_proxies/<category>/<asset_id>/
```

示例:

```text
assets/robocasa/derived/primitive_collision_proxies/dishwashers/Dishwasher031_rack1_primitive_boxes_v1/
├── metadata.yaml
├── source_refs.yaml
├── README.md
├── REPORT.md
├── proxy/
│   └── primitive_collision_proxy.json
├── mjcf/
│   ├── primitive_geoms_include.xml
│   └── primitive_collision_include.xml
├── curobo/
│   └── primitive_world.yml
└── logs/
    ├── cuboids_summary.csv
    └── proxy_generation.json
```

实际运行示例:

```bash
python scripts/run_primitive_collision_proxy.py \
  assets/robocasa/raw/fixtures/dishwashers/Dishwasher031 \
  --mesh visuals/rack1.obj \
  --variant rack1_primitive_boxes_v1 \
  --segment-length 0.03 \
  --padding 0.001 \
  --min-half-extent 0.0015
```

其中 `proxy/primitive_collision_proxy.json` 是 source of truth,MuJoCo 和 cuRobo 输出都从同一份 JSON 派生。

完整规范和参数说明见:

```text
docs/primitive_collision_proxy_spec.md
```

## 第三方资产规则

第三方来源可以先只记录链接,不下载、不入 manifest。

只有当某个项目、实验、任务或生成场景实际使用了第三方资产时,才把具体使用到的资产复制进本仓库:

```text
assets/third_party/raw/<asset_type>/<category>/<asset_id>/
```

导入时必须记录:

- 原始 URL
- provider / site name
- license
- retrieval date
- source asset ID
- 本地路径
- 转换或清洗步骤
- 必要时记录 hash

候选第三方来源见:

```text
docs/external_source_catalog.md
docs/source_notes/third_party.md
```

重要规则:

- link-only candidate 不写入 `manifest/assets.jsonl`
- 下载数量不等于可生产资产数量
- 来源库总量不能直接相加,必须处理上游派生和重复资产

## 校验

在仓库根目录运行:

```bash
python scripts/validate_asset.py --all
```

当前期望输出:

```text
validated_assets=26
```

也可以校验单个资产:

```bash
python scripts/validate_asset.py assets/robocasa/raw/fixtures/dishwashers/Dishwasher031
```

校验内容包括:

- `metadata.yaml` 是否存在
- `entry_file` 是否存在
- 资产目录是否符合四层结构
- metadata 与目录字段是否一致
- metadata 与 manifest 是否一致
- MJCF 中的 mesh/texture 文件引用是否能解析

## 下载

```bash
export HF_ENDPOINT=https://hf-mirror.com

hf download yuchi233/Placement_Assets \
  --repo-type dataset \
  --local-dir ./Placement_Assets \
  --max-workers 4
```

或使用脚本:

```bash
scripts/download_from_hf.sh yuchi233/Placement_Assets ./Placement_Assets
```

## 上传

先登录:

```bash
export HF_ENDPOINT=https://hf-mirror.com
hf auth login
```

上传:

```bash
cd /home/yuchi/asset-library
scripts/upload_to_hf.sh yuchi233/Placement_Assets
```

或者直接使用:

```bash
hf upload yuchi233/Placement_Assets . . --repo-type dataset
```

## 后续扩展流程

新增资产时按以下步骤:

1. 确认来源、license、可再分发性和用途。
2. 确定资产粒度:单资产还是 collection-level asset。
3. 放入统一四层目录结构。
4. 保留 upstream 文件名和相对路径,除非有兼容性原因。
5. 添加 `metadata.yaml`6. 更新 `manifest/assets.jsonl`7. 如果改了目录结构,更新 `docs/structure_mapping.md``docs/source_notes/<source>.md`8. 运行 `python scripts/validate_asset.py --all`9. 上传到 Hugging Face。