SuperAPI AI 工具集

physicalai-runtime-running-policy-on-robot

通用与其它

查看项目

更新于 10-16 03:11

技能介绍

用途:在真实机器人硬件上运行已导出的策略。PolicyRuntime(src/physicalai/runtime/runtime.py)负责控制循环,InferenceModel 负责策略计算;执行策略位于 src/physicalai/runtime/execution.py 与 src/physicalai/runtime/rtc_execution.py。

主要能力:提供 Python API(适合 notebook 与测试)和 YAML 配置(配合 physicalai run,适合可复现部署)。可在 PolicyRuntime 中配置机器人、模型、摄像头与执行方式,例如用 SyncExecution 构建最小循环:fps=30,robot 为 SO101,model 为 InferenceModel("./exports/act_policy"),cameras 字典指定 UVCCamera,并以 runtime.run(duration_s=60) 运行。执行模式可选同步或 RTC,按文档 docs/how-to/runtime/use-execution-modes.md 选择;计时与队列应由 PolicyRuntime 管理,不要围绕 InferenceModel.select_action 自行实现。可通过 runtime 回调 API 注册遥测与延迟采集,回调不写在推理适配器内。

使用方式:YAML 配置需嵌套机器人的 class_path 与 init_args,再运行 physicalai run --config runtime.yaml --run.duration_s=60。校验可执行 uv run pytest tests/unit/runtime/ -q,无硬件时可用 runtime 测试中的假机器人与假摄像头。

限制与检查:需保证 fps 与摄像头读取速率一致、动作维度匹配机器人 send_action 预期、配置 class_path 无需训练包即可导入;运行时配置结构的破坏性变更需记录在 docs/reference/config-schema.md。