Skip to content

Add WBC-AGILE e2e velocity policy for G1#489

Draft
lgulich wants to merge 4 commits intorelease/0.1.1from
lgulich/add-agile-wbc-policy
Draft

Add WBC-AGILE e2e velocity policy for G1#489
lgulich wants to merge 4 commits intorelease/0.1.1from
lgulich/add-agile-wbc-policy

Conversation

@lgulich
Copy link
Copy Markdown
Collaborator

@lgulich lgulich commented Mar 20, 2026

Summary

  • Add G1AgilePolicy class integrating the WBC-AGILE end-to-end ONNX policy (unitree_g1_velocity_e2e.onnx) as a new lower-body WBC option alongside the existing Homie policy
  • The AGILE model takes raw sensor inputs and manages observation history internally via ONNX feedback connections, controlling 14 joints (legs + waist_roll/pitch)
  • Register "agile" as a new wbc_version in the policy factory with corresponding AgileConfig dataclass
  • Add download_wbc_models.sh script for downloading the ONNX model with SHA256 verification

Setup

The ONNX model must be downloaded before tests can run:

bash docker/setup/download_wbc_models.sh

This downloads the model from https://github.com/nvidia-isaac/WBC-AGILE and places it at:

isaaclab_arena_g1/g1_whole_body_controller/wbc_policy/models/agile/unitree_g1_velocity_e2e.onnx

Changes (beyond the base PR)

Post-review fixes committed on top:

  • Removed unused _STATE_KEYS class variable from G1AgilePolicy (dead code)
  • Removed assert self.use_policy_action that made the else passthrough branch unreachable
  • Added test_toggle_policy_action test verifying the passthrough toggle works correctly
  • Added TestAgileStability test class with multi-step stability tests (100-200 steps) verifying bounded, non-divergent outputs as a proxy for maintaining root z > 0.5m
  • Fixed import ordering and formatting per pre-commit hooks (black, isort)

Test plan

  • 20 unit tests passing (ONNX model verification, joint mapping correctness, policy integration with mock robot model, multi-env support, reset, multi-step feedback propagation, toggle passthrough, standing/walking stability, balance proxy)
  • Full simulation integration test with IsaacLab environment (requires Docker with GPU)

@lgulich lgulich marked this pull request as draft March 20, 2026 09:47
Integrate the AGILE e2e ONNX policy (unitree_g1_velocity_e2e.onnx) as a new
lower-body WBC policy alongside the existing Homie policy. The AGILE model
takes raw sensor inputs and manages observation history internally via ONNX
feedback connections, controlling 14 joints (legs + waist_roll/pitch).

The ONNX model binary must be obtained separately from
https://github.com/nvidia-isaac/WBC-AGILE and placed at
wbc_policy/models/agile/unitree_g1_velocity_e2e.onnx

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lgulich lgulich force-pushed the lgulich/add-agile-wbc-policy branch from d859868 to 5ff5222 Compare March 20, 2026 09:49
lgulich and others added 3 commits March 20, 2026 10:54
Add docker/setup/download_wbc_models.sh that downloads and SHA256-verifies
the AGILE ONNX model from GitHub. The policy constructor now raises a clear
FileNotFoundError if the model is missing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove unused _STATE_KEYS class variable from G1AgilePolicy
- Remove assert that made use_policy_action toggle dead code
- Add test for toggle_policy_action passthrough behavior
- Add TestAgileStability class with multi-step stability tests
  verifying bounded outputs (proxy for root z > 0.5m)
- Fix import ordering and formatting (pre-commit auto-fixes)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix reset() clobbering cmd for all envs instead of only reset env_ids
- Replace hard-coded 14 with config["num_actions"] in _make_zero_state
- Match base class get_action signature (add time parameter)
- Add missing tests/__init__.py with license header
- Make parent_dir a local variable in __init__ (only used there)
- Add --fail flag to curl in download_wbc_models.sh

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant