Teaching two robot arms to fold laundry, with simulation, imitation learning and RL before real hardware.
As a robotics software engineer on WAT.ai's 10-person ML team, I wrote the whole WorldFold codebase.
The goal
Fold laundry with two SO-101 arms using a small task-specific policy instead of a large general model. The plan is to use a vision-language-action model (MolmoAct2) as a teacher, distill it through imitation learning, then refine the policy with DAgger and reinforcement learning. Cloth is hard because it has no fixed shape: every grasp changes the state, and a small slip early ruins the fold later.
How a policy is made

Figure 1 — One pipeline, run on harder tasks each time.
- A scripted expert (inverse kinematics plus a phase machine that reads the true cloth state) produces demonstrations. 30% of episodes are knocked off course mid-fold, so the data also shows how to recover.
- A student learns from them by behaviour cloning, either a chunk-MLP or a diffusion policy that maps a short observation history to the next 16 actions.
- DAgger closes the gap: the student drives, and the expert labels the states the student actually reaches.
- A vision student that sees only cameras and joint sensors is distilled from the privileged policy, which is the version that can run on real arms.
- Every policy is scored on held-out seed sets (easy starts, hard starts, and recovery or an arm knocked mid-fold), with confidence intervals and paired comparisons.
Why PPO failed first
PPO from scratch could not learn to fold. Digging in exposed an unreachable goal, a stalling IK solver, identical reset states and a seeding bug that ran all eight parallel environments on one identical episode, which had invalidated earlier results. A damped-least-squares IK expert, behaviour-cloned, then took corner-fold success from 0% to 83%. Potential-based reward shaping across reach, grasp, carry and place now gives RL a signal that cannot be farmed by re-grasping.
A world model that helps policies learn
A residual MLP over the cloth's physical state predicts held-out fold episodes with a corner error of 10.6 mm at ten steps, against 35.5 mm for simply assuming nothing moves. An earlier latent RSSM lost to that baseline by an order of magnitude; dropping the latent bottleneck and predicting change rather than the whole state fixed it. Training an actor on imagined rollouts through the model raised a behaviour-cloned policy from 17.5% to 87.5% success in one round, and to 95% after a round on its own collected data.

Figure 2 — Prediction error by horizon, and policy success after training in imagination.
Half fold in MuJoCo
The scripted expert sets the ceiling at 100% / 97% / 96% on the easy, hard and recovery sets (n = 200 each). The best privileged policy, a DAgger-trained diffusion policy, reached 99.5% / 77% / 79.5%, lifting recovery from 38.5%. The camera-only student reached 94% / 91% / 41%: strong from shifted starts, still weak at recovering after a knock. Offline RL (IQL) was tried three times, never beat imitation and was dropped.
Quarter fold in Isaac Sim
The project then moved to LeHome's Isaac Sim 5.1 stack, where the grasp is friction-only: nothing welds the cloth to the jaw, so it can slip, drag or fling. The quarter fold chains two folds, and the second has to pick up a strip the first one laid down.
- Releasing gently mattered most. Changing how the jaws let go lifted the expert from 41% to 92% on hard starts and from 31% to 78% with an arm knocked, on the same 100 paired seeds.
- A gripper head on the diffusion policy added 16 points.
- A flatter first fold (friction plus a lay-down move) made every success a real second fold, at no measurable cost.
- Final held-out sets (n = 100 each): the expert scores 87% / 90% / 76% and the behaviour-cloned student 66% / 59% / 38%.

Figure 3 — Quarter-fold success on the final held-out sets.
Not everything worked. A first DAgger round on the quarter fold scored 26% / 28% against the student's 49% / 39%, so it was not kept, and its cause is still open.
Engineering for speed and honest numbers
- Faster loops: CUDA graphs made diffusion sampling 12.7× faster, and bf16 with batched GPU teacher labels cut distillation time by 29%.
- More data per hour: Isaac collection runs 8 vectorized environments, 2.15× faster on Windows through D3D12, into a content-hashed, resumable dataset store.
- Grasps that are physical: friction-only grasping on PhysX particle cloth in Isaac Sim 5.1, checked by a contact audit.
- Numbers that mean something: a paired-seed harness (Wilson intervals, McNemar tests, paired bootstrap) measured a simulation noise floor of about 7 points, so smaller gains are not claimed.
Where it stands
The privileged quarter-fold result is closed. Next are the camera-only student and a success detector for the quarter fold, then sim-to-real on the physical SO-101 arms; no hardware result is claimed yet.