Follow on Instagram
HardSim-to-realUnitree G1L6 robot quiz

Perfect in simulation. Falls in two seconds on real hardware. Same policy. Why?

A learned walking policy reads its sensors and commands twelve joints fifty times a second. In simulation each command lands instantly. On the real robot it arrives 100 milliseconds late.

policy runs at 50 Hz · 12 joints · commands arrive 100 ms late on hardware
What do you change in training so the same policy survives real hardware?
Pick one first. Each option tells you why it is right or wrong.

Worked solutionOne step at a time

Count the delay in control steps

The policy acts every 20 ms. A 100 ms delay means each command takes effect five steps after the observation it was based on.

100 ms × 50 Hz = 5 steps late

Why late corrections make it fall

Balance is feedback: lean left, push right. If the push arrives after the body has already swung back, it adds to the swing instead of cancelling it. For a wobble of 2.5 cycles a second, 100 ms is a quarter of a cycle.

phase lag = 360° × 2.5 Hz × 0.1 s = 90°

Why the trained policy cannot cope

In training, cause and effect were one step apart. Nothing in the policy's experience says a command might land five steps later, so it keeps correcting a posture the robot has already left. The wobble feeds itself and grows.

Put the delay into training

Hold each action in a buffer and release it after a random delay, say 0 to 120 ms, drawn fresh for each episode. It also helps to give the policy its own last few actions as input, so it can tell what is still on its way to the motors.

Answer: C, randomise the delay

This is domain randomisation applied to time. The policy stops relying on an instant response and becomes robust across the whole range, which includes the real robot.

What the simulation showedOne number changed between the two runs

The reel runs the same Unitree G1 walking policy twice in MuJoCo.

  • With commands applied instantly it walks.
  • With every command held back by 100 ms, and nothing else changed, it goes down in about two seconds.
  • No motor got weaker and no sensor got noisier. Timing alone is enough to break a policy that was trained without it.

Wrong answersWhy each one is tempting

PickWhat went wrong
A · bigger networkTreats a missing-data problem as a capacity problem.
B · higher gainsThe instinct from tuning a loop with no delay. With delay, gain eats your stability margin.
D · more rewardChanges what the policy wants, not what it has experienced.

Follow-ups an interviewer asks nextTry these before opening them

Why randomise the delay instead of setting it to exactly 100 ms?

The real delay is not one number. It jitters with bus load, differs between robots and changes with firmware. A policy trained on one exact value can be as brittle as one trained on zero.

What else gets randomised for sim-to-real transfer?

Ground friction, link masses, motor strength, sensor noise, the terrain, and random pushes. Each one covers a way the simulator is wrong about the real robot.

What can you fix on the robot instead of in training?

Cut the delay itself: a faster bus, running the policy on the robot's own computer, and tighter motor driver loops. You can also predict the state forward by the known delay before feeding it to the policy.

How does a policy actually cope with delay?

With its recent actions as input, or a recurrent memory, it can estimate where the body will be when the command lands and act for that moment instead of for now.

Previous · 7How far the capture point jumpsNext · 9One joint at 1,000 degrees a second
Related questions
#4 · Locomotion · Unitree G1Why can't this humanoid just walk faster? Physics sets a hard limit.Medium #7 · Locomotion · Unitree G1A walking robot gets shoved. Where must its next foot land?Medium