SUGAR-Inspired PhysHSI Framework Plan
日期:2026-06-11
0. 目的
本文档基于 SUGAR / SUGAR Humanoid 的论文和公开代码,给出 PhysHSI 后续高层框架修改方案。
Refiner 数据组织和代码落地细节以 docs/physhsi_refiner_development_readme.md 为准;本文只保留高层路线。
参考资料:
- Paper: SUGAR: A Scalable Human-Video-Driven Generalizable Humanoid Loco-Manipulation Learning Framework
- Project: SUGAR-Humanoid
- Code: tianshuwu/SUGAR
- Local clone:
submodules/SUGAR - Related residual-refinement reference: ResMimic: From General Motion Tracking to Humanoid Whole-body Loco-Manipulation via Residual Learning
- State-based motor-prior reference: InterPrior: Scaling Generative Control for Physics-Based Human-Object Interactions
注意:论文和项目名是 SUGAR,不是 SUGR。公开仓库包含 refiner、tracker、generator 训练结构和数据接口,但 README 仍把“RGB-D human videos 到 training data 的数据处理 pipeline”列在 TODO。因此,PhysHSI 应借鉴它的中后端训练框架,而不是假设可直接复用完整视频重建前端。
1. SUGAR 可借鉴的核心抽象
SUGAR 的整体思想可以抽象成:
human-object video
-> kinematic interaction prior
-> physics refiner
-> refined executable trajectory
-> privileged teacher / command tracker
-> state-based command generator
-> autonomous hierarchical policy
其中最值得 PhysHSI 借鉴的是三个部分。
1.1 Kinematic Prior 不直接训练最终 policy
SUGAR 不把视频重建得到的人物轨迹直接当成最终 policy 的训练目标,因为原始 HOI prior 会有遮挡、接触错误、retargeting error 和物理不一致。
PhysHSI 对应结论:
- Kimodo / K-model 生成的 HSI / HOI motion 也应先作为 kinematic proposal。
- 不应直接把 proposal 当成最终 state policy 的监督数据。
- proposal 的职责是提供任务语义、时序、root path、object path、contact hint 和 keyframe。
1.2 Physics Refiner 是数据生成闭环的关键层
SUGAR 用 privileged RL refiner 将 imperfect prior 变成 physically feasible skill。它的 unified reward 大致由三类组成:
- tracking reward:跟踪 human / robot body、root、joint、object trajectory。
- interaction reward:保持 object-body 相对关系和 contact consistency。
- regularization reward:控制 torque、action rate、joint limit、foot slip、undesired contact 等。
PhysHSI 对应结论:
- Motion Generation 之后必须显式加入 Physics Refinement。
- Physics Refinement 不是后处理脚本,而应成为独立训练 / 优化层。
- Refiner 可以使用 privileged 信息,包括 reference future、完整 scene state、object state、contact label、phase、goal。
1.3 最终 policy 应是分层 state-based policy
SUGAR 最终不是部署 reference-conditioned tracker,而是蒸馏出:
- high-level command generator:根据当前 object state、robot state、target 生成未来 command chunk。
- low-level command tracker:执行 generator 给出的 command。
PhysHSI 对应结论:
- 我们可以保留一个底层 tracker / controller,用来稳定执行短 horizon command。
- 上层 policy 应从 state 生成 command 或 waypoint,而不是直接依赖完整 reference motion。
- 对于 SAGE 场景,state 里还应包含 local height map / occupancy / scene SDF / target object state。
2. PhysHSI 修改后的总流程
建议把当前总流程改成:
SAGE scene
-> task plan
-> geometry validation
-> Kimodo / K-model motion generation
-> kinematic HSI/HOI prior
-> physics refinement
-> refined executable trajectory dataset
-> full-reference teacher / command tracker training
-> sparse-goal state-based policy distillation
-> state-based RL post-training
-> policy rollout in SAGE scene
-> task metrics
-> paired HSI/HOI policy dataset
这比原来的 motion-only pipeline 多出三个硬边界:
kinematic prior与physics-refined trajectory分离。teacher / tracker与state-based policy分离。scene-aware state policy与reference-conditioned rollout分离。
最终student的共同约束是deployment不读取dense HOI reference。Dynamic pick–place的最小goal是object future state;通用HSI/HOI可以进一步采用:
- InterPrior-style masked sparse goal和motor-prior post-training;
- TokenHSI-style variable task tokens;
- UniHSI-style Chain-of-Contacts;
- VLM-RMD-style relation goal/reward。
这些是student goal interface和训练recipe的候选,不是physics refiner的替代品。
3. 推荐系统分层
| 层级 | 作用 | 输入 | 输出 |
|---|---|---|---|
| Scene Layer | 解析 SAGE 场景、物体、支撑面、可行走区域 | layout_*.json, scene assets |
scene_context.json, local maps |
| Task Layer | 生成长程 HSI / HOI 任务 | scene context, constraints | task_plan.json |
| Validation Layer | 校验几何可行性 | task plan, occupancy, humanoid size | task_validation.json, paths, target poses |
| Motion Prior Layer | 用 Kimodo / K-model 生成 kinematic interaction prior | validated task, scene hints | human motion, object tracks, contact hints |
| Physics Refinement Layer | 把 kinematic prior 修成物理可执行轨迹 | motion prior, scene proxy, reward config | refined motion, refined object tracks, quality labels |
| Teacher / Tracker Layer | 学一个能执行 refined command 的底层 policy | refined dataset, privileged state | tracker checkpoint, teacher rollout |
| State Policy Layer | 蒸馏或训练 scene-aware high-level policy | tracker rollout, state obs, task labels | state-based policy checkpoint |
| Evaluation Layer | 评估任务完成和物理质量 | rollout trace, task spec | metrics, failure report |
| Dataset Layer | 打包训练样本 | scene, task, motion, rollout, metrics | paired dataset sample |
4. PhysHSI 里的 SUGAR-style 数据协议
SUGAR 公开代码里 refiner / tracker 的数据是 folder-based dataset:每条 trajectory 一个 data_* 目录,目录里包含 human / object / contact 三件套。SUGAR 自己的文件名写死了 50 Hz:
robot_50hz.npzobj_motion_global_50hz.pklcontact_labels_50hz.npy
PhysHSI 保留“一条 trajectory 一个目录,所有目录合成一个 motion pool”的思想,但不沿用 robot 或 *_50hz 命名。Kimodo / K-model 侧通常是 30 Hz,ProtoMotions 的 motion 和 simulator 频率也由具体配置决定。因此 PhysHSI case 必须显式记录 fps,文件名用语义而不是采样率。
当前 refiner implementation 采用:
data/refiner/
prior/
train.txt
val.txt
cases/
case_000001/
manifest.json
human_smplx.npz
object.pkl
contact.npy
scene_context.json
task_plan.json
task_validation.json
refined/
run_YYYYMMDD_HHMMSS/
config.json
metrics_summary.json
cases/
case_000001/
manifest.json
human_smplx.npz
object.pkl
contact.npy
rollout.npz
metrics.json
其中 prior 对应 Kimodo / K-model 的 kinematic 输出;refined/run_* 对应 physics refiner rollout 后的可执行 reference。完整文件字段和 loader 语义见 docs/physhsi_refiner_development_readme.md。
5. Physics Refinement 设计
5.1 输入
- Human root / body / joint kinematic motion。
- Active object trajectory。
- Contact hint:hand / foot / hip / pelvis / object contact。
- SAGE scene proxy:floor、support surface、obstacle、target object、local height map。
- Task goal:pick/place/push/kick/sit/carry 等 primitive target。
5.2 Reward
建议从 SUGAR 的 unified interaction reward 改成 PhysHSI 版本:
其中:
R_track:root、body、joint、object pose / velocity tracking。R_interaction:object-to-body relative pose、contact consistency、grasp / support / push direction consistency。R_scene:scene penetration、support height、feet-floor contact、object-surface relation、collision with non-target obstacles。R_task:object final pose、target region success、sit stability、carry stability、door/drawer state success。R_regularization:torque、action rate、joint limit、foot slip、fall penalty。
5.3 Progressive State Pool
SUGAR 的 progressive state pool 很适合我们:
- 初期从较容易的 reference state 或短 horizon 片段开始。
- 将成功或接近成功的 simulated states 放入 pool。
- 后续从 pool 中采样 reset state,逐步覆盖更长、更难的 interaction segment。
PhysHSI 里它尤其适合处理:
- Kimodo motion 和 SAGE geometry 有轻微错位。
- pick/place 接触点不稳定。
- sit / lie / push / kick 这类需要身体和物体共同稳定的动作。
5.4 ResMimic-Style Residual Refiner
SUGAR 的 refiner 是从 kinematic HOI prior 出发,用 PPO 从头训练一个 privileged tracking policy。这个路线直接、统一,但训练搜索空间较大。ResMimic 给了一个更适合 PhysHSI 的变体:
pretrained general motion tracker
+ residual policy conditioned on object / scene / contact
-> physics refiner rollout
核心思想:
- 预训练 backbone 负责 human-like whole-body motion tracking。
- residual policy 不重新学习走路、平衡、转身、伸手等基础能力,只学习 object-aware / scene-aware correction。
- 最终动作可以写成
a = a_base + alpha * delta_a。 - residual actor 初始输出应接近 0,避免训练初期破坏 backbone。
- 对重物、穿模或接触噪声较大的 motion prior,可以加入 virtual object controller / force curriculum,在早期帮助物体跟上 reference,后期逐步衰减。
对 PhysHSI 的建议:
- M4 Physics Refinement 不只保留 SUGAR-style from-scratch refiner,还应实现 ResMimic-style residual refiner。
- 初期优先尝试 residual refiner,因为 Kimodo / K-model motion 已经有人体动作先验,真正难点主要在 contact、object、support surface 和 scene collision。
- 如果没有可用的 pretrained humanoid tracker,则先训练或复用一个 human-only general motion tracking policy,再进入 HSI / HOI residual refinement。
- residual refiner 的输入应在 base tracker 观测之外额外加入 active object state、object reference、contact label、primitive id、local height map / scene proxy。
- residual refiner 的 reward 仍使用
R_track + R_interaction + R_scene + R_task + R_regularization,但 tracking 部分可以降低权重,让 residual 更关注物体和接触修正。
6. Teacher / Tracker 设计
Physics Refiner 之后,下一步不是直接训练最终 policy,而是先训练一个 teacher / command tracker。
6.1 Tracker 输入
Tracker 可以看到比最终 policy 更强但比 refiner 更少的 command:
- current robot state。
- object pose in body frame。
- contact label。
- short-horizon command:joint target、root velocity、angular velocity、contact bit。
- optional primitive id。
6.2 Tracker 输出
- Low-level humanoid action。
- 目标是稳定执行 command chunk,而不是重新规划任务。
6.3 训练方式
建议借鉴 SUGAR 的 BC + PPO / teacher distillation:
- 用 physics refiner / privileged teacher rollout 产生 command-action 数据。
- 先做 behavior cloning,让 tracker 学会基本 tracking。
- 再用 PPO 加 unified reward 训练鲁棒性。
- 最后通过扰动、质量随机化、物体扰动提高闭环能力。
7. State-Based Policy 设计
这是 PhysHSI 和 SUGAR 最大的不同点。SUGAR 的 generator 主要看 object state、robot state、target,然后生成 command chunk。PhysHSI 需要扩展到完整 SAGE 场景。
7.1 Observation
建议的 state observation:
- Humanoid proprioception:joint pos / vel、root velocity、gravity projection、last action。
- Active object state:pose、velocity、category、size、affordance。
- Goal state:target object pose、target support surface、target region、primitive goal。
- Local scene map:height map、occupancy、SDF 或 topdown crop。
- Task tokens:primitive id、phase、remaining subtask、optional language embedding。
- Previous command:上一段 command chunk 或 waypoint。
7.2 Action
两种路线可以并行探索:
| 路线 | High-level 输出 | Low-level 执行 |
|---|---|---|
| Command generator | future joint/root/contact command chunk | tracker |
| Waypoint planner | root waypoint、object waypoint、contact target | tracker / primitive controller |
更接近 SUGAR 的路线是 command generator;更接近 tokenH3 / scene-conditioned policy 的路线是 waypoint planner + command tracker。
7.3 训练数据
不要只用 ideal reference 训练 generator。应像 SUGAR 一样,让 frozen tracker 执行 refined command,然后记录实际到达的 state:
这样 high-level policy 学到的是 tracker 真实能达到的状态分布,而不是不可执行的 ideal trajectory。
8. 与当前 PhysHSI Plan 的修改建议
建议把 docs/physhsi_general_high_level_task_plan.md 里的主流程正式改成:
SAGE scene
-> task plan
-> geometry validation
-> motion/reference generation
-> kinematic prior dataset
-> physics refinement
-> refined executable trajectory
-> teacher / command tracker
-> state-based high-level policy
-> policy rollout
-> task/quality metrics
-> paired HSI dataset
阶段里建议保留并细化:
M4 Physics Refinement:实现 SUGAR-style unified reward + progressive state pool。M5 Teacher / Command Tracker:训练能执行 refined command 的底层 tracker。M6 State-Based Policy Distillation:从 tracker rollout 蒸馏 scene-aware high-level policy。M7 Generalization Benchmark:跨 SAGE scene、object category、layout 和 primitive 评测。M8 Dataset Release Contract:打包 motion prior、refined trajectory、teacher rollout、student rollout 和 metrics。
9. 当前最小可执行里程碑
建议下一步不要直接做全量 policy,也不要先追求 10-scene benchmark,而是先用已有的 12 条 clean seeded reach -> sit -> get_up Kimodo motion 打通 refiner pipeline。
- 将 12 条 sit MVP source motion 整理成
data/refiner/prior/cases/case_sit_mvp_*。 - 每条 case 导出 PhysHSI 三件套:
human_smplx.npz、object.pkl、contact.npy,并在manifest.json里记录真实fps、源 motion、源 task plan 和源 layout。 - 搭一个 PhysHSI refiner env,只接 seat / sit HSI 和简化 scene proxy。
- 实现
R_track + R_interaction + R_scene + R_regularization的 sit MVP 版本。 - 优先尝试 ResMimic-style residual refiner:冻结或半冻结 general motion tracker,只训练 sit/contact/scene residual。
- 在 12 条 cases 上训练一个 shared refiner,不是一条 case 一个模型。
- 对 12 条 cases 批量 rollout,写出
data/refiner/refined/run_*/cases/case_sit_mvp_*。 - 用 refined trajectory 继续接 tracker / teacher smoke。
正式 10-scene independent seat-only benchmark 暂时降为低优先级。它用于后续评估多 scene 泛化,不应该阻塞当前 generation -> refiner pipeline 打通。
10. 关键判断
结论:PhysHSI 可以直接借鉴 SUGAR 的中后端框架,但前端应该替换成我们的 SAGE + Kimodo / K-model motion prior。
更具体地说:
- SUGAR 的 video reconstruction 前端不适合作为当前主依赖,因为公开代码未释放完整数据处理 pipeline,且它假设 human-object videos / RGB-D reconstruction。
- SUGAR 的 refiner、progressive state pool、unified interaction reward、tracker、generator 结构非常适合成为 PhysHSI 的 policy-data pipeline 骨架。
- PhysHSI 的核心创新点应放在 scene-aware HSI / HOI prior generation、SAGE geometry grounding、local height map / object state conditioned policy,以及从 generated interaction prior 到 executable policy 的闭环数据生成。