Skip to content

Add unified policy evaluation for RL checkpoints - #522

Draft
acrlw wants to merge 10 commits into
mainfrom
feat/dexsim-motion-policy-viewer
Draft

Add unified policy evaluation for RL checkpoints#522
acrlw wants to merge 10 commits into
mainfrom
feat/dexsim-motion-policy-viewer

Conversation

@acrlw

@acrlw acrlw commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR adds embodichain eval-policy as the post-training entry point for EmbodiChain checkpoints and external Policy Profiles.

The change:

  • records training configs and best/latest checkpoints in run-manifest.json;
  • evaluates a training run Headless with the existing episode evaluator;
  • opens the original simulator task with --viewer, using the same observation flattening, deterministic Policy inference, action conversion, reset, and termination behavior as Headless evaluation;
  • supports external policies through a registered Motion Profile that provides the model, resources, Adapter, and runtime settings;
  • writes each result to evaluations/<timestamp>-policy/evaluation.json; and
  • adds a concrete ANYmal-C velocity TorchScript .pt example, Viewer controls, documentation, and focused tests.
flowchart LR
    Run[Training run] --> Manifest[run-manifest.json]
    Manifest --> Runtime[EmbodiChain RL runtime]
    Runtime --> Headless[Headless evaluation]
    Runtime --> Bridge[Task Viewer bridge]
    Profile[External Motion Profile] --> Evaluator[MotionPolicyEvaluator]
    Bridge --> Evaluator
    Headless --> Report[evaluation.json]
    Evaluator --> Report
Loading

Evaluate an EmbodiChain training run:

embodichain eval-policy outputs/<experiment>_<timestamp>
embodichain eval-policy outputs/<experiment>_<timestamp> --viewer --renderer hybrid

Run the external Policy example:

python examples/learning/policy_evaluation/prepare_resources.py
python examples/learning/policy_evaluation/eval_policy.py --viewer --renderer hybrid --sim-device gpu

Viewer controls use Backspace to reset the task and camera, T to switch between tracking and free camera modes, R to start or stop recording, and Esc to close the Viewer. The ANYmal-C example uses W/S for vx, A/D for vy, Q/E for yaw, and M to clear the command.

No linked issue.

Type of change

  • Enhancement (non-breaking change which improves an existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Documentation update

Screenshots

ANYmal-C velocity CartPole GRPO
anymal-c-hybrid-viewer cartpole-grpo-hybrid-viewer

Validation

  • 79 focused Python tests passed after synchronizing with the latest main.
  • All 16 Motion Policy integration tests passed in the isolated evaluation environment.
  • PointMass APG Headless evaluation completed and wrote evaluation.json.
  • CartPole Hybrid Viewer evaluation completed and wrote evaluation.json.
  • The public ANYmal-C .pt completed the selected control steps and wrote evaluation.json.
  • Black 26.3.1 and git diff --check passed.

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • Dependencies have been updated, if applicable.

acrlw added 10 commits August 13, 2026 20:07
- Add --original-task to select the recorded EmbodiChain task.
- Keep task metrics in the final evaluation result.
- Close task resources when evaluator setup or execution fails.
- Write the run manifest after training completes successfully.
- Let explicit config paths override run manifest entries.
- Store implicit recorder output under each run videos directory.
- Build task policy context before applying Viewer reset behavior.
- Document config precedence and the generated output layout.
Add one eval-policy command for Headless, Viewer, and external Profile workflows. Reuse the training runtime, record run manifests, and consolidate the focused documentation and tests.
Use hybrid, fast-rt, and offline-rt consistently across simulation configuration, CLIs, policy evaluation, documentation, and focused tests.
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