前置知识:已阅读 HelloWorld 解读。本文深入解读高跷行走(Stilt Walking)任务------给 MicroDuck 安装越来越高的高跷,让它从 10 cm 逐级学会在 25 cm、50 cm,直到约 2 m 的高跷上交替迈步。
一、先看效果:鸭子踩着高跷走路

动图 1: MicroDuck 踩着高跷在 MuJoCo 仿真中交替迈步前进。这不是预录的动画,而是策略在每一刻都根据身体状态实时决策的结果------一个真正的闭环控制器。
高跷硬件结构
|---------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
|
正面 |
三分之四视角 |
侧面 |
打印原型 |
图 1: 同一安装接口下的 MicroDuck 高跷结构。原来的可拆卸鞋底变成一个可替换 carrier,再把不同高度的 stilt cartridge 用螺钉固定上去。
不同高度的行走效果
|---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
|
~25 cm 高跷行走~ |
~2 m 高跷行走~ |
图 2: 25 cm 和 2 m 两种高度的行走效果对比。注意高跷越高,落脚误差造成的姿态变化越明显。
二、高跷不只是"把腿拉长"
视频里看起来只是"鸭子穿上了高跷",但对控制器而言,系统同时发生了四类变化:
2.1 支撑点变了
原来脚底踩地,现在高跷末端踩地。脚底不再负责承重,真正接触地面的是高跷末端。
2.2 支撑面变窄了
高跷末端比脚掌窄得多。就像从穿雪地靴变成踩在铅笔上,稍微歪一点就倒。公开策略使用的末端约 17mm × 22mm,对落脚精度的要求远高于平地走路。
2.3 质量和惯性变了
高跷越高越重,腿甩起来更费劲,倒了也更难救回来。
高跷的质量遵循一个简单公式:
每根高跷质量 = 0.012 kg + 0.001 kg/cm × 高跷高度
- 25 cm 版本:37 g/根
- 2 m 版本:212 g/根
2.4 高度变了
同样的身体姿态,脚端高度完全不同。所有传感器和摄像机都要重新调整。
关键点:如果只是把地面往下移,或者把渲染模型的腿拉长而保留旧脚底碰撞,策略学到的仍然是原来的平地走路问题,并没有学会"在高杠杆支撑上保持平衡"。正确做法是在 MuJoCo 仿真器里真正加上高跷的结构------包括形状、质量、碰撞体------让策略感受到真实的物理反馈。
三、课程学习:先缩支撑,再升高度
3.1 为什么不直接挑战 2 米
直接让随机策略在 2 m 高跷上学走路,问题不只是"难一点",而是探索初期几乎每次都会快速失去支撑,奖励信号很稀疏,策略很难知道应该先改哪一个关节。
打个比方:你不会让一个从来没骑过自行车的人直接上公路。你会先装辅助轮,然后慢慢拆掉辅助,先在平坦的路上练,再上坡道。
3.2 课程设计的核心思想
课程学习把一个极难的问题拆成几个连续的安全台阶:
- 先在短高跷或接近平面支撑的形态上学会基本速度控制
- 再逐步缩小支撑形状、增加摆动和接触的敏感性
- 最后逐级提高高跷高度,让已经会走的 actor 适应更大的力臂、质量和姿态变化
- 每一级都可以作为下一级的初始化,而不是从完全随机策略重新开始
关键:每个阶段只让一个主要变量变难。先收窄支撑,保持高度不变;支撑稳定后再逐步升高。这样失败时可以判断是"脚底太窄"还是"高度带来的力矩过大",而不是面对无法归因的混合变化。
3.3 实际课程进度表
| 阶段 | 高度 | 支撑 blend | 在学什么 |
|---|---|---|---|
| 400 迭代 | 2 cm | 0.00(宽) | 先在宽平台上学会站稳和走路 |
| 500-600 | 2 cm | 0.25→0.50 | 支撑逐渐收窄,学会更精确的落脚 |
| 700-2000 | 3-5 cm | 0.50 | 开始升高,巩固交替步态 |
| 2100-3400 | 7.5-50 cm | 0.50 | 继续升高,步长加大 |
| 3500-4300 | 55 cm-1.4 m | 0.50 | 进入极端高度 |
| 4600-6500 | 1.5-2.0 m | 0.50 | 最终挑战 2 米 |
所以:课程不是"给模型作弊答案",而是改变任务难度,让奖励和物理反馈在训练早期足够有用。不同高度的策略是不同课程阶段的专用策略,不是一个可以任意输入高度、自动保证稳定的通用模型。
四、形态编译:把高跷真正加入仿真器
4.1 不是只在画面里把腿拉长
代码做的事情可以概括为:
- 根据高度和支撑形状参数,计算高跷的 3D 形状(凸形 mesh)
- 把这个形状作为 MuJoCo 资产加入机器人描述
- 把原来的脚底碰撞体关掉(改名为
*_original_sole_disabled) - 在脚踝下面加上新的"高跷身体",包括碰撞体、可视化和接触点
- 把所有和"脚底接触""脚底高度"相关的观测和奖励,都关联到新高跷末端
#mermaid-svg-oIVz7huL6PDVFqdE{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-oIVz7huL6PDVFqdE .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-oIVz7huL6PDVFqdE .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-oIVz7huL6PDVFqdE .error-icon{fill:#552222;}#mermaid-svg-oIVz7huL6PDVFqdE .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-oIVz7huL6PDVFqdE .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-oIVz7huL6PDVFqdE .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-oIVz7huL6PDVFqdE .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-oIVz7huL6PDVFqdE .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-oIVz7huL6PDVFqdE .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-oIVz7huL6PDVFqdE .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-oIVz7huL6PDVFqdE .marker{fill:#333333;stroke:#333333;}#mermaid-svg-oIVz7huL6PDVFqdE .marker.cross{stroke:#333333;}#mermaid-svg-oIVz7huL6PDVFqdE svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-oIVz7huL6PDVFqdE p{margin:0;}#mermaid-svg-oIVz7huL6PDVFqdE .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-oIVz7huL6PDVFqdE .cluster-label text{fill:#333;}#mermaid-svg-oIVz7huL6PDVFqdE .cluster-label span{color:#333;}#mermaid-svg-oIVz7huL6PDVFqdE .cluster-label span p{background-color:transparent;}#mermaid-svg-oIVz7huL6PDVFqdE .label text,#mermaid-svg-oIVz7huL6PDVFqdE span{fill:#333;color:#333;}#mermaid-svg-oIVz7huL6PDVFqdE .node rect,#mermaid-svg-oIVz7huL6PDVFqdE .node circle,#mermaid-svg-oIVz7huL6PDVFqdE .node ellipse,#mermaid-svg-oIVz7huL6PDVFqdE .node polygon,#mermaid-svg-oIVz7huL6PDVFqdE .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-oIVz7huL6PDVFqdE .rough-node .label text,#mermaid-svg-oIVz7huL6PDVFqdE .node .label text,#mermaid-svg-oIVz7huL6PDVFqdE .image-shape .label,#mermaid-svg-oIVz7huL6PDVFqdE .icon-shape .label{text-anchor:middle;}#mermaid-svg-oIVz7huL6PDVFqdE .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-oIVz7huL6PDVFqdE .rough-node .label,#mermaid-svg-oIVz7huL6PDVFqdE .node .label,#mermaid-svg-oIVz7huL6PDVFqdE .image-shape .label,#mermaid-svg-oIVz7huL6PDVFqdE .icon-shape .label{text-align:center;}#mermaid-svg-oIVz7huL6PDVFqdE .node.clickable{cursor:pointer;}#mermaid-svg-oIVz7huL6PDVFqdE .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-oIVz7huL6PDVFqdE .arrowheadPath{fill:#333333;}#mermaid-svg-oIVz7huL6PDVFqdE .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-oIVz7huL6PDVFqdE .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-oIVz7huL6PDVFqdE .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-oIVz7huL6PDVFqdE .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-oIVz7huL6PDVFqdE .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-oIVz7huL6PDVFqdE .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-oIVz7huL6PDVFqdE .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-oIVz7huL6PDVFqdE .cluster text{fill:#333;}#mermaid-svg-oIVz7huL6PDVFqdE .cluster span{color:#333;}#mermaid-svg-oIVz7huL6PDVFqdE div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-oIVz7huL6PDVFqdE .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-oIVz7huL6PDVFqdE rect.text{fill:none;stroke-width:0;}#mermaid-svg-oIVz7huL6PDVFqdE .icon-shape,#mermaid-svg-oIVz7huL6PDVFqdE .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-oIVz7huL6PDVFqdE .icon-shape p,#mermaid-svg-oIVz7huL6PDVFqdE .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-oIVz7huL6PDVFqdE .icon-shape .label rect,#mermaid-svg-oIVz7huL6PDVFqdE .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-oIVz7huL6PDVFqdE .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-oIVz7huL6PDVFqdE .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-oIVz7huL6PDVFqdE :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} height_cm + blend
stilt_profile_dimensions
stilt_mesh_data
Mujoco MjSpec mesh
ankle_left/right 下新增 stilt body
碰撞 geom + 可视 geom + foot site
ManagerBasedRlEnv
旧 sole collision
改名并关闭地面碰撞
图 3: 形态编译的数据流。高跷末端的碰撞几何、接触摩擦和高度被送入物理仿真,策略才会因为落脚偏差、身体倾斜和摆腿时的力矩变化受到真实反馈。
4.2 策略的输入输出接口
策略仍然沿用 MicroDuck 速度控制任务的接口:
| 项目 | 内容 |
|---|---|
| 输入(观测) | 61 维:身体角速度、重力方向、14 个关节位置、14 个关节速度、上一时刻动作、速度命令 |
| 输出(动作) | 14 维:14 个关节的目标位置 |
| 控制频率 | 50 Hz(每秒做 50 次决策) |
| 算法 | PPO |
重要提醒:不同高度的策略不是一个"可以任意输入高度"的通用模型。25 cm 的策略必须搭配 25 cm 的高跷,不能拿 2 m 的高跷套 25 cm 的策略。
五、鸭子到底学会了什么
5.1 这是一个闭环控制器,不是预录动画
视频里的走路不是"预先录好的动作",而是策略在每一刻都根据身体状态实时决策的结果。
控制闭环:
#mermaid-svg-gRoDwdKJuXXmnIGU{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-gRoDwdKJuXXmnIGU .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-gRoDwdKJuXXmnIGU .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-gRoDwdKJuXXmnIGU .error-icon{fill:#552222;}#mermaid-svg-gRoDwdKJuXXmnIGU .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-gRoDwdKJuXXmnIGU .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-gRoDwdKJuXXmnIGU .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-gRoDwdKJuXXmnIGU .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-gRoDwdKJuXXmnIGU .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-gRoDwdKJuXXmnIGU .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-gRoDwdKJuXXmnIGU .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-gRoDwdKJuXXmnIGU .marker{fill:#333333;stroke:#333333;}#mermaid-svg-gRoDwdKJuXXmnIGU .marker.cross{stroke:#333333;}#mermaid-svg-gRoDwdKJuXXmnIGU svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-gRoDwdKJuXXmnIGU p{margin:0;}#mermaid-svg-gRoDwdKJuXXmnIGU .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-gRoDwdKJuXXmnIGU .cluster-label text{fill:#333;}#mermaid-svg-gRoDwdKJuXXmnIGU .cluster-label span{color:#333;}#mermaid-svg-gRoDwdKJuXXmnIGU .cluster-label span p{background-color:transparent;}#mermaid-svg-gRoDwdKJuXXmnIGU .label text,#mermaid-svg-gRoDwdKJuXXmnIGU span{fill:#333;color:#333;}#mermaid-svg-gRoDwdKJuXXmnIGU .node rect,#mermaid-svg-gRoDwdKJuXXmnIGU .node circle,#mermaid-svg-gRoDwdKJuXXmnIGU .node ellipse,#mermaid-svg-gRoDwdKJuXXmnIGU .node polygon,#mermaid-svg-gRoDwdKJuXXmnIGU .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-gRoDwdKJuXXmnIGU .rough-node .label text,#mermaid-svg-gRoDwdKJuXXmnIGU .node .label text,#mermaid-svg-gRoDwdKJuXXmnIGU .image-shape .label,#mermaid-svg-gRoDwdKJuXXmnIGU .icon-shape .label{text-anchor:middle;}#mermaid-svg-gRoDwdKJuXXmnIGU .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-gRoDwdKJuXXmnIGU .rough-node .label,#mermaid-svg-gRoDwdKJuXXmnIGU .node .label,#mermaid-svg-gRoDwdKJuXXmnIGU .image-shape .label,#mermaid-svg-gRoDwdKJuXXmnIGU .icon-shape .label{text-align:center;}#mermaid-svg-gRoDwdKJuXXmnIGU .node.clickable{cursor:pointer;}#mermaid-svg-gRoDwdKJuXXmnIGU .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-gRoDwdKJuXXmnIGU .arrowheadPath{fill:#333333;}#mermaid-svg-gRoDwdKJuXXmnIGU .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-gRoDwdKJuXXmnIGU .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-gRoDwdKJuXXmnIGU .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-gRoDwdKJuXXmnIGU .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-gRoDwdKJuXXmnIGU .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-gRoDwdKJuXXmnIGU .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-gRoDwdKJuXXmnIGU .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-gRoDwdKJuXXmnIGU .cluster text{fill:#333;}#mermaid-svg-gRoDwdKJuXXmnIGU .cluster span{color:#333;}#mermaid-svg-gRoDwdKJuXXmnIGU div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-gRoDwdKJuXXmnIGU .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-gRoDwdKJuXXmnIGU rect.text{fill:none;stroke-width:0;}#mermaid-svg-gRoDwdKJuXXmnIGU .icon-shape,#mermaid-svg-gRoDwdKJuXXmnIGU .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-gRoDwdKJuXXmnIGU .icon-shape p,#mermaid-svg-gRoDwdKJuXXmnIGU .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-gRoDwdKJuXXmnIGU .icon-shape .label rect,#mermaid-svg-gRoDwdKJuXXmnIGU .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-gRoDwdKJuXXmnIGU .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-gRoDwdKJuXXmnIGU .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-gRoDwdKJuXXmnIGU :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 本体感觉观测 o_t
actor 策略 pi_theta
速度命令 c_t
14 维关节动作 a_t
执行器与 MuJoCo 接触动力学
下一时刻观测 o_t+1
奖励 r_t
PPO 更新策略
训练期 critic / privileged observation
图 4: 训练和部署的闭环链路。
三个容易误解的点:
- 策略不是一次性规划完整步态。 它每 50 Hz 重新看一次身体状态,再决定下一小步怎么调节关节。
- 动作不是"让脚移动到某个画面位置"。 公开 actor 输出的是 14 个关节位置偏移,后面还要经过执行器模型才会变成真实的关节力矩和运动。
- 奖励不是人工写好的动作标签。 没有人告诉它"这一帧左脚抬多高、下一帧右脚迈多远";策略通过奖励知道什么样的运动更稳定、更接近前进命令。
5.2 61 维观测里有什么
| 观测块 | 维度 | 通俗解释 |
|---|---|---|
| 机体角速度 | 3 | 身体正在向哪个方向、以多快的速度旋转(像陀螺仪) |
| 投影重力 | 3 | 重力方向在身体坐标系中的投影,用来判断身体是否倾斜 |
| 14 个关节位置 | 14 | 当前腿部和身体关节处在什么姿态 |
| 14 个关节速度 | 14 | 各关节正在向哪个方向运动、运动有多快 |
| 上一时刻动作 | 14 | 让策略知道自己刚才发出了什么控制,避免动作跳变 |
| 速度命令 | 3 | 期望的前进、侧向和转向速度 |
| 头部与身体状态 | 10 | 保持和任务接口一致的局部状态量 |
注意 :没有相机图像,没有视觉标记。策略学到的是本体感觉运动控制,不是视觉导航。它知道自己的身体正在倾斜、脚是否在动、关节是否接近极限,但不知道场景里出现了什么物体。
5.3 交替步态是怎样学出来的
一次看起来很简单的"走一步",至少包含几个相互耦合的行为:
- 先把重心放到当前支撑侧。 如果两只高跷都承重,需要先让身体的投影重心落在仍然接触地面的那一侧附近。
- 抬起摆动侧。 摆动侧不能只是抬脚,还要控制腿部姿态和身体角速度,避免抬脚时把身体一起带倒。
- 把高跷放回可承重的位置。 过早落地会打滑,过晚落地会失去支撑;高跷越长,落点误差造成的姿态变化通常越明显。
- 接触后迅速修正。 接触冲击会改变身体角速度,下一次观测中的投影重力、角速度和关节反馈会把这个变化传给 actor。
- 重复左右支撑交换。 当一侧重新稳定后,策略才有机会把负载转移到另一侧。
交替步态不是写死的"左脚、右脚"脚本。 它来自几个因素共同作用:
- 左右腿结构近似对称
- 速度跟踪奖励鼓励身体向命令方向前进
- 足端离地时间和抬脚高度相关奖励,鼓励产生真正的摆动
- 足端滑移、动作变化率、自碰撞和关节极限惩罚,抑制拖脚、抖动和危险姿态
结果:策略在物理反馈中逐渐发现------"先稳定支撑,再交换支撑,落地后再修正",比两只脚同时乱动更容易获得长期奖励。这就是"学会走路"的核心含义。
5.4 奖励、critic 和 PPO 各自负责什么
| 组件 | 作用 | 部署时是否需要 |
|---|---|---|
| actor(策略) | 根据观测输出下一步关节动作 | 需要 |
| reward(奖励) | 评价这一步是否更快、更稳、更符合约束 | 不需要 |
| critic(评论家) | 估计当前状态长期还有多大成功机会,帮助 PPO 判断动作好坏 | 通常不需要 |
奖励设计不是"像某一帧示范视频",而是对控制结果进行组合评价:
| 类别 | 通俗解释 |
|---|---|
| 速度和角速度跟踪 | 有没有按照命令前进、转向 |
| 身体姿态和角速度 | 有没有保持直立,是否出现剧烈摇摆 |
| 足端离地、抬脚和空中时间 | 是否真的形成可行的步态 |
| 足端滑移、自碰撞、关节极限 | 是否出现拖地、撞击或危险姿态 |
| 动作变化率和能量约束 | 是否通过高频抖动"投机"获得短期前进 |
PPO 的直观过程:让旧策略采样许多轨迹,计算每个动作相对于预期的优势,再用裁剪后的概率比更新策略。裁剪的意义是限制单次更新幅度,避免策略因为一批偶然的成功或失败突然改变太多。对高跷这种接触敏感任务来说,稳定的小步更新比激进地改策略更重要。
5.5 发布的 checkpoint 不是完整训练状态
官方发布的 checkpoint 可以用来继续训练,但不是原始训练的完整快照。
发布的内容:
- 和 ONNX 模型精确对应的 actor 权重和观测归一化
- 一个新建的 critic(不是原始训练的 critic)
- 清空的优化器状态
- 保守的学习率(1e-5)和探索噪声(0.1)
所以继续训练属于"热启动",不是从原始训练中断点续跑。
六、关键参数速查表
| 参数 | 值 | 含义 |
|---|---|---|
| 策略频率 | 50 Hz | 每秒做 50 次决策 |
| 关节数 | 14 | MicroDuck 有 14 个可控关节 |
| Actor 输入维度 | 61 | 本体感觉传感器数据 |
| 网络结构 | 512-256-128 ELU | 三层全连接网络 |
| 算法 | PPO | 近端策略优化 |
| 课程阶段 | 多阶段 | 从 2 cm 到 2 m 逐步升级 |
| 支撑形状 blend | 0.5 | 约 17mm × 22mm 末端 |
| BPU 推理 | 可选 | 需要 RDK 开发板 |
总结:高跷行走的核心不是"把腿拉长",而是把高跷作为新的接触几何、质量和惯性显式加入仿真器,再用课程学习逐级提高形态难度。策略学会的不是"预录动画",而是一个把本体感觉和接触动力学闭环起来的行走控制器------先稳定支撑,再交换支撑,落地后再修正。
附:原始 Notebook 参考
- 03_高跷行走_课程与ONNX_BPU.ipynb --- 在 GitHub 上查看原始 Notebook,可对照代码逐行学习。