Skip to content
grey-xhPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

WMP

Code for the paper:

World Model-based Perception for Visual Legged Locomotion

Hang Lai, Jiahang Cao, JiaFeng Xu, Hongtao Wu, Yunfeng Lin, Tao Kong, Yong Yu, Weinan Zhang

Requirements

  1. Create a new python virtual env with python 3.6, 3.7 or 3.8 (3.8 recommended)
  2. Install pytorch:
    • pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
  3. Install Isaac Gym
  4. Install other packages:
    • sudo apt-get install build-essential --fix-missing
    • sudo apt-get install ninja-build
    • pip install setuptools==59.5.0
    • pip install ruamel_yaml==0.17.4
    • sudo apt install libgl1-mesa-glx -y
    • pip install opencv-contrib-python
    • pip install -r requirements.txt

Training

python legged_gym/scripts/train.py --task=a1_amp --headless --sim_device=cuda:0

Training takes about 23G GPU memory, and at least 10k iterations recommended.

For a small debugging run on a GPU with limited memory (such as a 2 GB MX450):

conda activate wmp
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json
export OMP_NUM_THREADS=2
export MKL_NUM_THREADS=2
python legged_gym/scripts/train.py --task=a1_amp_low_mem --headless --sim_device=cuda:0 --max_iterations=10

The a1_amp_low_mem task uses 16 environments, 4 depth cameras, a smaller terrain, smaller PhysX and AMP buffers, and runs the world model and depth predictor on CPU. Training excludes tilt and crawl terrain; their combined 10% share is assigned to rough flat terrain, increasing its share to 15%. World model training uses batches of 2 sequences with up to 8 frames each, and starts after 32 recorded transitions. Logs are saved under logs/a1_amp_low_mem/. This configuration is for testing the training pipeline; CPU computation is slower and the small batches do not reproduce the paper's training setup. The original a1_amp task keeps its full training configuration. On laptops with integrated graphics, VK_ICD_FILENAMES selects the NVIDIA Vulkan driver so camera rendering uses the same GPU as CUDA. Adjust the path if the NVIDIA ICD file is installed elsewhere.

For the local Unitree Go2 model, use go2_amp_low_mem on the MX450:

python legged_gym/scripts/train.py --task=go2_amp_low_mem --headless --sim_device=cuda:0 --max_iterations=1000

Use the same environment variables shown above. This task loads resources/robots/unitree_go2/urdf/go2.urdf, uses Go2 joint limits, PD gains, leg geometry, body height and camera placement, and keeps the low-memory settings and terrain mix without tilt/crawl. Go2 PD gains start from Isaac Lab's Go2 configuration. Training outputs are saved separately under logs/go2_amp_low_mem/WMP/. The go2_amp task provides the full-size version for a GPU with sufficient memory.

Start a new Go2 training run rather than resuming an A1 checkpoint. The existing quadruped AMP motions are reused as a starting motion prior: their joint order is FL, FR, RL, RR, matching both imported robots. These clips have not been retargeted to Go2; successful startup does not establish the final locomotion quality.

Go2 flat-ground velocity tracking

Use go2_velocity to learn basic body-frame velocity tracking before terrain fine-tuning. It uses 1024 environments, 8 cameras, a level plane and the same policy/world-model architecture as the terrain stage. Commands cover forward speeds of 0.15–0.6 m/s, lateral speeds of ±0.25 m/s, yaw rates of ±0.8 rad/s, and 10% standing commands. Reset disturbances are reduced, and task rewards include exact velocity errors, upright posture and body height.

The trot clips provide a motion prior and initially 75% of training reset states; the remaining resets start from standing. After 500 updates, the reference-reset probability decreases linearly to zero at update 1000, so later training learns to start and maintain locomotion from standing. Reference feet are aligned using Go2 kinematics. Playback and evaluation always start from ordinary standing states. World-model features are warmed up for 100 updates and introduced gradually over the next 200 updates; the world model continues learning during this period.

With the Conda, library and Vulkan variables above set, start a new run:

python legged_gym/scripts/train.py --task=go2_velocity --headless --sim_device=cuda:0 --run_name=flat --max_iterations=2000

The flat-ground profile runs the world model on the GPU and stores trajectory datasets in CPU memory, transferring sampled batches for learning. Visual inference uses chunks of 128 environments and 8 PPO minibatches to limit temporary allocations. A local headless run with 1024 environments used approximately 1.5 GB on the 2 GB MX450. To reduce GPU memory use, add --num_envs=128 --wm_device=cpu; this collects fewer transitions per update, so equal iteration counts do not represent equal training data.

