I Trained a Robot Duck and a Humanoid to Walk on My Laptop (Simulation)
Watch a robot fall. And again. Then, after some training, the same robot walks.
I didn't write the walking by hand, and I didn't give it a reference motion. I wrote a score. And I did all of it on one laptop GPU: an RTX 5060 with 8 GB of memory.
In this post I'll explain how a score teaches a robot to walk, what's actually inside that score, and why the same recipe worked on a tiny duck robot and a 29-joint Unitree G1 humanoid.
Honesty note: everything here is simulation (MuJoCo). There's no physical duck or G1. Treat it as how the training works, not proof it would work on real hardware.
Prefer video? Watch the full experiment here:
Why I trained Microduck on my laptop
Microduck is a small open-source duck robot from Pollen Robotics (Hugging Face). Nvidia and Hugging Face showed it learning to walk in simulation before moving to real hardware (TechRepublic). I wanted to see what that kind of training takes on my own laptop.
So I trained Microduck and a Unitree G1 humanoid in the MuJoCo physics simulator, using the mjlab framework, with my own RL setup. The training code for the duck starts from Pollen's microduck_rl project.
How reinforcement learning teaches a robot to walk
Reinforcement learning is a loop:
State. The robot looks at its joint angles, which way is up, and how fast it's moving.
Action. It chooses how to move each joint.
Reward. The simulator advances one step and hands back one number. Higher number: do more of that. Lower number: do less.
At the start the actions are almost random, so the robot falls in about a second. But I'm not training one robot. The duck trained 4,096 copies at once and the G1 8,192, each one practising, falling and resetting.
After about 340–450 iterations, the robots stayed up for full episodes. Then came hours of refinement: about 13.5 hours for the duck and 18 hours for the G1, all on the same laptop.
What's inside the reward: the robot's score
Here's the duck's score. There's no reference motion and no recorded gait. Just this list:
Reward term | What it pushes the robot to do |
Pose | Stay close to a home posture |
Air time (weight 3.0) | Get the feet off the ground in a rhythm |
Foot clearance + swing height | Lift the feet and swing them to a good height |
Action rate (smoothness penalty) | Keep the motion calm, not jittery |
Joint limits (−1.0) | Stay inside each joint's safe range |
Velocity tracking | Follow the speed I ask for |
The robot doesn't want to walk. It wants a high score. Walking is just the best way it has found to get one. Change the score, and you change what it learns.
Breaking the score on purpose
To prove that, in the video I break the duck's score three times and show what it learns instead:
No smoothness penalty. Normally I ramp it up from −0.1 to −1.0 over the first 1,500 iterations, because it keeps the motion calm. Jittery motion in simulation can wear out real servos.
No air-time reward. The term that tells the duck to lift its feet. Watch what gait it finds instead.
No pushes in training. One policy trained with random pushes and friction, one without. Then I shove both the same way at the same moment.
I won't spoil the results here. They're the best part of the video.
Same recipe, different robot: Unitree G1
Does this work on a robot that's nothing like a duck? The G1 has 29 joints. I trained it with 8,192 robots in parallel, for around 18 hours on the same laptop.
I kept the training loop and the same kind of reward. What changed:
The robot model and the number of joints
Joint limits, gains and action scale
The reward weights
Stronger pushes, including rotation
Air time switched off: foot clearance and swing height do that job instead
I didn't transfer the policy. I transferred the recipe. A policy trained for a duck can't drive a G1, but the way you train it can.
What simulation can't tell you
Simulation isn't the real world. Real motors lag, real floors differ, and real sensors are noisy. That's why randomising friction and adding pushes during training matters: a policy that has never been pushed won't know what to do when it is.
If you want the maths underneath (rotations and coordinate frames), start with my Rigid-Body Motions and RL from scratch posts.
Can you train a humanoid robot on a laptop?
In simulation, yes. I trained a 29-joint Unitree G1 to walk in MuJoCo on an RTX 5060 laptop GPU with 8 GB of memory, using 8,192 parallel copies. It took around 18 hours.
How long does it take a robot to learn to walk with RL?
In my runs, episodes reached full length after about 340–450 iterations. Polished walking took about 13.5 hours for the duck and 18 hours for the G1.
Do you need a reference motion to teach walking?
No. Neither robot used a reference gait or recorded motion. The walking came only from the reward terms.
What is mjlab?
A framework for robot reinforcement learning on top of the MuJoCo physics simulator. I used it for both robots.
What should I teach it next, still in simulation: bigger pushes, stairs, or dancing? Vote in the YouTube comments.



Comments