feat: release v0.3 with RP1 trained skills and scaled arenas

This commit is contained in:
2026-10-29 14:16:04 +08:00
parent fc5ee4f2c6
commit 09f7b02c3e
86 changed files with 4136 additions and 165 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
## 首期功能
- 在工具栏 Robot 中选择 Microban;默认使用平台统一 `arena`:内部 4.5 × 4.5 m(原场地长宽各扩大 50%),墙高 .25 m、厚 .05 m,四边为真实碰撞盒。
- 在工具栏 Robot 中选择 Microban;默认使用平台统一 `arena` 模板,按名义站立高度 0.33 m 相对 Microduck 0.27 m 等比适配:内部 **5.5 × 5.5 m**,墙高约 **0.306 m**、厚约 **0.061 m**,四边为真实碰撞盒。
- 内部仍是平地,无高度场;复用 Microduck 的暗色橙色网格、围墙视觉、comic/CRT 和背后相机。重力、驱动、policy 参数不变;不是用坐标夹紧伪造边界。
- 有界默认场地的运动验收为三轮各 70 s;另用显式 `flat` 诊断场地保留三轮各 84 s 原长距离协议,二者不能混称。
- 导入/切换后默认在机器人背后跟随;鼠标拖拽切换到自由环绕,按 **C** 恢复背后跟随和默认距离。C 在暂停时也有效,重复按不会关闭跟随。
@@ -62,4 +62,4 @@ tau = clamp(0.3 * (target - q) - 0.02 * dq, -0.65, 0.65)
`microban-walking.spec.js` 从重置状态完成三轮,每轮 84 s 仿真:站立、前后走、左右转、停顿、行走中转头、关闭转头。检查实际位移方向、展开的 yaw、head 幅度 / 回正、无跌倒 / 重置,并记录 PD 饱和统计。另有真实墙钟下近 50 Hz 测试、H 按键、跌倒手动 reset 与 IMU 坐标系测试。
详见 [验收记录](../superpowers/verification/2026-10-27-multi-robot-platform.md)。只对记录的桌面 Chromium / WASM 组合做过验证;没有实机、移动端、手柄 / 触屏、15 小时耐久或不同浏览器的保证。模型和策略许可按原文件与来源说明分别核对。
初始策略接入详见 [验收记录](../superpowers/verification/2026-10-27-multi-robot-platform.md);当前场地尺寸与碰撞验证见 [按机器人尺寸缩放场地](../superpowers/verification/2026-10-28-robot-scaled-arena.md)。只对记录的桌面 Chromium / WASM 组合做过验证;没有实机、移动端、手柄 / 触屏、15 小时耐久或不同浏览器的保证。模型和策略许可按原文件与来源说明分别核对。
+25 -7
View File
@@ -8,14 +8,15 @@ Robot 是数据包,平台核心不根据 robot id 分支。对于现有能力
- floating base、具名 freejoint / root body;受控关节为标量 hinge / slide。
- 每个受控关节一个 unit-gear actuator,独立解析 joint / qpos / dof / actuator 地址,不依赖其数组顺序。
- ONNX primary;不相交关节组的正弦 overlay。
- gyro、body projected gravity、joint position relative、joint velocity、lastAction、command。
- 关节位置目标;unit-gain torque motor 的子步 PD,或原生 position servo。
- MJCF 编译后 visual geom / mesh / material 渲染;默认 `arena` 为 4.5 × 4.5 m 有碰撞围墙的平地,使用 Microduck 暗色/橙色地面和墙网格;同款 comic UI 与背后相机,C 恢复。
- ONNX primary;不相交关节组的正弦 overlay;与 primary 独占相同关节组的 ONNX episodic 技能。
- gyro、body projected gravity、joint position relative、joint velocity、lastAction、command;可选 1–64 帧 frame-major / term-major 历史,首次采样回填,reset 清空。
- episodic 可用 `motion_command` 读取仿真时钟驱动的 joint position/velocity 参考。每技能独立进度,pause 冻结、激活从帧 0 重启;参考只进入观测,不运动学改写机器人。
- 关节位置目标;unit-gain torque motor 的子步 PD,或原生 position servo。PD 可配置每关节增益/力矩上限与可选四象限 torque-speed envelope。
- MJCF 编译后 visual geom / mesh / material 渲染;默认 `arena` 是按机器人站立高度缩放的有碰撞围墙平地。Microduck 基准为 4.5 × 4.5 m,使用暗色/橙色地面和墙网格;同款 comic UI 与背后相机,C 恢复。
- `presentation.world` 可省略,统一由平台 `DEFAULT_WORLD` 解析,不要在每个新包里复制默认场地名。需要诊断时,通用包可显式设为 `"flat"`(无墙)。机器人出生点和尺寸应适合默认边界。
- Package 绑定驱动的键盘输入与同源提示 / 技能按钮。
固定基座、ball joint 的多维 action、非单位 gear、自定义外部 JS、RNN、历史 / 图像张量、IK、velocity / effort action 等尚不支持。JSON Schema 与运行时都会拒绝不支持的能力,不能仅添加未实现的配置名来声称已经兼容。
固定基座、ball joint 的多维 action、非单位 gear、自定义外部 JS、RNN、图像张量、BeyondMimic 的 privileged motion_preview/anchor/base-linear-velocity terms、IK、velocity / effort action 等尚不支持。JSON Schema 与运行时都会拒绝不支持的能力,不能仅添加未实现的配置名来声称已经兼容。
## 文件布局
@@ -25,6 +26,9 @@ app/public/robots/example/
model.xml
assets/...
policies/walk.onnx
policies/wave.onnx # 可选独立 episodic
motions/wave.json # 可选 reference 描述
motions/wave.f32 # positions_then_velocities / float32-le
SOURCE.md
LICENSES/...
```
@@ -37,6 +41,18 @@ app/public/robots/example/
- `app/src/platform/loader/world.schema.json`
- `SchemaValidator.js` 的跨字段检查(所有权、输入绑定、命令尺寸等)。
## 场地与机器人尺寸
在 Robot Package 顶层声明参考站姿的全身高度(米),例如:
```json
"dimensions": { "height": 1.32 }
```
默认 arena 的 `scale_to_robot.reference_height` 为 Microduck 的 `0.27 m`,场地长宽、墙高、墙厚、网格间距与淡出距离均按 `height / 0.27` 同比缩放。Microduck 保持 4.5 m 方形场地 / 0.25 m 墙高;Microban(0.33 m)为 5.5 m / 0.306 m;RP1(1.32 m)为 22 m / 1.222 m。物理碰撞和视觉墙使用同一份解析后 World 尺寸。
高度是稳定的名义尺寸,不是 base.spawn.z,不会随蹲下、跌倒或挥手动态改变;Microduck 腿/轮共用同一参考值。省略 dimensions 的旧包按基准倍率 1 兼容,新增机器人应明确填写。自定义 World 不声明 `scale_to_robot` 就保持固定米制尺寸;`flat` 诊断场地不受影响。解析后的 `world.scale` 是运行时派生值,不应写进 world.json。
## 必须逐项核对
1. **joint group**:`joints.groups.policy` 是 actor 的真实顺序,不是 MJCF 或 metadata 全体顺序;overlay 另列 group。
@@ -46,7 +62,7 @@ app/public/robots/example/
5. **actuator**:不能把关节角写进 torque motor。PD 增益 / 力矩上限由配置显式指定,不能自动等价于任意训练 metadata。
6. **资源路径**:以 manifest 为基准解析;不得依赖源项目绝对路径。内置 asset URL 必须同源,保留 Vite base 与已有同源签名参数。
7. **终止**:配置合理的倾角 / 高度;没有恢复策略时使用手动 reset,不用自动重置掩盖跌倒。
8. **输入**:语义动作支持 `move_forward` / `move_backward` / `turn_left` / `turn_right`、reset、pause、`toggle:<overlay>`;提示由绑定生成。
8. **输入**:语义动作支持 `move_forward` / `move_backward` / `turn_left` / `turn_right`、reset、pause、`toggle:<overlay>`、`skill:<episodic>`;提示由绑定生成。待权重的 episodic 必须设置 `available:false`,对应绑定 `disabled:true`,不加载虚构的权重路径。
9. **许可**:填写 license,保存来源、修改与逐文件声明。复制权限不等于所有文件许可一致。
## 注册与测试
@@ -73,4 +89,6 @@ npm --prefix app run test:e2e
确需新能力时,在独立阶段明确数值约定、schema、注册项、单元与浏览器测试。观测 / 动作注册表在 `platform/policy/TermRegistry.js`;可信特殊生命周期放在 `src/robots/` 的编译期注册工厂。首期没有 Worker 沙箱或任意 Package URL 的 JS 执行入口。
World 与 Robot 配置解耦:现有三个包与不指定 world 的新通用包均默认 `arena`。Microduck 专用适配器保留其球/可选起伏等特性,通用机器人只共享平地、边界和场地视觉;这不等于任意新机器人都已获得策略兼容或所有 Microduck 玩法。
新增完整的历史观测、独立策略默认姿态与 episodic 状态机约定见 [RP1 接入说明](rp1.md)。每个技能可覆盖 observations/actions/defaults,并可声明 reference;`motion_command` 的 group 必须与技能 owns 一致,reference 的关节顺序/控制时钟/精确数据长度均验证。未知 observation term、RNN 或任意新 ONNX 输入结构仍需显式实现与验证。
World 与 Robot 配置解耦:所有现有包与不指定 world 的新通用包均默认 `arena`。Microduck 专用适配器保留其球/可选起伏等特性,通用机器人只共享平地、边界和场地视觉;这不等于任意新机器人都已获得策略兼容或所有 Microduck 玩法。
+142
View File
@@ -0,0 +1,142 @@
# RP1:第三个机器人与独立多技能策略
## 当前可用
```bash
npm --prefix app run dev -- --host 127.0.0.1
```
在 Robot 下拉框选择 **RP1**,所有物理与推理都在浏览器,不需要训练后端:
- W/S 或 ↑/↓:前进/后退,命令 `+0.4 / -0.3 m/s`。
- A/D 或 ←/→:左右转,命令角速度 `±0.6 rad/s`。
- **J:舞蹈前 10 秒片段;H:完整 4.36 秒挥手**。也可点击按键面板的对应按钮。先释放移动键,再请求动作。
- 动作完成自动混回走路;方向键可提前中断。Space 重置;Esc 暂停/继续;C 恢复跟随相机。
- 暂停时动作按钮禁用;参考帧和技能计时也一起冻结。
- 场地按名义站立高度 1.32 m 相对 Microduck 0.27 m 缩放:22 × 22 m,墙高约 1.222 m、厚约 0.244 m。网格/淡出距离同步缩放,真实碰撞墙与视觉一致。
右侧动作按钮仅显示英文 **Dance**、**Wave**,不显示括号补充文字。
**限制:完整舞蹈参考长 131.46 秒;旧版 model_7999 的长程测试在参考帧 994(约 19.9 秒)失稳。新版 model_23998 目前只验证并开放前 10 秒,完整时长尚未重新验收,不自动延长 duration。** 训练完成不等于任意长度播放已收敛;不能仅延长 duration 就宣称稳定。
## 已完成权重
均来自 `/home/cen/Embodied_Workspace/Mujoco_Projects/roboparty_train/logs/rsl_rl`,显式选择最终、完整且稳定的文件,不动态追踪目录中的最新文件:
| 技能 | Run / checkpoint | 训练迭代 | 部署时长 |
|---|---|---:|---:|
| walk | `rp1_24dof_flat/2026-10-28_15-47-49/model_9000.pt` | 9000 / 配置 9001 次 | 连续 |
| dance | `rp1_24dof_beyondmimic_dance/2026-10-29_11-05-14_dance_resume/model_23998.pt` | 从 7999 续训 16000 次,最终 23998 | 前 10 s |
| wave | `rp1_24dof_beyondmimic_wave/2026-10-28_19-00-23_wave/model_7999.pt` | 7999 / 配置 8000 次 | 全 4.36 s |
包在 `app/public/robots/rp1/`;`source-manifest.json` 保存 checkpoint、配置、motion、ONNX 与资源哈希。导入不会启动、停止或修改训练。
## 数值合同
共同约定:floating base `base_link`,24 个具名关节;物理步长 0.005 s、decimation 4、控制 50 Hz;`default_joint_pos + 0.25 * action`;每物理子步应用具名 PD、力矩上限和四象限 torque-speed envelope。
### 行走
- float32 `[1,243] → [1,24]`,ELU MLP `243→512→256→128→24`。
- 单帧:gyro 3、projected gravity 3、velocity command 3、relative joint position 24、joint velocity 24、last action 24。
- 3 帧 term-major,每个 term 内 oldest→newest;首次采样回填,reset 清空历史。
- 包含经验归一化 `(obs - mean) / (std + 0.01)` 和 runner 的 ±100 动作裁剪。
### BeyondMimic 舞蹈/挥手:实际是 student 分支
必须读取日志的 `agent.yaml: obs_groups.actor`,本次是 **`[student]`**,不是带 motion_preview/anchor 的 `policy` 观测组。
- float32 `[1,126] → [1,24]`,ELU MLP `126→512→256→128→24`,内含经验归一化;runner 未裁剪动作,导出器也不增加裁剪。
- 顺序:`motion_command` 48(参考 joint_pos 24,然后 joint_vel 24)、root-frame gyro 3、projected gravity 3、相对该技能 defaults 的 joint_pos 24、joint_vel 24、last action 24。无历史。
- actor、动作和 motion 都按日志 `joint_ordering` / action 的 `preserve_order` 具名顺序解析,不按 MJCF actuator 索引猜测。
- `skills[].defaults` 保留各自训练的参考姿态;不会用行走策略的参考姿态代替。
- 这两个 student actor **不需要** anchor/reference quaternion 或 motion_preview 输入。带这些输入的其他 BeyondMimic 导出仍不支持;未知 terms 和不同 actor branch 会明确拒绝,而不是伪造兼容。
浏览器省略训练时的随机延迟(0–2 physics steps)、域随机化、随机 default positions、外推力及观测噪声。它不是 Newton/MJWarp 或实机电机的精确等价物。跌倒停止推理、请求手动 reset,不自动起身。
## 统一生命周期与参考数据
`platform/policy/controllers/OnnxPolicy.js` 对每个技能独立拥有 session、观测历史、lastAction、defaults 和 motion reference,仅共享物理状态与最终 target map:
- `load()`:编译自己的观测/动作管线、检查真实 dtype/shape、执行有限值 smoke test。
- `reset()`:清空该策略自己的历史/lastAction,参考时钟回到未启动状态。
- `run()`:按仿真时间采样参考,构建观测、推理、原子提交关节目标。
- `dispose()`:释放 session;部分加载失败释放已创建资源,切换失败回滚到旧机器人。
`JointMotionReference` **只写 observation,不写 qpos、速度或关节 targets**。不是运动学动画,也不在动作开始/结束传送 root。每次真正激活策略时从帧 0 开始,50 Hz 一帧,暂停不推进;末帧 clamp,不 wrap、不随机重采样、不复用上次进度。
`skills[].reference` 是 Package 相对路径,例如 `motions/wave.json`:
```json
{
"schema": 1,
"layout": "positions_then_velocities",
"dtype": "float32-le",
"step_dt": 0.02,
"frames": 218,
"joint_names": ["实际 24 个具名关节,顺序须与 owns 相同"],
"data": "motions/wave.f32"
}
```
`.f32` 是 little-endian float32:所有 `[frames, joints]` positions,随后所有 `[frames, joints]` velocities。该 JSON 的 data 同样相对 Package 根目录解析,支持部署 base path / 同源签名。尺寸、顺序、控制时钟、长度和有限值均检查,不会悄悄插值或重排。`validate:packages` 也验证参考样本,不只检查文件存在。
## 状态机
```text
walk → settling → entering → playing → returning → walk
↘ 移动/取消/超时 → walk
```
- 停稳门限:实际平移速度 <0.15 m/s、角速度 <0.2 rad/s,持续 0.4 s;5 s 超时取消。继续移动时拒绝 pending 动作。
- entry/return 各 0.5 s 混合当前 target 与策略 target,只覆盖 primary 拥有的关节,不破坏独立 overlay。
- duration 从进入新策略开始计时,**包含进入 blend**。Dance 使用参考帧 0–499,wave 使用 0–217;返回 walk 重置行走历史。
- 方向键中断动作,以零命令行走混回,随后恢复移动输入;不支持 episode→episode 直接抢占。
- pause 不推进计时/参考;reset 清除 pending/active episode 和所有策略状态;跌倒优先停止推理。状态栏显示当前 skill / phase。
## 更新权重
### 走路
```bash
TRAIN=/home/cen/Embodied_Workspace/Mujoco_Projects/roboparty_train
"$TRAIN/.venv/bin/python" app/scripts/import-rp1.py \
--source "$TRAIN" \
--checkpoint "$TRAIN/logs/rsl_rl/rp1_24dof_flat/2026-10-28_15-47-49/model_9000.pt" \
--policy-only --completed
```
`--policy-only` 保留资产和其他技能;`--completed` 要求达到日志配置的最终迭代并更新训练状态/显示名。省略 `--policy-only` 会完整重建 manifest,把舞蹈/挥手恢复为不可用;不要用它无意覆盖已验证的配置。
### 舞蹈/挥手
```bash
"$TRAIN/.venv/bin/python" app/scripts/import-rp1-motion.py --skill dance \
--checkpoint "$TRAIN/logs/rsl_rl/rp1_24dof_beyondmimic_dance/2026-10-29_11-05-14_dance_resume/model_23998.pt"
"$TRAIN/.venv/bin/python" app/scripts/import-rp1-motion.py --skill wave \
--checkpoint "$TRAIN/logs/rsl_rl/rp1_24dof_beyondmimic_wave/2026-10-28_19-00-23_wave/model_7999.pt"
```
导出器读取日志中真实 actor/观测/关节/default/action/actuator 合同和 motion 路径,拒绝中间 checkpoint、时钟不符、不支持的分支/结构或不同驱动参数。导出含归一化,并比较 PyTorch 与 ONNX 输出。Dance 默认部署 10 s,wave 默认全片;`--duration` 可显式缩短/选择验证时长,不能超出参考总长。
**导入始终把该动作设为 `available:false`、绑定 `disabled:true`,避免新权重未经物理验证就上线。** 先运行 staged 资格测试,再检查测试报告;通过后显式启用 skill / binding,并更新 label 与 `source-manifest.json` 的 validation。源文件与导出内容的哈希不能凭空改成“已验证”。
```bash
npm --prefix app run validate:packages
RP1_TEST_STAGED=1 npm --prefix app run test:e2e -- rp1-motion.spec.js
npm --prefix app test
npm --prefix app run build
npm --prefix app run test:e2e
```
如果现有 Vite 进程已经运行很久,添加新 public 文件/目录后请重启 dev server;本机发现过旧进程缓存文件集合/变换的问题。资格测试与最终回归使用单独的新进程,不能仅依赖旧服务热更新结果。
## 验证与许可
`rp1.spec.js` 验证最终行走权重、3×25 s 序列、频率、跌倒/reset/切换和通用 episode 接口 fixture;它复用 walk 的那个测试不是动作质量证明。
`rp1-motion.spec.js` 使用真实 dance/wave ONNX 和参考:三个朝向的实际行走→动作→行走,核对 observation 内参考数值、完整部署区间、无跌倒/传送,键盘、pause/reset/中断、连续四次无 reset 触发和损坏 reference 的加载回滚。
最新舞蹈权重与标签更新见 [23998 更新验收](../superpowers/verification/2026-10-29-rp1-dance-23998.md);原多技能集成见 [最终技能验收](../superpowers/verification/2026-10-29-rp1-completed-skills.md)。[原接入记录](../superpowers/verification/2026-10-28-rp1-platform.md) 描述先前中途权重;[场地尺寸验证](../superpowers/verification/2026-10-28-robot-scaled-arena.md) 描述按机器人缩放的边界。
RP1 description 和 motion 来源未明确提供可统一再分发的许可;仅供本机评估。请在公开部署/再分发前确认模型、mesh、用户权重及动作数据各自的权限,见 `app/public/robots/rp1/SOURCE.md`。没有自动提交或公开发布。
@@ -0,0 +1,50 @@
# Robot-relative arena sizing — 2026-10-28
## Requested behavior
Use Microduck's arena/body proportions for each robot instead of assigning all robots the same absolute 4.5 m arena and 0.25 m walls.
## Size convention
`robot.json` now declares `dimensions.height`: nominal full-body standing height in metres. Source MJCF visual-geometry bounds were measured at each package's reference/reset pose, excluding non-robot bodies. Approximate measured heights: Microduck legs 0.272 m, Microban 0.332 m, RP1 1.321 m. Declared rounded values are 0.27 / 0.33 / 1.32 m. Both Microduck locomotion variants use the same family reference height, avoiding scene resizing when switching feet/rollers.
This is deliberately not root spawn height, camera distance, or live pose height. Walking, crouching, falling or waving must not move the walls.
The arena template declares `scale_to_robot.reference_height = 0.27`. All lengths scale by `dimensions.height / reference_height`:
| Robot | Scale | Inner arena width × length | Wall height | Wall thickness |
|---|---:|---:|---:|---:|
| Microduck | 1 | 4.5 × 4.5 m | 0.25 m | 0.05 m |
| Microban | 1.222222 | 5.5 × 5.5 m | 0.305556 m | 0.061111 m |
| RP1 | 4.888889 | 22 × 22 m | 1.222222 m | 0.244444 m |
Arena width / robot height remains 16.6667; wall height / robot height remains 0.925926. Existing Microduck baseline behavior is unchanged.
## Implementation
- `platform/worlds/arena.js::fitWorldToRobot` clones/resolves the authored World before MuJoCo compilation. It does not mutate shared configuration and repeated resolution does not double-scale.
- `PackageLoader.loadWorld(id, config)` is used by RuntimeManager and the standalone Microduck entry. There are no robot-id branches in scaling logic.
- Physical walls use the resolved `boundary`. Visual wall positions, heights and spans use those same dimensions.
- Arena grid spacing, geometry extent and radial fade distances scale together; colours, reveal behavior and flat floor physics are unchanged. Without scaled fade, RP1's distant walls would disappear.
- `world.scale` is runtime-only metadata; it cannot be injected as an authored world.json property.
- Missing dimensions retain reference scale 1 for old packages. Future packages should explicitly declare nominal height. Worlds without `scale_to_robot` (including `flat`) retain fixed metre dimensions.
- The RP1 full importer preserves its 1.32 m nominal height; policy-only export leaves package dimensions intact.
No robot meshes, masses, gains, gravity, command speeds or physics timestep are rescaled. No position clamp or automatic reset is used to create the boundary effect.
## Verification
- Unit tests: 49/49 pass, including per-package scale, unchanged template, idempotence, fallback, explicit fixed Worlds, invalid dimensions/reference scale, visual/physical dimensions, grid/fade scaling and disposal.
- Targeted browser checks: 5/5 pass using actual MuJoCo WASM: all three robots' compiled collision walls and visual faces agree, future-package sizing, presentation cleanup, plus actual four-sided wall contacts for **both Microban and RP1**. Robots are placed near each wall and commanded forward; each wall reports contacts, finite state and root positions remaining inside the boundary, without coordinate clamping.
- Full browser regression: **37/37 pass**, including unchanged Microduck deterministic baselines, Microban long walking trials, RP1 locomotion/skills/reset, 20 three-family ownership transitions, and deployment. Runtime model/data disposal and scene/GPU/listener plateaus remain valid.
- Production build and format check pass; the existing non-fatal MuJoCo browser `module` warning remains.
- Screenshot: `app/test-results/bounded-world-all-three-*/bounded-arena.png` shows RP1 at arena overview scale (generated and ignored by git).
```bash
npm --prefix app test
npm --prefix app run validate:packages
npm --prefix app run build
npm --prefix app run test:e2e
```
This record supersedes the fixed-size field dimensions in earlier default-arena/RP1-integration verification records; those records describe the earlier implementation and remain historical evidence.
@@ -0,0 +1,59 @@
# RP1 platform integration verification — 2026-10-28
## Artifact
- Package: `app/public/robots/rp1/`, third family in the existing selector; generic runtime, no RP1-id branches in physics/rendering/runtime management.
- Source description: `rp1_description@d8c6dd03aeecc7f7ead3d962e09fedba4c8460f0`.
- Checkpoint: `rp1_24dof_flat/2026-10-28_15-47-49/model_3000.pt`, SHA-256 `ac57cfa7257b0cee309536af695f4f793be4b82bf106daa3372a0ae6da477931`.
- ONNX SHA-256: `0b89b7b4c1c35dfb1912a0a39950e283f31c760d8e386ad8e2da20851cffc34a`.
- Export includes empirical normalization and deterministic ELU actor. ONNX checker + zero/eight seeded random comparisons against PyTorch: max absolute error `9.5367431640625e-7`.
- Both full import and `--policy-only` were run. `robot.json` hash remained identical after policy-only update (`6fdb2b039a5f6df83418d46de9129dd2bfa742c1e7623349614189697d2b2b5c`). No training process or source training code was changed.
## Numerical/browser checks
Real Chromium + MuJoCo WASM + ONNX Runtime WASM; not a mocked controller. The initial 3-second independent trials were reset separately:
| Trial | World X displacement | Yaw change | Fall |
|---|---:|---:|---|
| stand | −0.0021 m | 0.0002 rad | none |
| forward +0.4 | +0.6953 m | −0.0150 rad | none |
| backward −0.3 | −0.5985 m | approximately 0 rad | none |
| left +0.6 | −0.0361 m | +1.6520 rad | none |
| right −0.6 | −0.0688 m | −1.7249 rad | none |
Three **deterministic** 25-second sequences also pass: stand 5 s → forward 3 s → rest 2 s → backward 3 s → rest 2 s → left 3 s → rest 2 s → right 3 s → rest 2 s. No falls or in-sequence resets; root positions remain within `|x|, |y| < 1.9 m` (arena inner half-extent 2.25 m). Representative local forward/backward displacement: `+0.7551 / −0.5143 m`; turns `+1.5705 / −1.5989 rad`; minimum root height `0.7622 m`; PD saturation count 0/120000 per sequence. Identical trials are repeatability evidence, not domain-randomized robustness evidence.
A four-second realtime trial advances at approximately 1.02× wall time (acceptance range 0.8–1.15), consistent with the 50 Hz scheduler. The bound is measured for simulation/control, not a GPU rendering FPS promise.
Keyboard W/S/A/D commands match manifest limits; key-up clears them. J/H are shown but disabled while no weights exist. Artificial side tilt triggers fall detection; Space clears fall, history and FSM. Microduck → Microban → RP1 transitions are exercised. Screenshot: Playwright `test-results/rp1-third-robot-*/rp1.png` (generated, ignored by git).
## Interface checks
- Unit tests cover term-major/frame-major history, first-sample backfill, live debug reads without history pushes, reset, policy order, named gains, torque-speed limits, atomic invalid-action handling, independent skill defaults/history, load-failure session release, stop gating, timeout, blend, movement interruption and unavailable input suppression.
- The episode browser fixture explicitly reuses the walk ONNX to exercise real stop gating, two sessions/reset/return ownership and movement interruption; it is **not a dance/wave implementation or a quality test of those future motions**.
- Original BeyondMimic policy observations include motion-preview/anchor/reference terms absent from this runtime. Those weights require a real reference adapter or compatible export before enabling the reserved skills.
## Final results
- `validate:packages`: all four manifests (three families), resource paths and provenance hashes pass.
- `npm test`: **47/47** unit tests pass.
- `format:check` and production build pass (the existing MuJoCo browser-external `module` warning remains non-fatal).
- Full browser regression: **36/36** pass, including all nine unchanged Microduck deterministic baselines and Microban long walking trials.
- After restricting episode blending to primary-owned joints and enhancing tests, the final **6/6** affected browser tests were rerun successfully: three-family deployment, original Microban mounted-IMU, RP1 keyboard/fall/switching, RP1 3×25 s/realtime, real stop-gated episode/interruption, and 20 ownership transitions now cycling through **all three robot families**.
- In that final ownership run, every retired model/data is deleted. RP1 listener count remains 15, scene children 5, renderer geometry/texture counts plateau at 69/2; no monotonic leak is observed.
## Reproduce
```bash
npm --prefix app run validate:packages
npm --prefix app test
npm --prefix app run build
npm --prefix app run format:check
npm --prefix app run test:e2e
```
Playwright JSON output contains the `rp1-preview-trials.json`, `rp1-three-sequences.json` and `rp1-realtime.json` attachments. A full-suite run caught stale single-frame diagnostic reads after introducing history; `write({advance:false})` was corrected to sample live state without committing a history push, and the original Microban mounted-IMU regression then passed.
## Limits
Intermediate weights only; no statement of training convergence, real-robot readiness, recovery-policy availability or arbitrary BeyondMimic compatibility. Random delays, domain randomization and training disturbances are omitted. Motion-transition blends enforce target continuity, not universal dynamic safety. RP1 description licensing remains unprovided in this checkout; local evaluation only, not clearance for public asset redistribution.
@@ -0,0 +1,32 @@
# RP1 unattended integration window
- Authorized by user: 2026-10-28 18:15 Asia/Shanghai, approximately 15 hours (until 2026-10-29 09:15).
- Scope: integrate completed locomotion, dance and wave checkpoints from `roboparty_train/logs/rsl_rl`; prepare/test interfaces while training runs; do not interrupt or modify training processes. Do not enable absent/unvalidated skills.
- Working tree contains earlier uncommitted RP1 + arena work; preserve it. No automatic commits or public deployment.
## Progress
### 18:21 — discovery and final walking export
- Completed flat run: `rp1_24dof_flat/2026-10-28_15-47-49`, configured `max_iterations=9001`, final `model_9000.pt`, no corresponding active training process. Exported using `--policy-only`, preserving assets and reserved skills. PyTorch/ONNX maximum absolute error 1.55e-6. Browser validation was pending at this observation.
- Dance actively training: PID 3972369, `rp1_24dof_beyondmimic_dance/2026-10-28_17-40-59_dance`, configured 8000 iterations; intermediate checkpoints are NOT completion evidence.
- No wave run present yet; may be queued after dance in the operator's shell. Do not launch a duplicate GPU training job.
- **Important actual actor contract:** the logged runner uses `obs_groups.actor: [student]`, not `[policy]`. The actor input is **126**, not the privileged policy group's motion-preview/anchor observation shape. Student observations are motion command (reference joint positions + velocities, 48), body angular velocity (3), projected gravity (3), relative joint positions (24), relative joint velocities (24), previous actor action (24). No observation history. Importer must inspect logged runner mapping and reject unsupported contracts rather than assume privileged observations.
- Both source motions are 50 fps, matching the trained 50 Hz command clock. Dance: 6573 frames / 131.46 s. Wave: 218 frames / 4.36 s. Training advances one reference frame per control step; no wrapping/teleporting is allowed in the browser.
### 2026-10-29 09:19 onward — continuation and actual integration
- On the user's subsequent `继续`, confirmed both dance and wave runs had finished: final `model_7999.pt`, configured 8000 iterations, stable files and no matching live training jobs. This log records observed execution points, not an uninterrupted polling service.
- Implemented actual student motion-reference observations and an exporter that reads logged contracts, preserves normalization/defaults and records hashes; no privileged-input approximation.
- Exported dance/wave with ONNX/PyTorch maximum errors 9.54e-7 / 1.91e-6. Staged disabled, then ran physical qualification before enabling.
- Full 131.46 s dance failed at frame 994 (~19.9 s), so it is not advertised as stable. The validated 10 s prefix is enabled and explicitly labelled; full 4.36 s wave is enabled.
- Final walking policy and both deployed motion intervals passed three initial heading cases, movement before/after, pause/reset/interruption, continuous repeat without robot reset and malformed-reference rollback. Targeted browser tests 8/8 and unit tests 53/53 pass.
- Current detailed results and remaining scope: [completed-skills verification](2026-10-29-rp1-completed-skills.md). Source training was not modified or stopped; no public deployment/automatic commit.
## Acceptance gates
1. Completed, stable, fully readable final checkpoints; checked logged actor/actuation/joint/observation contracts.
2. Deterministic ONNX export including normalization; numerical parity with PyTorch; hashed checkpoint and motion provenance.
3. Independent per-skill reference/history/action lifecycle, pause/reset/interrupt semantics and exclusive ownership.
4. Real MuJoCo browser playback and transitions without falls, non-finite state, teleportation or scripted substitution for trained actions.
5. Regression checks, source-hash/package validation and production build. Keep any failing skill disabled and record precise evidence.
@@ -0,0 +1,87 @@
# RP1 completed walking + independent dance/wave policies — 2026-10-29
Historical initial-integration record (dance checkpoint 7999). Current dance weights are checkpoint 23998; current UI labels are plain `Dance` / `Wave`. See the [subsequent weight/label update](2026-10-29-rp1-dance-23998.md) for current qualification and limits.
## Scope and completion evidence
User authorized an unattended integration window and subsequently requested continuation. After resuming on October 29, both BeyondMimic final checkpoints were present, stable and fully readable, with no corresponding active training process. We did not start, stop, resume or modify training jobs. Checkpoints were explicitly selected, not inferred from an arbitrary latest file.
| Skill | Checkpoint under roboparty_train/logs/rsl_rl | Logged final iteration | Export max abs error |
|---|---|---:|---:|
| walk | `rp1_24dof_flat/2026-10-28_15-47-49/model_9000.pt` | 9000 / 9001 configured | 1.55e-6 |
| dance | `rp1_24dof_beyondmimic_dance/2026-10-28_17-40-59_dance/model_7999.pt` | 7999 / 8000 configured | 9.54e-7 |
| wave | `rp1_24dof_beyondmimic_wave/2026-10-28_19-00-23_wave/model_7999.pt` | 7999 / 8000 configured | 1.91e-6 |
The initial intermediate walking policy was replaced with the completed checkpoint. The selector now displays `RP1`, not `training preview`. This describes completed training iterations, **not** a proof of convergence or real-hardware readiness.
## Actual actor contract — student, not privileged policy
The logged runner maps `obs_groups.actor` to `[student]`. Actor weights confirm `[512,126]` first-layer shape. The privileged observation group in the source config is **not** the actor input and must not be used to invent unnecessary preview/anchor inputs.
Dance/wave use float32 `[1,126] → [1,24]`: reference joint positions 24, reference velocities 24, body gyro 3, projected gravity 3, relative joint position 24, joint velocity 24, previous action 24. No observation history. Independent ELU MLPs include their empirical normalizers `(obs - mean)/(std + .01)`; runner action clipping is null, and no clip is added. Each policy has its own trained default-pose map, action history and reference clock. Named joint ordering and 0.25 position-target scale are checked against logged robot/action config. PD/torque-speed parameters are checked against the existing robot contract.
Walking retains 243D three-frame term-major observations and ±100 runner clipping. All policies use 0.005 s physics / 4 decimation / 50 Hz control.
## Integration and safety semantics
- New reusable `JointMotionReference` reads positions/velocities in explicit float32-LE layout. It checks exact byte count, frame count, joint order, clock and finiteness. Package validation also reads/checks reference bytes and source hashes.
- Reference data only writes observation inputs. It never writes qpos, root transforms, velocities or actuator targets; the actual trained actor generates actions.
- Each activation resets its own reference to frame 0. Simulation time drives advancement; pause freezes it. Reference end clamps without wrapping/random resampling. Reset clears all policy state; movement interrupts to locomotion.
- Existing exclusive FSM / stop gate / 0.5 s target blends remain shared platform behavior. Duration endpoint comparison includes a small numerical tolerance so floating simulation time cannot execute one unintended extra reference frame.
- Missing/truncated assets fail the candidate transaction, release partial policy resources and preserve the previous robot. Retrying with good data succeeds.
- Motion importer stages skills **disabled** after every update; qualification tests can explicitly enable candidates with `RP1_TEST_STAGED=1`. Both deployed skills were enabled only after actual physics tests passed. There are no stand-in walk policies or procedural animations in the deployed dance/wave entries.
## Important negative result and deliberately bounded dance
The dance source archive is 6573 frames at 50 fps: **131.46 s**. An initial full-clip browser rollout failed:
- entered dance at simulation ~2.44 s;
- fell at simulation **22.32 s**, reference **frame 994**, root height **0.38572 m**;
- no non-finite values, resets or torque saturation hid the failure.
Therefore full continuous dance is **not qualified or advertised**. The deployed dance is explicitly the **first 10 seconds**, matching the training's 10 s episode horizon and original episodic skill duration. UI label is `Dance / 舞蹈(10 秒片段)`. Its source reference remains available for future qualified extensions, but duration is 10 and deployed reference frames are 0–499. Raising duration is not a validated solution.
Wave source is 218 frames at 50 fps: the **entire 4.36 s**, frames 0–217, is enabled. UI label is `Wave / 挥手(4.36 秒)`.
## Positive physics qualification
`app/e2e/rp1-motion.spec.js`, actual MuJoCo WASM and actual exported ONNX:
1. Each skill at three orientations reached through physical locomotion (straight, left turn, right turn), with forward walking before the request. Both complete their configured intervals, return to walking, and then make >0.4 m forward progress in 3 s without falling.
2. Reference position/velocity observations are compared element-for-element against packaged float32 samples at the reported reference frame. Observation shape is 126, not silently padded/truncated.
3. No non-finite state, no root teleportation: maximum per-control-step root displacement <0.014 m in the qualified trials. No sustained torque saturation (recorded saturation count zero).
4. Minimum root height across the three wave trials approximately **0.758 m**; dance approximately **0.725 m**, safely above the unchanged 0.4 m fall threshold. The fall detector was not loosened.
5. Real H/J keyboard activation; pause freezes both physics time/reference; movement interrupts and blends back; Space clears active/pending/reference/action state.
6. **wave → dance → wave → dance without resetting the robot**: every episode starts at reference frame 0 and ends at its configured final frame, preserving balance.
7. Truncated wave binary causes switch rollback, old model retention and clean retry.
8. Recorded once-per-second upper-limb observations confirm meaningful trained motion rather than standing still: wave arm-joint tracking RMSE **0.084–0.092 rad**, maximum sampled joint excursion **1.97–2.01 rad**; dance RMSE **0.274–0.283 rad**, excursion **1.33–1.40 rad** across the three headings. These are sampled tracking metrics, not full-frame precision claims. Mid-motion production-bundle screenshots were manually inspected at reference frame 78 (`app/test-results/rp1-visual-check/{wave,dance}-mid.png`); wave's right wrist reached ~1.242 m while root was ~0.773 m.
`app/e2e/rp1.spec.js` also passes on the final walking policy: keyboard directions, falls/reset, all-family switching, three 25 s deterministic movement sequences and realtime ~50 Hz control. The walk-reused-as-episode test is still only an interface fixture, clearly separated from the real trained-motion tests.
## Validation status
- Unit tests: **53/53 passed**.
- Package validation: all four package manifests pass; RP1's 33 resource paths, both reference streams and source SHA-256 records pass.
- Targeted RP1 browser tests: **8/8 passed** on the final enabled manifest and fresh server.
- Production build and format check passed. Existing non-fatal MuJoCo `module` externalization warning remains.
- **Full browser regression: 42/42 passed** (10.7 minutes), including all Microduck deterministic baselines, Microban walking, all-family switching, 20 ownership/disposal transitions, race handling and deployment.
- **Production-bundle RP1 checks: 8/8 passed** against a fresh Vite preview on port 5184. Reference samples, transitions, repeated activations, keyboard/reset and rollback pass outside the dev server as well. The local-only preview is left available at `http://127.0.0.1:5184/`; the temporary test dev server on 5183 was stopped. Existing user services were not restarted. Source/dist manifests were checked identical after the final build.
- Final full-suite log: `/tmp/rp1-completed-skills-e2e.log`, exit code 0. Browser reports/screenshots are generated under ignored `app/test-results/`; later targeted/production runs replace the previous JSON report, while this verification record preserves the aggregate result.
An old long-running Vite server was observed returning stale transformed JS / HTML for newly added public files. Final qualification uses a separately started fresh server rather than trusting hot reload. No unrelated user server was stopped.
## Reproduction and limits
```bash
npm --prefix app test
npm --prefix app run validate:packages
npm --prefix app run build
npm --prefix app run format:check
npm --prefix app run test:e2e
```
Use a fresh dev server; `TEST_BASE_URL` can select an isolated instance. Production-facing RP1 tests also run against the built bundle; development-only fixture pages are not shipped in dist.
Training-time randomized actuator delays, random physics/default poses, pushes and observation corruption remain omitted. Long dance playback, arbitrary starts, uneven terrain, severe pushes, hardware, mobile browsers and public redistribution are not accepted by these tests. RP1 description / motion redistribution rights remain unconfirmed; local evaluation only. No commit or public deployment was performed.
See [RP1 operator/update documentation](../../robots/rp1.md), [source provenance](../../../app/public/robots/rp1/SOURCE.md) and the [initial unattended-window log](2026-10-28-rp1-unattended.md).
@@ -0,0 +1,35 @@
# RP1 dance checkpoint 23998 + plain English skill labels
## Requested change
- Replace dance weights with `rp1_24dof_beyondmimic_dance/2026-10-29_11-05-14_dance_resume/model_23998.pt` under the user's `roboparty_train/logs/rsl_rl`.
- Remove parenthesized UI details: right-side labels are exactly **Dance** and **Wave**.
## Export and preserved contract
- Specified checkpoint is complete/readable, actor tensors finite, iteration 23998. This run starts from iteration 7999 and adds 16000 iterations: final `7999 + 16000 - 1 = 23998`. Logged `max_iterations=16000` is the additional training count, not the absolute final iteration.
- Logged robot, student observations, actions, commands and decimation match the previous run exactly. Actor remains normalized ELU MLP, float32 `[1,126] → [1,24]`; no runtime, physics, actuator, observation or transition changes were needed.
- ONNX export includes normalization; max absolute PyTorch/ONNX difference **1.3113021850585938e-6**. Checkpoint hash and per-file export hashes updated in `app/public/robots/rp1/source-manifest.json`.
- Export staged dance disabled. It was re-enabled only after all real-physics qualification tests passed.
- Dance remains the previously configured **10-second prefix**, frames 0–499; blend/stop gates unchanged. **Full 131.46-second playback of checkpoint 23998 has not been qualified.** The earlier long-rollout failure belongs to checkpoint 7999 and is not presented as a result for this new checkpoint.
- Byte comparisons with pre-update backups prove walk/wave ONNX and dance reference JSON/binary unchanged. Robot manifest is otherwise identical after accounting for the two requested label changes. Walk/wave checkpoint provenance is unchanged.
- Full importer labels also use plain `Dance` / `Wave`, so rebuilding a package does not reintroduce bracketed text. Browser selectors and a package-contract unit assertion protect the new labels.
## Verification
- **53/53 unit tests passed**.
- Package schemas, both motion references, RP1's 33 enabled resource paths and source hashes pass validation.
- **5/5 staged real-browser qualification tests passed** on a fresh isolated dev server.
- **8/8 RP1 production-bundle browser tests passed**, including:
- three physical initial-heading cases for dance and unchanged full wave;
- complete configured playback, exact reference samples, return to walking and forward progress;
- H/J keys, no Chinese or bracketed labels, pause/reference freeze, movement interruption and reset;
- wave→dance→wave→dance without robot reset; references restart at frame 0;
- malformed-reference rollback and retry;
- final walking policy's 3×25 s sequences, fall/reset, all-family switching and realtime control.
- Dance's three qualification trials: no falls/non-finite state/torque saturation; minimum root height **0.75032 m**; largest per-control-step root displacement **0.01157 m**; forward displacement after returning to walk **0.801–0.843 m** in 3 s.
- Production build and formatting pass; only the pre-existing non-fatal MuJoCo `module` browser warning remains.
The existing local production preview at `http://127.0.0.1:5184/` serves the updated build. Refresh the page to load the new policy and labels. Temporary candidate server 5185 is not needed after qualification. Source training files/processes were not modified. No commit or public deployment was performed.
This is a targeted weight-update verification; the earlier 42-test full-suite result is recorded in [initial completed-skills verification](2026-10-29-rp1-completed-skills.md), not claimed to have been rerun for this checkpoint.