Skip to content

feat(envs): improve Go2 flat-walk task - #191

Merged
wlgys8 merged 2 commits into
Motphys:mainfrom
zhanpeng-zhu:feat/go2-walk-flat
Nov 27, 2026
Merged

wlgys8 merged 2 commits into
Motphys:mainfrom
zhanpeng-zhu:feat/go2-walk-flat

Conversation

@zhanpeng-zhu

Copy link
Copy Markdown
Contributor

Summary

Improve the go2-walk-flat task with a measured gait schedule, hard-case command curriculum, updated reward terms, and a trained deployment artifact.

The change keeps training and deployment observation generation consistent and explicitly preserves the existing go2-walk-rough behavior.

Scope

This PR only contains Go2 flat-walk related changes:

  • Go2 flat-walk training configuration
  • Go2 flat-walk runtime behavior
  • Go2 training/deployment gait parity
  • Go2 flat-walk tests
  • Go2 robot model consistency changes required by the trained artifact
  • Replacement of artifacts/go2-walk-flat.deploy

It intentionally does not include:

  • MuJoCo remote-control or operator-input changes
  • Deployment keyboard binding changes
  • command_filter or speed_control configuration
  • Unrelated package, documentation, debug-image, or training-script changes
  • Any new version-numbered task or artifact naming

Upstream deployment contract fields such as motrix-deploy/v1, onnx/v1, and go2_walk/v1 remain unchanged.

Main changes

Gait schedule and training/deployment parity

Add a measured Go2 gait schedule that interpolates gait frequency and swing fraction from planar command speed:

  • gait_schedule_speed_low/high
  • gait_schedule_frequency_low/high
  • gait_schedule_swing_fraction_low/high
  • gait_schedule_smoothing_time_s
  • gait_schedule_yaw_weight
  • gait_schedule_lateral_weight

The same schedule is serialized into the deployment task profile and implemented by Go2WalkPolicyProcessor, so deployed observation phase progression matches the trained policy.

Standing and walking transitions now restart from the full-support phase, and this behavior is covered by training/deployment parity tests.

Command curriculum

Add configurable hard-case command sampling and a training-iteration-based curriculum for Go2 flat-walk.

The Go2 flat configuration covers the expanded yaw envelope and includes hard commands for lateral motion, yaw, combined forward/lateral/yaw motion, and boundary speeds. Evaluation/play configurations disable hard-case sampling and curriculum.

Reward and walking behavior

Refine the Go2 flat reward and walking behavior with:

  • Directional forward/lateral velocity tracking sigmas
  • Feet-spacing reward
  • Touchdown-velocity reward
  • Hip-position and base-COM posture terms
  • Flat-orientation and joint-acceleration terms
  • Sinusoidal swing-foot trajectory with configurable rise/plateau fractions
  • Swing-contact slip handling
  • Static-stance anchoring
  • Posture constraints that remain active for standing and sagittal walking while becoming softer for lateral/yaw commands

Rough isolation

go2-walk-rough explicitly stays on its upstream behavior:

  • Fixed-frequency gait remains enabled
  • gait_schedule_enabled is False
  • Sliding friction remains (0.4, 0.9)
  • High-traction friction sampling remains disabled
  • Hard-case sampling and curriculum remain disabled
  • Reward scales and key reward parameters remain at the upstream baseline

Training/deployment parity tests continue to cover both go2-walk-flat and go2-walk-rough.

Go2 model changes

Two Go2-wide model changes are required by the trained artifact:

  • motrix_robots/src/motrix_robots/unitree.py: rear thigh default pose changes from 1.0 to 0.8
  • motrix_robots/src/motrix_robots/assets/go2/go2_mjx.xml: remove the default joint damping="2"

These values are reflected in the exported artifact and are needed for consistency with the trained policy.

Deployment artifact

The trained artifact is included at:

  • artifacts/go2-walk-flat.deploy/manifest.json
  • artifacts/go2-walk-flat.deploy/policy/model.onnx

Policy SHA-256:

e7212d9500aa89a51c93031894901dee7a5b708017bdc167a9024a13b821efb7

The hash recorded in the manifest matches the actual ONNX file.

Tests

Target tests:

.venv/bin/python -m pytest -q \
  motrix_envs/tests/test_quadruped_walk.py \
  motrix_deploy_tasks/tests/test_go2_walk.py \
  motrix_deploy_tasks/tests/test_training_parity.py \
  motrix_env_core/tests/test_input.py

Result:

276 passed, 11 warnings

Quick suite:

.venv/bin/python -m pytest -q -m "not slow and not integration"

Result:

2217 passed, 3 skipped

Pre-commit:

/home/zzp/.local/bin/uvx prek run --all-files

Result:

all hooks passed

Whitespace check:

git diff --check upstream/main...HEAD

Result:

passed

@wlgys8
wlgys8 merged commit 5aa2ed3 into Motphys:main Nov 27, 2026
12 checks passed
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