Checkpoints are saved every 50 updates in logs/go2_velocity/flat/, alongside a resolved config.json and TensorBoard events. The training entry point respects the task's configured save interval. New checkpoints include the depth predictor, AMP discriminator, normalizer, all optimizers and current learning rate. On continuation, simulation states and replay datasets are collected again. Edit legged_gym/envs/go2/go2_velocity_config.py for future runs; configuration files under logs/ are snapshots of earlier runs.

Evaluate a saved policy independently of the training rewards:

python legged_gym/scripts/evaluate_velocity.py --task=go2_velocity --headless --sim_device=cuda:0 --load_run=flat --assert_tracking

The default evaluation tests standing, three forward speeds, lateral motion and turning, using reset/latent seeds 7, 19 and 41 for 20 seconds each. The first 2 seconds are excluded from speed errors, but falls during that time still count. The JSON report records measured velocities, absolute errors, falls and upright fractions; a compressed NPZ contains the velocity traces and a PNG plots targets against measured velocities. A passing report requires all 24 trials to satisfy tracking and stability gates with fully enabled world-model features. A stationary policy cannot pass the moving-command cases. Use --commands, --eval_seeds, --duration and --report for additional checks.

Playback with an explicit speed command:

python legged_gym/scripts/play.py --task=go2_velocity --sim_device=cuda:0 --num_envs=1 --load_run=flat --terrain=flat --command_vx=0.4

The local checkpoint logs/go2_velocity/flat_v6_1024/model_1020.pt passed all 24 evaluation trials (three seeds, eight commands, 20 seconds, no falls). Mean forward speeds for targets 0.2 / 0.4 / 0.6 m/s were 0.163 / 0.366 / 0.641 m/s. Results and traces are saved in logs/go2_velocity/flat_v6_1024/eval_1020_full.{json,npz,png}. Play this validated checkpoint with:

python legged_gym/scripts/play.py --task=go2_velocity --sim_device=cuda:0 --num_envs=1 --load_run=flat_v6_1024 --checkpoint=1020 --terrain=flat --command_vx=0.4

After the flat-ground policy passes evaluation, initialize the compatible terrain curriculum from that checkpoint. The remaining terrain mix is 5% slope, 15% stairs up, 15% stairs down, 25% gap, 25% climb and 15% rough flat. tilt and crawl both have zero environments. The task uses 320 environments, 8 cameras covering all six types, and 10 difficulty levels. Compact terrain columns share geometry within each type while preserving these environment proportions. Gap tracks have a stable run-in at tile connections, so entering a higher difficulty is controlled by the curriculum. Their two internal gaps retain the configured widths. The terrain task uses the original stronger stuck penalty to discourage waiting indefinitely in front of an obstacle.

python legged_gym/scripts/train.py --task=go2_velocity_terrain --headless --sim_device=cuda:0 --resume --load_run="$PWD/logs/go2_velocity/flat_v6_1024" --checkpoint=1020 --run_name=terrain_no_tilt_crawl --max_iterations=1000

The local continuation completed 1000 additional updates from checkpoint 1020, saved as logs/go2_velocity_terrain/no_tilt_crawl/model_2020.pt. The evaluation and playback examples below use that run.

--max_iterations specifies the number of additional updates when resuming. This stage keeps the observation and network dimensions unchanged, and increases terrain difficulty according to the existing distance-based curriculum. Obstacle tracks use forward velocity commands and heading correction; rough flat retains the foundation's omnidirectional commands. The flat-ground height penalty is disabled because averaging heights across deep gaps does not estimate support height. Per-tensor Adam and CPU replay storage keep the local GPU usage near 1.6 GB on the MX450.

terrain_layout.json records the actual environment and camera counts. TensorBoard logs Terrain/<type>/mean_level and max_level. New checkpoints preserve terrain levels; continuation restores them when the environment count and layout match. Manual resets preserve these levels. The local logs/go2_velocity_terrain/no_tilt_crawl_320_lowpeak/smoke_validation.json records 30 successful updates, including all four models, optimizers and curriculum state.

Measure traversal on fixed levels, independently of training resets:

python legged_gym/scripts/evaluate_terrain.py --task=go2_velocity_terrain --headless --sim_device=cuda:0 --load_run=no_tilt_crawl --checkpoint=2020 --levels=0,1,2 --report=logs/go2_velocity_terrain/no_tilt_crawl/eval_2020.json

