Log 14: A long jump contest in simulation

· A build log for LocksleyFox, a home-built robot dog

While the real leg waits for its next test, I wanted to see what the full 2.0c robot could do if I asked it to jump as far as possible. So I set up an Olympic-style long jump in MuJoCo: run up, jump at a line, and measure where the paws end up. Over two days, training tried five different jumping styles. The winner reached 1.30 m, and the losers taught me just as much.

Close-up render of the white robot fox landing with its front paws stretched forward onto a glowing orange line, with a blue line just behind it, and the labels First touch 1.19 m and Final 1.30 m
The winning jump. Blue marks the first touch at 1.19 m, and orange marks where the paws stopped after sliding, 1.30 m past the line

The rules

  • Every attempt starts from a standstill 4 m before the line.
  • The nearer front paw is measured. A blue mark shows the first touch, and an orange mark shows where the paws stop after sliding. The orange one counts.
  • Stepping past the line before taking off is a foul.
  • Only the feet may touch the floor during the jump. A knee, thigh or shank on the floor voids the attempt.
  • One landing only, and the front feet have to land first.
  • No flips.

Each style got 400 attempts, and its best legal jump is the one shown. Small random differences in each attempt, like sensor noise, make every run a little different.

How the jumps were trained

My first plan was reinforcement learning, the same method that taught the robot to walk. Nine trial runs all failed to produce a jump. The robot forgot how to run, stalled, or slammed its joints as soon as training began.

So I split the job in two. The walking controller I already had does the run-up. At a chosen moment in its stride, a scripted jump takes over: crouch, push, flight and landing, each a pose for the front and rear legs, with left and right mirrored. That's 23 numbers in all, covering the pose angles, how long each phase lasts, and when the jump starts.

An evolutionary search called CMA-ES tunes those numbers. Each generation tries 64 sets of numbers, every set from 32 slightly different starts, so 2,048 simulated jumps. The best ones steer the next generation. On the Predator's GPU, a generation takes about 12 seconds, and a full run of 100 to 150 generations takes about half an hour. In the video, each generation is called a training cycle.

Render of the robot fox tumbling sideways near a white start line, legs in the air, during an early training attempt
An early attempt, before the search had found anything that works

One run shows how quickly it improves. At cycle 0, none of 24 test jumps was legal. By cycle 5, a few were, at about 0.13 m. Cycle 60 reached 0.63 m, and cycle 145 reached 0.98 m, with 23 of 24 jumps legal.

Every rule found a loophole

Most of the rules above weren't in my first version. The search kept finding ways to score that a real long jump wouldn't allow, and each one became a new rule:

  • It hopped a little, dropped onto its thighs and shanks, and bounced off them. That's where the feet-only rule came from.
  • It flipped onto its front paws and hopped along upside down, landing more than once. Hence one landing only.
  • It did a full somersault and landed on its hip motors. Hence no flips.
  • It reached far with its front paws while the rear paws dragged in first. Hence front feet first.

An early version that measured the final mark differently let one run reach 1.86 m by bouncing. None of those results count.

Render of the robot fox standing upside down on its front legs near a white line, rear legs pointing up
The handstand pogo, one of the loopholes that needed a new rule

Five styles

Left alone, the search always skipped the crouch. I suggested crouching first to load the legs, so some runs were forced to use a front crouch, a deep crouch or a pounce, while others stayed free. Here's how each did over 400 attempts:

StyleHow it jumpsBestAverageLegal
SupermanKeeps its speed and stretches out1.30 m1.09 m92%
Front crouchDips its front, then springs1.14 m1.00 m95%
Deep crouchCrouches low, then leaps1.05 m0.90 m92%
Feet bounceA hop off the paws, no crouch0.62 m0.51 mover 99%
PounceSlows at the line, then leaps high0.58 m0.43 m92%

A sixth style, crouching with all four legs, reached 1.02 m. It looked too much like the front crouch, so it stayed out of the video.

Render of five robot foxes side by side in lanes after landing, each with a label: Feet bounce 0.62 m, Pounce 0.58 m, Deep crouch 1.05 m, Front crouch 1.14 m, Superman 1.30 m
All five best jumps, run side by side from the same start

Why Superman won

Superman never crouches. It reaches the line at about 2.2 m/s, keeps that speed into the jump, and stretches its front legs far forward. The crouching styles store energy in their legs, but they lose speed doing it, and speed at the line turned out to matter more. I was surprised, since the crouch seemed like the obvious answer. For a while, the crouch was ahead, until more training and fairer tests changed the order.

Render of the robot fox in flight, body level and front legs reaching forward, past a white line on the floor
Superman in the air, front legs reaching forward

I also tried letting the legs move in mid-air to reach for the line. Starting from the same point, the average stayed at 1.09 m with or without the extra pose. That makes sense, since moving the legs in the air can't add speed, only shift where the paws end up.

Superman isn't the most reliable, though. Its worst legal jump was only 0.47 m, while the front crouch never landed short of 0.83 m.

Five stacked histograms of jump distance, one per style, with Superman's spread widest and furthest right and an orange line marking each style's best
Where every legal jump landed, out of 400 per style. Orange lines mark each best

Would it break?

Breakage didn't count in the contest, but I checked it afterwards. The loads from the best jumps went through the same stress check as the walking test, with the printed parts modeled as printed. On Superman's 1.30 m landing, the hip bends more than twice as hard as in walking, 55 against 23 N·m, and the foot force is 461 against 197 N. The weakest part checked was the shank, with a safety factor of 1.8. The thigh came out at 2.6 and the front body at 3.8.

That isn't a full answer. The lid, rear body, head and tail weren't checked, and neither was fatigue from jumping again and again. The lid was the weak point in the walking check, so it's the first thing to test if the real robot is going to jump.

Limits

  • All of this is simulation, with no air drag, a flat floor and one robot design.
  • The jump controller knows its exact distance to the line. The real robot would need a camera or range sensor for that.
  • The simulation gives the tail no contact shape, so in some outtakes it dipped into the floor. The videos bend the tail clear in those frames. The physics is unchanged.

Making the videos

The jumps were recorded at 1,000 steps per second and rendered in Blender. That's about 4,000 frames across the two videos, split between the Predator, a Mac Mini and my MacBook, which took most of a day.