Shanghai AI Lab Trains a Full-Sized Humanoid to Dive and Save Goals
A single end-to-end RL policy trained with region-specific human motion priors lets a Unitree G1 dive, jump, and squat to block flying balls autonomously.
ProTakeaways
- Shanghai AI Lab and HKU release Humanoid Goalkeeper, a single end-to-end RL policy for a Unitree G1.
- Splits the goal into six regions, each with its own task reward and adversarial motion discriminator.
- Human motion priors extracted from RGB videos with GVHMR and retargeted, no mocap suit required.
- Achieves 80.9% success in simulation, 21/30 real-world saves with MoCap, 14/30 with onboard depth camera.
- Generalizes to jump escape, squat escape, and grabbing a moving ball with a soft bag.
- Code, checkpoints, and training scripts available on GitHub.
Robots playing soccer is not new, but until now the goalkeeper role has been reserved for quadrupeds or kid-sized bipeds performing scripted saves. A team from Shanghai AI Laboratory and the University of Hong Kong has pushed a full-sized humanoid into the goal box and made it dive, jump, and squat like an actual keeper using a single reinforcement learning policy. Their Humanoid Goalkeeper paper introduces a training scheme that ties task rewards and human motion imitation to the ball's predicted landing region, and the code is on GitHub.

Why humanoids make goalkeeping hard
Keeping goal is a different problem from dribbling or shooting. A humanoid faces two coupled challenges: generating natural, human-like whole-body motions, and covering a wider guarding range within an equivalent response time. The robot has to swing arms, shift the base, and sometimes leave the ground, all within the fraction of a second the ball is in flight.
Existing humanoid systems dodge this by leaning on separate teleoperation or fixed motion tracking for whole-body control, which either needs a human puppeteer or replays canned trajectories that cannot adapt to where the ball actually goes. Prior quadruped goalkeepers work well but cover a narrow arc and cannot produce human-shaped saves.
Carving the goal into regions
The team's insight is that a keeper's motion depends heavily on where the ball is headed. A ball to the upper-left needs a jumping reach with the left arm; a low-right ball needs a lateral dive. So they split the goal area into six landing regions and attach both a task reward and a separate motion discriminator to each region.
The result is a single end-to-end policy that jointly enforces task success and motion realism through observation-conditioned adversarial training, eliminating the need for separate optimization stages. No hierarchy, no motion library lookup at inference time, just one PPO-trained network reading ball position and proprioception.
How the policy is trained
Training happens in IsaacGym with PPO. The reward has two moving parts:
- Position-conditioned task reward: when the ball is far, the target is the predicted landing point; when the ball is close, the target becomes the actual ball position. A sigmoid distance reward pulls the appropriate hand (left for left-side balls, right for right) toward that target.
- Position-conditioned AMP reward: each region has its own discriminator that tries to tell apart policy joint transitions from human reference transitions. Only the discriminator for the active region contributes reward on a given trial.
The motion library itself is built cheaply. The team uses the GVHMR pipeline to extract humanoid motions from self-recorded RGB videos, then retargets them to the Unitree G1 robot and stores joint-position sequences per region. No motion capture suit, no professional keeper needed.
They also make the AMP reward softer than the original formulation. Rather than scoring the exact executed transition, they sample small Gaussian perturbations around it and take the best discriminator score. That way the task objective controls precise placement while the motion prior keeps the style human-like.

Closing the sim-to-real gap
The robot is a Unitree G1 with 29 joints. Perception runs in one of two modes: a motion-capture rig with markers, or an onboard Intel RealSense D435i depth camera fitted with an infrared filter that picks up a high-reflectivity ball. Both feed the policy a single 3D ball position in the torso frame.
To survive real hardware, training adds position noise up to 5 cm (half the ball radius) and random dropouts where O_ball gets zeroed out after 0.4 seconds of flight to simulate occlusion and field-of-view loss. A learned ball estimator inside the policy uses observation history to predict trajectory and classify the landing region.
One neat training trick: rather than resetting the robot to a nominal pose between episodes, they reset a subset of environments to joint configurations sampled from other ongoing environments. This forces the policy to start new saves from mid-motion poses, which turns out to matter for continuous match-like play.
How well it works
Evaluation uses a 5-a-side goal, 3.0 m wide and 2.0 m tall, with ball flight times from 0.5 to 1.0 seconds and distances from 3 to 5 meters. The default guarding range is ±1.5 m in width and 1.8 m in height, which the authors describe as one of the widest reported for robot goalkeeping.
| Configuration | Success rate |
|---|---|
| Full method (simulation) | 80.92% |
| Without motion constraints | 31.69% |
| Without task constraints | 9.44% |
| Without region division | 64.83% |
| Hardware, MoCap perception | 21/30 |
| Hardware, onboard camera | 14/30 |
Failures with the onboard camera cluster in the lower goal regions, because the ball drops out of the camera's field of view as it gets close, leaving under 0.3 seconds of usable tracking. Upper-region saves stay reliable because the ball stays visible longer.
Beyond blocking shots
The same region-conditioned scheme generalizes to two other dynamic tasks. Feed the ball's height into the region selector and the robot learns to jump over low balls or squat under high ones as escape maneuvers. Feed the ball's left-right position and it learns to catch a moving ball into a soft bag with the appropriate hand.
Numbers on the extended tasks:
- Jump escape: 3/5 successful
- Squat escape: 5/5
- Tennis ball grab into bag: 1/5, mostly because the bag's floppy mouth was not modeled in simulation
What is actually new here
Whole-body control with AMP has been done for locomotion, and region-based skill selection has been done for quadruped keepers. The contribution is stitching those together into one policy that outputs hardware-deployable, wide-range humanoid saves without a separate high-level planner picking skills. The adversarial motion prior is region-gated by an observation the policy also sees, so the same network handles both the strategy decision and the low-level torque control.
The authors are candid about the limits: the guarding range still trades off with response time, the robot will react to any ball in its field of view whether or not it is aimed at the goal, and there is no high-level planner for repositioning between shots. Grabbing with a rigid hand instead of a soft bag is flagged as the next interesting challenge.
Trying it yourself
The official implementation is public. The InternRobotics repo ships with training code built on rsl_rl and legged_gym, plus reference checkpoints in legged_gym/resources/weight/ that can be dropped into an experiment log directory to evaluate without retraining. A separate escape branch covers the jump and squat tasks. Videos and additional details live on the project website.