The evaluator balances the six types and selected difficulty levels, tests three seeds for 20 seconds, and reports reaching the forward tile boundary before the first fall separately from surviving the full episode. JSON and NPZ results allow comparison with the flat policy's baseline at logs/go2_velocity_terrain/no_tilt_crawl/baseline_1020.json. The level labels describe the starting tile. After clearing it, a continuing robot can enter neighboring difficulty tiles; full-rollout survival includes those later contacts. The evaluator also writes .diagnostics.npz and .diagnostics.json: read-only traces of body/foot positions, forces, joints and actions captured before reset. Each original trial stops recording at its first fall, timeout or clearance. These traces help explain failures without changing acceptance counts; pass --no_diagnostics to skip them. Reports fingerprint the generated height map and physical configuration; the comparison tool rejects mismatched scenes or trial conditions.

The completed run was evaluated on levels 0, 1 and 2 with seeds 7, 19 and 41 (216 trials, 20 seconds each). Matched-scene track clearance was:

Terrain Before (1020) After (2020)
Slope 13.9% 100.0%
Stairs up 0.0% 66.7%
Stairs down 13.9% 11.1%
Gap 2.8% 19.4%
Climb 13.9% 58.3%
Rough flat 22.2% 100.0%

This checkpoint still stalls on harder steps and downward stairs. No level-1 or level-2 gap trials cleared the track; the gap successes were all at level 0, where the internal gap width is zero. These results do not establish competence across all ten curriculum levels. See eval_2020.json and comparison_2020.{json,png} in the run directory for per-level results.

Flat-ground retention passed 19/24 trials with no falls. Positive lateral motion failed all three seeds, and positive yaw failed two seeds; straight forward commands passed all nine trials. See flat_retention_2020.{json,npz,png}. The original flat checkpoint above remains available and passed 24/24 trials. checkpoint_2020_validation.json verifies all four models were updated with finite parameters, the optimizer steps advanced, and curriculum state was saved.

Generate the before/after comparison (conditions must match):

python legged_gym/scripts/compare_terrain.py --before=logs/go2_velocity_terrain/no_tilt_crawl/baseline_1020.json --after=logs/go2_velocity_terrain/no_tilt_crawl/eval_2020.json --output=logs/go2_velocity_terrain/no_tilt_crawl/comparison_2020

Play a chosen terrain and difficulty (change climb to gap, stair or slope):

python legged_gym/scripts/play.py --task=go2_velocity_terrain --sim_device=cuda:0 --num_envs=1 --load_run=no_tilt_crawl --checkpoint=2020 --terrain=climb --terrain_level=1 --command_vx=0.4

This command was checked with the viewer: the 20-second rollout had no falls, averaged 0.283 m/s forward speed, and reached 4.58 m from the tile origin. play_climb_level1.json records the measurements; screenshots at 5 and 15 seconds are saved beside it. This single rollout supplements the multi-seed evaluation.

Further traversal training is in progress under logs/go2_traversal/. go2_traversal adds forward progress and one-time clearance rewards, a directional curriculum, swing-foot clearance shaping and balanced world-model terrain sampling. After 200 updates, traverse_v1/model_2220.pt improved stairs-down clearance from 4/36 to 28/36, but still cleared no level-2 upstairs or level-1/2 gap trials. Early profiles did not achieve the 80% traversal target. The rendered-camera v11 results and the outstanding flat-control regression are documented below.

go2_traversal_v2 keeps the same evaluation geometry and physics. During training, half the environments rehearse fixed level-1/2 terrain, and the policy receives adaptive swing and contact-based support-height rewards. Exploration noise is increased on training loads; inference loads preserve the saved policy state. run_traversal_experiment.py runs training and evaluation sequentially to stay within the MX450 memory limit. For a new experiment directory:

python legged_gym/scripts/run_traversal_experiment.py --task=go2_traversal_v2 --source_run=traverse_v1 --source_checkpoint=2220 --run_name=traverse_trial --iterations=300

Inspect experiment_status.json, eval_<iteration>.json and comparison.png inside that run. The confirmed target is above 80% for each terrain type across equally sampled starting levels 0, 1 and 2. Every level's results are also reported separately. Passing development trials still requires held-out-seed evaluation and viewer verification; the experiment script never marks the goal complete. logs/go2_traversal/goal_status.json records the active acceptance conditions and latest run.

To assess a saved mixed-depth report against this target:

python legged_gym/scripts/assess_traversal.py --report=logs/go2_traversal/traverse_v4/eval_3320.json --output=logs/go2_traversal/traverse_v4/assessment_3320.json --expected_seeds=7,19,41

The assessment requires balanced levels and at least 36 trials per terrain. It recomputes success from the trial counts and preserves per-level diagnostics; an overall average cannot substitute for a failing terrain type.

