A world model for my robot vacuum

PyTorch DINOv2 World models Robotics

I wanted to learn how world models work by building one on real hardware: my robot vacuum. A world model predicts what the robot will see next, given what it sees now and the action it takes. With that, the robot can try actions in its head before doing them.

Left: the path the robot drove during a two-minute recording, with three numbered points. Right: the robot's camera view at each of those points: a desk by a window, the same desk up close, and a white wardrobe.

One of the recorded drives: the path and three frames from the robot's camera.

The setup

The robot sends camera frames through the ECOVACS cloud to my laptop. On the laptop, a DINOv2 encoder, the world model and a planner choose the next action, which goes back through the cloud to the robot's wheels every half second. Robot vacuum camera · wheels ECOVACS cloud video (WebRTC) commands (MQTT) My laptop DINOv2 encoder World model Planner frames frames action move one loop every 0.5 s · the video arrives ~0.4 s late The robot sends camera frames through the ECOVACS cloud to my laptop. On the laptop, a DINOv2 encoder, the world model and a planner choose the next action, which goes back through the cloud to the robot's wheels every half second. Robot vacuum camerawheels ECOVACS cloud video (WebRTC) commands (MQTT) My laptop DINOv2 encoder World model Planner frames frames action move one loop every 0.5 s

How it works

Where it stands

Four charts on held-out recordings. A: the model's prediction error is below the copy-last-frame baseline at every horizon up to 4 seconds. B: the gain is largest for turns. C: a matrix showing the model picks out the true action 79 percent of the time. D: a sweep over the video delay that confirmed 0.42 seconds.

Model results on held-out recordings (the last 20% in time).

On the robot

For the live test, the robot takes a goal photo, gets turned away, and has to find that view again using only its camera and the model. This is the run that worked: turned 80° away, it turned back, went past the goal, came back and stopped 6° from it by itself.

Three camera views from the live run: the goal view of a living room, the view after the robot was turned 80 degrees away facing a window, and the view where the planner stopped, nearly the same as the goal. Below, a chart of the robot's heading relative to the goal over 6.5 seconds: it turns left past the goal to about 70 degrees, then turns right and settles near zero, with the chosen actions shown as coloured bars.

A live run on the robot. The heading comes from the robot's own position and is only used for this chart; the model never sees it.

So far it works in 1 of 10 tries. In most of the others the robot didn't move: the goal only looks close once it is within about 20°, and my recordings barely show the robot starting from standstill. Recording drives that start and stop is the next step.

Code on GitHub