Drift

Product

Stacking Three Cubes With a Franka Panda in MuJoCo

Cube stacking is a benchmark robot manipulation task. Drift generates an autonomous sequence that makes a Franka Panda stack three cubes into a tower in MuJoCo.

Drift TeamJul 29, 2026 · 6 min read
A Franka Panda robot arm placing the third cube onto a tower of stacked cubes in a MuJoCo simulation.

Picking up one cube is a good start. Getting an arm to stack three into a tower that doesn't fall over is a much better test of what it can really do.

Cube stacking is one of the oldest and most useful tests in robotic manipulation. It looks simple, yet it packs in perception, precise grasping, and, above all, placement accuracy that compounds with every block. This walkthrough runs that test on a Franka Panda arm in MuJoCo, using Drift to generate the entire stacking sequence from one prompt instead of hand-coding it.

Why cube stacking is a genuine test of precision?

 

A single pick-and-place is forgiving. If the arm sets a cube down a few millimeters off target, it still lands flat on the table and the task counts as done. Nothing depends on it.

 

Stacking removes that safety net. Each cube becomes the foundation for the next, so errors don't just occur, they accumulate. Place the first cube slightly crooked and the second sits crooked on top of it. Add a third and a small early error can topple the whole tower. To succeed, every placement has to be accurate enough that the next cube has a stable, level surface to rest on. That is why stacking is a standard benchmark for grasping precision and repeatability, and why it's a clear step up from the single automated pick-and-place we built earlier in this series.

What we asked Drift to build?

 

Starting from the existing Franka Panda scene, we gave Drift one instruction: create a new script that makes the arm autonomously stack three cubes into a tower.

 

Notice how little we had to specify. There's no list of grasp points, lift heights, or drop coordinates. The prompt describes the goal, a tower of three cubes, and leaves the sequence of operations to Drift. That task-level prompting is the whole point of working this way: you say what you want, not how to move each joint. Starting fresh? Here's how to build the pick-and-place scene with this arm, running in MuJoCo.

How Drift turns one prompt into a stacking sequence?

 

From that single prompt, Drift generates a new script and plans each pick-and-place operation the tower requires. It works out the order to move the cubes, where to grip each one, and where to release it so the stack grows cleanly rather than drifting off-center.

 

Under the hood, this is three dependent pick-and-place routines chained together, the kind of thing that's tedious and error-prone to hand-tune, since a fix to one placement can throw off the next. Drift produces it as a ready-to-run script, which is the same task-level generation behind automating a single pick-and-place, now extended to a multi-step sequence.

Watching the Franka Panda build the tower

 

We run the new script and watch the arm work. It picks up each cube, carefully aligns it over the growing stack, and sets it down, one block at a time, until the tower stands complete.

 

The alignment step is the part worth slowing down to watch. Before each release, the arm lines the cube up over the one beneath it, and that small correction is what keeps the tower stable as it climbs. What looks like the same motion repeated three times is really three precise, dependent placements, each one setting up the next.

Where sequential manipulation shows up in the real world?

 

Stacking three cubes is a small task with a big idea inside it: sequential manipulation, where a robot performs a series of steps and the success of each one depends on the accuracy of those before it.

 

That pattern is everywhere in practical robotics. Assembling a product, packing a box, palletizing goods, and laying bricks on a construction site are all versions of the same challenge, perform precise operations in the right order, where each step builds on the last. A robot that can reliably stack cubes is demonstrating the core skill those jobs require. It's also a natural next step after giving an arm vision through a camera, since real stacking eventually needs the robot to see where the blocks actually are.

Push the tower higher and see where it breaks

 

With Drift generating the sequence, you get a working stacking demo in one prompt, which frees you to experiment with the hard parts. Add a fourth and fifth cube and see where the tower starts to wobble. Tighten the spacing, change the cube sizes, or offset the target so the arm has to adapt. Each variation is a quick way to probe how much precision the sequence really has.

 

Watch the full build in the video above, and if you're setting up from scratch, start with installing MuJoCo and building the pick-and-place scene.

FAQ

  1. What is cube stacking in robotics? Cube stacking is a benchmark manipulation task where a robot arm grasps several blocks and places them into a stable tower. It's widely used to test grasping precision and repeatability, because each placement has to be accurate enough to support the next block.
  2. Why is stacking harder than a single pick-and-place? A single pick-and-place tolerates small errors, since the object only needs to land on a surface. Stacking chains placements together, so an error in one cube carries into the next and can topple the tower. Every step has to be precise enough to hold the one above it.
  3. What is sequential manipulation? Sequential manipulation is performing a series of manipulation steps in a specific order, where the success of each step depends on the previous ones. Stacking, assembly, and packing are common examples, and they demand both precision and reliable repetition.
  4. Why is the Franka Panda used for stacking experiments? The Franka Emika Panda is a seven-joint collaborative arm widely used in research, with readily available simulation models. Its precision and popularity make it a common choice for pick-and-place and stacking tasks.
  5. How does Drift build the stacking sequence? Drift takes a single natural-language prompt describing the goal, then generates a script that plans and executes each pick-and-place operation needed to build the tower, so the Franka Panda stacks the cubes autonomously without any hand-coded sequence.

Related reading

Enjoyed this one? Send it to someone who’d find it useful.