The second branch, traverse_v2/model_2520.pt, cleared all 36 stairs-down trials, but still cleared no level-2 upstairs or nonzero-gap trials. It also overshot velocity commands and lost stability. The current go2_traversal_v3 branch caps progress reward at commanded speed, rewards new forward contacts on safe support, penalizes unsafe footholds, and reduces exploration noise. A quarter of eligible training gap resets use a supported bridging stance to supply landing/recovery experience. This initialization is disabled whenever curriculum is off, including all independent evaluation and playback. Evaluation geometry, original standing starts, first-fall accounting and the four-metre clearance gate remain unchanged.

For a sensor-source diagnosis, ablate_traversal_depth.py evaluates the same physical cameras and starting conditions twice, changing only the images fed to the world model. It waits for the run's training/evaluation pipeline to exit:

python legged_gym/scripts/ablate_traversal_depth.py --task=go2_traversal_v3 --load_run=traverse_v3 --checkpoint=2820

This produces depth_ablation_2820.json; it is a separate diagnostic rather than the original mixed-depth benchmark. The comparison tool rejects reports with different depth sources.

traverse_v3/model_2820.pt reached 83.3% stairs-up, 100% stairs-down and 94.4% climb clearance on the mixed-depth development benchmark; slope and rough flat were 100%, but gap remained 22.2%. Level-2 stairs-up alone was 50%. The traversal goal is still active. Sensor-source diagnostics and depth-image comparisons are saved in that run's depth_ablation_2820.json and depth_*.depth.png files.

vision_pretrain contains 21,371 rendered-depth/input pairs, a depth-predictor pretraining run and validation results. Training used seeds 7/19 with seed 41 reserved for visual validation; final traversal hold-out seeds remain separate. The selected predictor reduced validation MSE for gap levels 0/1/2 by about 44% / 49% / 55%. checkpoint_validation.json verifies that this stage changed only the depth predictor and its optimizer, with no additional PPO updates.

vision_pretrain/gap_location_probe_3320.json probes six gap-location classes on the saved data, using rollout seeds 7/19 for training and 41 for validation. Mean balanced accuracy across three probe initializations was 41.7% from proprioception, 72.0% with rendered depth, 89.6% with predicted depth and 98.2% with the privileged map. Predicted images retain location information; these offline results do not establish that the control policy uses it successfully. The script probe_traversal_depth.py runs this diagnosis entirely on CPU.

The completed go2_traversal_v4 experiment initialized from vision_pretrain/model_2820.pt, adds gap-lane centering and edge-aware online depth supervision, and doubles the world-model training sequence from 16 to 32 frames (about 1.6 to 3.2 seconds). Its batch size changes from four to two to preserve the number of frames per world-model update. The local run targets 3320:

python legged_gym/scripts/run_traversal_experiment.py --task=go2_traversal_v4 --source_run=vision_pretrain --source_checkpoint=2820 --run_name=traverse_v4_trial --iterations=500

The completed traverse_v4/model_3320.pt cleared all upstairs/downstairs trials at levels 0/1/2 and 91.7% of climb trials, with 100% slope/rough-flat clearance. Gap remained 33.3%, entirely from zero-width level 0. A controlled training-start diagnostic did not show an advantage for the proposed default-PD bridge pose; its results are in traverse_v4/bridge_diagnostic_3320.json and are not acceptance trials, because they intentionally start over the gap.

The active go2_traversal_v6 branch initializes from checkpoint 3320. It enables the existing world-model reward head, whose previous loss scale was zero, and records the pre-reset ending state, action and accumulated reward interval. Previously the completed buffer was copied before the ending reward was stored. Training now samples episode-ending windows as well as ordinary windows. traverse_v6/terminal_training_check.json confirms real failure frames are being recorded and the reward head is active.

This branch also rewards each foot's first supported landing across the forward gap. Starting in a bridge stance earns no crossing bonus. Successful training episodes reset at the original four-metre boundary; independent evaluation and playback retain their original starts, duration and first-fall accounting. The local experiment targets checkpoint 4320 after 1000 additional PPO updates:

python legged_gym/scripts/run_traversal_experiment.py --task=go2_traversal_v6 --source_run=traverse_v4 --source_checkpoint=3320 --run_name=traverse_v6_trial --iterations=1000

The completed checkpoint 4320 cleared 2/12 level-1 and 3/12 level-2 gap trials; including level 0, gap clearance was 47.2%. Rough-flat clearance fell to 61.1%. Intermediate checkpoints 3800/4000/4200 were also evaluated under the same conditions; none met the per-terrain target. Recorded decision features reproduce the executed actions within 4.3e-6 after the configured action clipping. traverse_v6/policy_probe_4320.json found weak gap-location information in the world-model state and its actor encoding; these probes are diagnostics only.

