Skip to content

feat(deploy): G1 WBT task-owned physical deployment - #105

Merged
wlgys8 merged 1 commit into
mainfrom
feat/g1-wbt-task-owned-deployment
Oct 9, 2026
Merged

wlgys8 merged 1 commit into
mainfrom
feat/g1-wbt-task-owned-deployment

Conversation

@wlgys8

@wlgys8 wlgys8 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add the standard G1 WBT export → artifact → ONNX → motrix-deploy pipeline and a simulation recipe.
  • Make physical preparation and normal stopping task-owned; control executes generic task-labelled transitions. Faults bypass graceful motion and retain backend cleanup.
  • Use software PD at every physics substep in both simulators, with one deadline scheduler per runtime and no overrun aggregation.
  • Use measured base IMU plus waist FK for torso attitude; avoid motion-state injection and privileged body-height termination.
  • Separate backend-supported state capabilities from optional sensor bindings; unbound optional fields remain None without ground-truth fallback.

Validation

  • 563 deployment tests passed across core, tasks, MuJoCo and MotrixSim.
  • prek run --all-files passed (copyright, license, dprint, Ruff lint/format).
  • Both backends completed 999 policy ticks / 19.98 simulated seconds plus 0.3 s task damping exit through the standard CLI.
  • Policy traces remained unchanged after lifecycle simplification; native viewer pacing was also verified.

Limits

  • Conservative default physical preparation still fails; experimentally tuned capture windows are narrow, not robust standing/arming controllers.
  • No training or hardware communication/actuation was performed. Existing Go2 hardware enable/lie-down behavior is unchanged; G1 hardware remains unsupported.
  • Checkpoints and local rollout logs are excluded from this PR. The compiler-validated G1 dance artifact (artifacts/g1-wbt-dance.deploy/) is intentionally committed as the recipe's default model export, which is why /artifacts/ was removed from .gitignore.
  • Removes rollout overrun statistics and defines state_fields as backend-supported fields independently of wiring.

@wlgys8
wlgys8 force-pushed the feat/g1-wbt-task-owned-deployment branch 7 times, most recently from 1f4dfc4 to 28dace4 Compare October 9, 2026 15:33
@wlgys8
wlgys8 requested a balanced review from Copilot October 9, 2026 15:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It is a broad, cross-package refactor of the public deploy runtime contract plus a complex new multi-phase task and committed binary artifacts, which warrants final human review.

2 open findings
What changed in this PR

This PR adds a complete, task-owned physical-deployment path for the G1 whole-body-tracking (WBT) "dance" task and, in doing so, restructures the motrix_deploy runtime contract. The deployment framework moves from a policy-centric loop (PolicyContext/PolicyRuntime/DeployTask.build_observation) to a Controller-based lifecycle: DeployTask becomes an abstract Controller (reset(state)/step(state, context)->ControllerStep/request_stop/validate_command + default_duration_s), observation/action/termination logic moves into a reusable PolicyProcessor wrapped by PolicyController, and ControlSession/Runtime own scheduling, I/O, cleanup and result reporting. The new G1WbtDeployTask orchestrates prepare → policy-hold → playback → damping phases itself, and a new profile compiler emits the G1 artifact (embedded motion NPZ payload, firmer standing-hold gains, hardware-observable termination thresholds).

Changes:

  • Rename and restructure core deploy abstractions (PolicyRuntime→Policy, PolicyContext→ControlContext with dt_s, Go2WalkDeployTaskV1→Go2WalkDeployTask, bind_control_session/run(control, steps=...)→bind_session/run()), making DeployTask a complete task-owned controller.
  • Add the G1 WBT deployment profile compiler, task spec/payload pipeline, sim.yaml recipe, and software-PD simulation runtime accounting (policy_simulation_time_s/real_time_factor).
  • Separate backend-supported state capabilities from optional sensor bindings (unbound optional fields stay None); drop privileged body-height termination and the committed artifact's /artifacts/ gitignore entry.
File Description
motrix_envs/​src/​motrix_envs/​deploy/​g1_wbt.py New G1 WBT profile compiler: builds task spec, motion NPZ payload, and DeploymentProfile.
motrix_envs/​src/​motrix_envs/​deploy/​__init__.py Imports g1_wbt for registration side-effect (correctly commented).
motrix_envs/​src/​motrix_envs/​deploy/​go2_walk.py Drops removed termination_min_base_height field.
motrix_rl/​src/​motrix_rl/​deploy/​service.py Writes profile.payloads into the exported artifact alongside the ONNX model.
motrix_rl/​src/​motrix_rl/​deploy/​source_rollout.py Applies OnnxPolicyRuntime→OnnxPolicy rename.
motrix_rl/​tests/​test_deploy_export.py Updates test task fixture to the new reset(state)/step/request_stop contract.
motrix_deploy/​tests/​test_task_plugins.py Adds session-controller loading/execution tests for the new create_task(spec, robot, policy, steps) signature.
motrix_deploy/​tests/​test_simulation_runtime.py Updates runtime fixture to new advance_control_period/_physics_time_s/run() interface.
motrix_deploy/​tests/​test_simulation_config.py New tests for simulation scene/timing/sensor-binding recipe decoding.
motrix_deploy/​tests/​test_runtime_binding.py Updates runtime-binding tests for the new session API.
wiki/​design/​deploy-command-input.md Updates design doc to the ControlContext/ControlSession/PolicyController naming.
motrix_deploy_tasks/​.../​g1-wbt-dance/​sim.yaml + committed artifact + .gitignore New default recipe pointing at a committed artifacts/g1-wbt-dance.deploy/ artifact.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread motrix_envs/src/motrix_envs/deploy/g1_wbt.py Outdated
@wlgys8
wlgys8 force-pushed the feat/g1-wbt-task-owned-deployment branch from 28dace4 to e558a3f Compare October 9, 2026 15:52
@wlgys8
wlgys8 requested a balanced review from Copilot October 9, 2026 15:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

This is a large cross-cutting deployment-runtime refactor and it contains a concrete export-blocking defect (the manifest omits task payloads), so it needs human review and fixes before approval.

1 open finding
2 resolved since last review

🧠 Review effort: Balanced

Comment thread motrix_rl/src/motrix_rl/deploy/service.py
@wlgys8
wlgys8 force-pushed the feat/g1-wbt-task-owned-deployment branch from e558a3f to b8b54d4 Compare October 9, 2026 16:11
@wlgys8
wlgys8 requested a balanced review from Copilot October 9, 2026 16:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It is a broad control-plane refactor spanning multiple packages and both simulation backends, with a committed binary artifact and hardware-adjacent contracts that warrant final human verification.

1 open finding
1 resolved since last review

🧠 Review effort: Balanced

Comment thread docs/source/zh_CN/user_guide/tutorial/advanced/motrix_deploy.md
@wlgys8
wlgys8 merged commit f6e8161 into main Oct 9, 2026
7 checks passed
@wlgys8
wlgys8 deleted the feat/g1-wbt-task-owned-deployment branch October 14, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants