Robotics · Simulation
Simulated quadruped that learns to walk with PPO
A Unitree Go1 quadruped, simulated in MuJoCo, learns to walk by reinforcement learning (PPO) from a shaped reward, with no reference motion. Nothing ran on a real robot.
After three reward versions the policy walked at 1.90 m/s, stayed up at 2x the modeled sensor noise and recovered from 39 of 40 pushes of 100 N.
The problem
I wanted a simulated Unitree Go1 to walk from reward alone, with no reference motion, and to survive shoves and noisy sensors.
PPO optimizes the reward as written, so the policy is free to exploit whatever the reward leaves out. My first reward paid for forward speed and staying upright. After 500k steps the policy shuffled in short, dragging steps and veered off course, at 0.44 m/s.
What I built
The environment wraps the Go1 model from MuJoCo Menagerie. The policy reads 45 proprioceptive values: projected gravity, body velocities, joint state and previous action. It outputs 12 joint-angle offsets around the standing pose at 50 Hz.
The reward is a weighted sum of 11 named terms, so each iteration is a small diff. I judged each change on a half-hour run of 2M steps.
Version 2 pays for a foot swing only when it lasts longer than 0.2 s. It also penalizes yaw rate, sideways velocity, height error and leg abduction. Its best checkpoint reached 1.36 m/s with no falls.
Measuring robustness exposed two faults: version 2 fell in 9 of 20 episodes under modeled sensor noise and recovered from 3 of 10 rightward 50 N pushes.
Version 3 trains with that noise and with random 20 to 80 N pushes every 3 to 6 s. It also penalizes unequal left and right foot contact, averaged over about a second because a per-step mirror penalty would forbid a trot.
Both full runs got worse after their best point, so I picked the shipped checkpoint by head-to-head evaluation.
Results
In simulation, the selected policy walked at 1.90 m/s with no falls in 20 clean episodes of 20 s.
Each push is a horizontal force on the trunk for 0.2 s, mid-walk. At 100 N that shifts the 12.7 kg robot's velocity by about 1.6 m/s. A recovery means the robot is upright 5 s later.
Over four directions and 10 trials each, it recovered 40 of 40 at 25, 50 and 75 N. At 100 N it recovered 39 of 40, and at 150 N only 13.
At 1x and 2x the modeled sensor noise it had no falls in 20 episodes each. Version 2 fell in all 20 at 2x and recovered 25 of 40 pushes at 100 N.
The final run took about 3.5 hours for 11M steps on 8 CPU cores. Its 10M checkpoint beat the last one, 1.90 against 1.49 m/s.
Limits and next steps
This policy has never run on a real Go1. Training randomizes only sensor noise and pushes: friction, mass and motor dynamics stay fixed, and the ground is flat. The 1x noise level is my estimate.
The observation includes trunk linear velocity, which a real robot would have to estimate. It has no heading, so the policy drifts: 2.0 m sideways over 22.9 m in the clip above.
Versions 2 and 3 have one full training run each, and each push direction and force has only 10 trials.
Ask a question about this project
An AI assistant answers from this site's text. It can be wrong; this page is the source.