The go2_traversal_v7 continuation added training supervision for local and forward terrain profiles to the existing WMP feature dimensions, and local-map supervision to the actor's existing WMP encoding. Maps are training targets and are not added to inference inputs. Model shapes and optimizer parameter sets are unchanged. The branch also restores complete training episodes and reduces the single-foot crossing bonus from five to one. Speed may vary with terrain needs; the nominal velocity preference has lower weight and there is no fixed-speed error penalty. Evaluation keeps the same nominal command for comparison, while clearance remains the success criterion. The completed local run continued 4320 to 4920:

python legged_gym/scripts/run_traversal_experiment.py --task=go2_traversal_v7 --source_run=traverse_v6 --source_checkpoint=4320 --run_name=traverse_v7_trial --iterations=600

Checkpoint 4920 cleared all 36 trials in each of the five non-gap terrain types; gap remained 12/36, exclusively zero-width level 0. Matched rendered/predicted depth diagnostics also cleared no level-1/2 gaps. The direct forward-profile output averaged 0.130 on void cells and 0.126 on ordinary cells, identifying a regression loss dominated by common ground cells despite better information elsewhere in the learned features. The diagnostic reports are in traverse_v7/.

The go2_traversal_v8 continuation balances void and ordinary cells in both terrain-memory losses. It adds a bounded swing-foot reach potential: extending above the gap earns progress, while retracting or falling below the platform removes that credit. Initial bridge poses earn none, and stationary feet earn no repeated progress. Terrain geometry, sensor setup, policy inputs and variable-speed preference are preserved. The completed local target was 5520:

python legged_gym/scripts/run_traversal_experiment.py --task=go2_traversal_v8 --source_run=traverse_v7 --source_checkpoint=4920 --run_name=traverse_v8_trial --iterations=600

Checkpoint 5520 retained 100% clearance in the five non-gap terrain types. Gap clearance reached 22/36 (61.1%): levels 0/1/2 cleared 12/12, 8/12 and 2/12. A matched 36-camera sensor diagnosis also produced real-gap successes with rendered depth, while level 2 remained weak. These results remain below target.

The active go2_traversal_v9 continuation fixes supervision timing. The initial deterministic RSSM state has not yet received the current image: its terrain target is masked at each training-window start. PPO carries a decision-time memory-valid flag with each shuffled transition and masks its terrain loss until a previous observed posterior is available. Robot resets clear cached WMP features. These changes add no map input or neural parameters. The v8 rewards, original terrain/sensors and variable-speed preference remain. The target is 6120:

python legged_gym/scripts/run_traversal_experiment.py --task=go2_traversal_v9 --source_run=traverse_v8 --source_checkpoint=5520 --run_name=traverse_v9_trial --iterations=600

Speed may be chosen to suit the terrain. evaluate_traversal_speeds.py can wait for a recorded training process and then serially test nominal commands 0.6 and 0.8 m/s if the 0.4 m/s baseline does not meet the development target. Each trial still uses the original geometry, standing starts, 20-second duration and first-fall clearance rule. Reports explicitly record the changed command; a passing speed candidate still requires held-out and rendered-depth verification.

Regression checks:

python -m unittest legged_gym.tests.test_go2_velocity legged_gym.tests.test_go2_traversal legged_gym.tests.test_go2_obstacle_rewards -v

go2_traversal_v11 adds coordinated obstacle actions and straight-track rewards, inspired by multi-leap's field rewards (sync_all_legs_cond, yaw_abs, lin_pos_y, hip_pos) and its Go2 leap configuration. The reference's conditional synchronization functions are adapted explicitly here; its Go2 leap config itself enables yaw, lateral-position and hip penalties.

Reward Scale Behavior
track_heading -0.8 Penalize absolute yaw away from the obstacle track's world +X direction.
track_centering -2.0 Penalize deviation from the straight approach line, with a 5 cm tolerance; gaps use the lane center, other tracks use the episode's initial lateral position.
track_lateral_velocity -0.5 Penalize world lateral velocity.
obstacle_hip_pos -1.0 Discourage excessive hip abduction.
obstacle_symmetry -0.25 Mirror left/right hip targets and match thigh/calf targets near shared gap/raised-platform edges. Front and rear pairs remain independent.
gap_pair_landing 100 Reward each pair once after both feet cross the main gap and hold safe support for 3 consecutive policy steps (0.06 s). Replaces single-foot gap-touch rewards.

These constraints apply to forward obstacle commands; flat-ground lateral/turning commands retain their velocity-tracking rewards. On obstacle tracks, world forward speed earns a bounded reward up to the nominal command, with no loss for exceeding it during a jump. The stuck penalty only requires 0.05 m/s forward motion, and swinging feet while stationary earns no adaptive-swing reward. There is no gait clock, forced simultaneous front/rear action, or scripted joint action. The new profile keeps the same 320 environments and physical terrain, and inherits v10's 16 training cameras and balanced rendered-depth replay. Old task versions and checkpoints remain usable. Straight obstacle play keeps the training heading correction enabled; explicit lateral/yaw commands and flat play remain available.

Reward changes require further training; playing the old checkpoint alone does not teach it the new behavior. Continue from the existing v9 checkpoint into a new run (600 additional updates produce checkpoint 6720):

python legged_gym/scripts/train.py --task=go2_traversal_v11 --headless --sim_device=cuda:0 --wm_device=cuda:0 --resume --load_run=traverse_v9 --checkpoint=6120 --run_name=traverse_v11 --max_iterations=600

After that training finishes:

python legged_gym/scripts/play.py --task=go2_traversal_v11 --sim_device=cuda:0 --wm_device=cuda:0 --num_envs=1 --load_run=traverse_v11 --checkpoint=6720 --terrain=gap --terrain_level=1 --command_vx=0.4

The reward profile must still pass held-out rendered-camera evaluation; the prior v9 rendered-camera gap result was 17/36 (47.2%). Reward/unit checks or a short training smoke run do not establish improved traversal success.

The v11 smoke continuation reached checkpoint 6160 with all 75 regression tests passing. The 320-environment, 16-camera run performed 56 world-model and 50 depth predictor updates; all checkpoint tensors were finite and network shapes remained compatible. Reports are in logs/go2_traversal/traverse_v11_smoke_wm/. The formal continuation resumes that checkpoint for another 560 updates to 6720:

python legged_gym/scripts/run_traversal_experiment.py --task=go2_traversal_v11 --source_run=traverse_v11_smoke_wm --source_checkpoint=6160 --run_name=traverse_v11 --iterations=560 --rendered_validation

--rendered_validation adds 216 development trials with all 36 cameras rendered after the usual mixed-depth evaluation. If every terrain passes, it runs another 216 trials with separate held-out seeds. Both reports balance levels 0, 1 and 2, keep the original ground roughness and physics, and expose per-level results. The pipeline never marks the overall goal complete; playback, retention and the final evidence audit remain necessary. Evaluation diagnostic archives also record the actual root quaternion and lateral distance from the approach line. Their JSON includes sampled heading error and path deviation for each terrain/level, with equal weighting across trials. These measurements describe straight motion without changing actions or success rules.

Checkpoint logs/go2_traversal/traverse_v11/model_6720.pt passed the original single-tile traversal criterion on rendered cameras. Its separate fresh-seed run cleared gap 34/36 (94.4%), including level 2 at 10/12 (83.3%); each other terrain cleared 36/36. Matched old seeds improved gap from v9's 17/36 to 33/36. Ordinary viewer play cleared the first gap at levels 1 and 2. These results preserve the original terrain/physics and first-fall criterion; they do not imply indefinite survival in the harder neighboring tiles reached later in a 20-second rollout.

Flat command retention exposed a regression: v11 passed 0/24 strict tracking trials, and zero command still produced about 0.3 m/s forward motion. The go2_traversal_v12 correction restricts speed freedom to nearby height changes, adds flat straight/standing command samples during training, and freezes v11's world model/depth predictor while refining the controller. Commands on clear ground recover their normal tracking reward; speed remains flexible near obstacles. The geometry, sensors, action space and all previous tasks/checkpoints remain.

python legged_gym/scripts/run_traversal_experiment.py --task=go2_traversal_v12 --source_run=traverse_v11 --source_checkpoint=6720 --run_name=traverse_v12_control --iterations=300 --flat_precheck --rendered_validation

This continuation must recover flat control and retain the traversal results before it is considered a replacement for v11. Regression checks now include 78 tests, covering obstacle-local speed freedom and evaluation command invariance.

High climb and consecutive gap learning

go2_parkour continues the Go2 WMP policy with the original robot, action scale, and terrain generator. Its curriculum can reach level 9 (nominal 54 cm climb, 90 cm gap). Hop and trot references are both used. Terrain and contact data define training rewards for body lift, foot reach, takeoff, pair landing, and stable recovery at each successive obstacle; they are not extra actor inputs. Obstacle pitch is allowed while sideways falls and body/head collisions remain termination conditions. Ordinary tasks and existing checkpoints retain their configurations. Implementation and smoke checks do not establish this skill.

With the Conda/library/Vulkan variables above set, the first continuation is:

python legged_gym/scripts/train.py --task=go2_parkour --headless --sim_device=cuda:0 --wm_device=cuda:0 --resume --load_run=parkour_v1_smoke --checkpoint=7030 --run_name=parkour_v1 --max_iterations=200

Use evaluate_terrain.py for comparison on the original difficulty grid. The new evaluator additionally repeats the original terrain generator at an explicit fixed level and measures consecutive crossings before the first fall. It checks actual feet, load-bearing contacts, body height and stable recovery independently of training reward counters. --capture records ordinary viewer actions:

python legged_gym/scripts/evaluate_parkour.py --task=go2_parkour --sim_device=cuda:0 --wm_device=cuda:0 --load_run=parkour_v1 --checkpoint=7230 --terrain=climb --level=9 --obstacles=3 --eval_seeds=101,211,307 --capture --report=logs/go2_traversal/parkour_v1/climb9/assessment.json
python legged_gym/scripts/evaluate_parkour.py --task=go2_parkour --sim_device=cuda:0 --wm_device=cuda:0 --load_run=parkour_v1 --checkpoint=7230 --terrain=gap --level=9 --obstacles=3 --eval_seeds=101,211,307 --capture --report=logs/go2_traversal/parkour_v1/gap9/assessment.json

Training and physical validation status is tracked in logs/go2_traversal/parkour_goal_status.json; the goal remains incomplete until high-obstacle and consecutive-motion playback actually pass.

The first 210-update continuation (parkour_v1/model_7230.pt, including the 10-update smoke run) improved three consecutive nominal 18 cm platforms from 1/3 to 3/3 trials versus v12/7020 under identical assessment geometry and physics. Nominal 30/54 cm climb and consecutive gap assessment still failed. These are small diagnostic samples and do not establish high-obstacle ability.

go2_parkour_v2 renders all 96 training cameras, adds bounded one-time progress for nose-up preparation and gap approach speed, and penalizes prolonged stalls after allowing a brief weight-transfer pause. The next continuation is:

python legged_gym/scripts/train.py --task=go2_parkour_v2 --headless --sim_device=cuda:0 --wm_device=cuda:0 --resume --load_run=parkour_v2_smoke --checkpoint=7240 --run_name=parkour_v2 --max_iterations=300

This targets checkpoint 7540. Evaluate it with the commands above after changing the task to go2_parkour_v2, run to parkour_v2, and checkpoint to 7540. skill_progress.json in the run directory records live training telemetry; its reward/curriculum statistics do not replace independent physical playback.

Checkpoint parkour_v2/model_7540.pt still failed consecutive 54 cm climb and 90 cm gap assessment (0/3 each). One 30 cm platform crossing was recorded, but the three-obstacle sequence failed. These results do not complete the goal.

Contact criterion version 2 checks the foot-center height within [-3.5,+4.5] cm of its local surface-relative contact height as well as force, landing boundary and stable recovery. Reanalysis of the original recorded trajectories reproduces their geometry hashes and retains the earlier nominal 18 cm result. New reports record local support heights and reject prepared starts during standing-start assessment.

go2_parkour_phase adds training-only supported starts from measured native physics states in datasets/parkour_phase_starts.json. They rehearse high-climb front support/rear landing and gap recovery. Only one quarter of obstacle slots use these starts; ordinary starts continue across obstacles. Prepared episodes never advance the standing-start curriculum and are disabled in evaluation. No phase flag or additional terrain input is given to the actor, and no script replaces its actions. The next continuation is:

python legged_gym/scripts/train.py --task=go2_parkour_phase --headless --sim_device=cuda:0 --wm_device=cuda:0 --resume --load_run=parkour_v3_phase_smoke --checkpoint=7550 --run_name=parkour_v3_phase --max_iterations=300

The full benchmark can wait for a verified live training PID, then assess both high targets and intermediate skills without stopping after an easier failure:

python legged_gym/scripts/benchmark_parkour.py --task=go2_parkour_phase --load_run=parkour_v3_phase --checkpoint=7850 --wait_pid=TRAINING_PID

Prepared recovery counts are component-practice telemetry, not proof of a 54 cm or consecutive-gap skill from a normal start. The full goal remains open.

Released WMP policy adapted to Go2

A step-by-step clean-run guide is available in handup.md. It includes an independent rebuild entry, fresh selector-data collection, and physical acceptance commands, and distinguishes random initialization from the public pretrained-weight route without relying on historical logs/go2_traversal runs.

The complete protected bundle also has a standalone MuJoCo preview: python legged_gym/scripts/play_mujoco.py --terrain gap --gap-width .6 --vx .6 --obstacle-x 2.4 --spacing 4. Add --show-depth for a live inset of the actual delayed policy depth input; press D to toggle it. For one continuous mixed course, use --terrain mixed --mixed-sequence step,gap --obstacles 4 with --step-height .18 --gap-width .6 --vx .6 --obstacle-x 2.4 --spacing 4 --duration 30. The same frozen bundle and recurrent state run throughout the course; terrain labels only describe geometry/evaluation. Install the optional requirements-mujoco.txt in the WMP environment first. See handup.md, section 14 for window/headless commands, sensor/control alignment, recorded results and the different terrain geometry.

The public checkpoint from WMP issue 12 is preserved under logs/go2_traversal/original_wmp_reference. Its native Go2 transfer uses the Go2 URDF, original stance, Kp40/Kd1, original action scaling and torque limits. The retained filename model_10000.pt does not describe actual Go2 training updates. The user's v12/7020 checkpoint remains a separate control.

The current target is retained locomotion with stable 60 cm gaps. Task go2_wmp_preserved60 caps actual collision openings at 0.6 m and its gap curriculum at level 6; 54 cm climbing and other terrain geometry remain intact. The older go2_wmp_transfer and go2_wmp_gap70 configurations retain their historical limits for reproducibility. Seventy-centimeter ability is outside the current acceptance target. The global stance-extension experiment was rejected.

Expanded reset testing exposed failures in earlier small-sample results. The fixed CNN-selector package wmp_protected_visible_hold_v1 now has 16/19 recorded three-gap successes at 60 cm. It retained 15/15 flat controls and completed the first 54 cm climb in 3/3 trials, three successive climbs in 2/3. A fused-selector candidate achieved 17/19 but switched too early on 30 cm gaps; it is not adopted. No package is currently described as fully accepted for stable 60 cm traversal.

A separate go2_wmp_gap60_retained training copy addresses the mismatch between late visual takeover and the older expert's earlier preparation region. It preserves the original general expert and 410-update gap expert as fixed training references, freezes perception, caps gaps at 60 cm, and replays lower gaps, climbs and flat terrain. The new copy must pass physical gap and retention checks before replacing a reference. Fixed inference packages reject direct PPO updates to their protected experts.

Current results, failures and exact validation paths are recorded in preservation_progress_20261111.md. A diagnostic replay of the original fixed package can be run with the environment variables above; it includes known failures and is not an acceptance claim:

python legged_gym/scripts/evaluate_parkour.py --task=go2_wmp_preserved60 --sim_device=cuda:0 --wm_device=cuda:0 --load_run=wmp_protected_visible_hold_v1 --checkpoint=10000 --terrain=gap --level=6 --obstacles=3 --duration=40 --eval_seeds=3137,307,211,101 --capture --report=/tmp/go2_gap60_reference_check.json

Visualization

Please make sure you have trained the WMP before

python legged_gym/scripts/play.py --task=a1_amp --sim_device=cuda:0 --terrain=climb

To play checkpoint logs/a1_amp_low_mem/WMP/model_10.pt with a single robot, use the same environment variables as the low-memory training command above, then run:

python legged_gym/scripts/play.py --task=a1_amp_low_mem --sim_device=cuda:0 --num_envs=1 --load_run=WMP --checkpoint=10 --terrain=climb

Omit --headless to display the viewer. Press Escape or close the window to exit. Playback uses smooth ground surfaces by default while keeping the selected gaps, stairs or other obstacles. Add --rough_ground to restore random bumps. Training and evaluation keep their original roughness settings.

After training Go2, play its checkpoint with:

python legged_gym/scripts/play.py --task=go2_amp_low_mem --sim_device=cuda:0 --num_envs=1 --load_run=WMP --checkpoint=1000 --terrain=climb

Set --checkpoint to a saved Go2 iteration, or omit it to load the latest Go2 model.

Acknowledgments

We thank the authors of the following projects for making their code open source:

Citation

If you find this project helpful, please consider citing our paper:

@article{lai2024world,
  title={World Model-based Perception for Visual Legged Locomotion},
  author={Lai, Hang and Cao, Jiahang and Xu, Jiafeng and Wu, Hongtao and Lin, Yunfeng and Kong, Tao and Yu, Yong and Zhang, Weinan},
  journal={arXiv preprint arXiv:2409.16784},
  year={2024}
}

cd /home/xh/IsaacGym_Preview_4_Package/WMP export LD_LIBRARY_PATH="/home/xh/miniconda3/envs/wmp/lib:${LD_LIBRARY_PATH}" export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json export DISPLAY=:1 python legged_gym/scripts/play.py --task=go2_wmp_preserved60 --sim_device=cuda:0 --wm_device=cuda:0 --num_envs=1 --load_run=wmp_protected_visible_hold_v1 --checkpoint=10000 --terrain=gap --terrain_level=6 --command_vx=1 --rough_ground

wmp

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages