Experiments · simulation · VEX AIM
Code vs drivers, before the robot moves
Is our code better than us at driving? Now we can ask before the code ever touches the robot: run it hundreds of times in simulation, let simulated drivers play the same game, and compare.
Watch
Simulated. Top: the best sample routine and the best simulated driver. Bottom: the simplest routine and a rookie. Same table, same barrels, 45 seconds.
The game: sort the barrels
One VEX AIM robot, three orange and three blue barrels, a 6 × 4 ft table with an orange zone at one end and a blue zone at the other. Each barrel that ends up in the zone of its colour scores a point. Six points is perfect; there are 45 seconds.
The simulated AIM robot keeps to the real one’s limits: 200 mm/s at full speed, turns up to 150° a second, one barrel at a time on its magnet.
Verdict for the best routine: Better than the typical student driver by +1.3 points (95% range +1.1 to +1.6). Against the best simulated driver, Speedy Sloane, it's too close to call.
How it works
- 1
Add the game once
The field, the barrels, the zones and what scores, written down in one file. For a team's own game, we work it out from their code and a short description.
- 2
Run the code, unchanged
The team's VEXcode AIM Python runs against a simulated AIM robot: the same commands, the same speed limits, plus the wheel slip, camera noise and wobble that make every real run a little different.
- 3
Let simulated drivers play
Driver characters play the same game with a controller: each has a reaction time, steady or shaky steering, careful or rushed placing, good or bad choices, and the odd fumble.
- 4
Get a verdict
Every routine runs 20 times, every driver 12 times. Better, worse, or can't tell, with a range, so a lucky run can't decide it.
Four versions of the code, six drivers
Points out of 6 on layout dev-01. The verdict compares each routine with the typical student: the middle of a simulated class of 20 drivers, who averages 2.8 points.
| Routine | Idea | Average | Worst / best | vs typical student |
|---|---|---|---|---|
deadreckon_v1.py | A fixed plan with no sensors: drive to where each barrel should be, in the order they were measured. | 1.7 | 1 / 3 | Worse (-1.0, range -1.4 to -0.6) |
vision_v2.py | AI Vision finds the nearest barrel and steers onto it; wheel counting gets it back to the zone. | 2.5 | 1 / 3 | Can't tell (-0.3, range -0.7 to 0.1) |
vision_tags_v3.py | Like v2, then homes in on the AprilTag behind each zone for the last stretch. | 2.1 | 0 / 3 | Worse (-0.6, range -1.1 to -0.1) |
planner_v4.py | Plans a smart order, drives at full speed, lets the camera do the last few centimetres, and spreads its drops across the zone. | 4.0 | 4 / 4 | Better (+1.3, range 1.1 to 1.6) |
The simulated drivers
| Driver | What they’re like | Reaction | Speed used | Average | vs planner_v4.py |
|---|---|---|---|---|---|
| Speedy Sloane | Full speed everywhere. Fast when it works, messy when it doesn't. | 0.30 s | 100% | 4.1 | code is too close to call |
| Pro Priya | The team's best driver: quick reactions, clean lines, smart order. | 0.22 s | 95% | 3.8 | code is too close to call |
| Average Alex | A typical student driver after a few sessions. | 0.40 s | 70% | 2.8 | code is better |
| Nervous Noah | Knows what to do but stops to think a lot. | 0.45 s | 60% | 2.3 | code is better |
| Steady Sam | Slow and careful. Rarely makes a mistake. | 0.35 s | 55% | 2.1 | code is better |
| Rookie Riley | First week with the controller. Slow to react, overshoots, sometimes heads for the wrong barrel. | 0.55 s | 55% | 1.9 | code is better |
What the simulation caught
Smart order beats clever sensing
The tag-homing routine looks more advanced, but it spends its seconds turning to find the tag. Planning the order and driving at full speed did more.
Don’t drop on the same spot
Routines that put every barrel in the middle of the zone drove into the one already there, and the magnet picked it back up. Spreading the drops fixed it.
45 seconds is tight for AIM
At 200 mm/s nobody, code or driver, sorts all six. The best runs score 4 or 5. Either the time limit grows, or “how many in 45 seconds” is the measure.
What this can and can’t tell you
- It’s a simulation. It tells you which version of your code to try on the robot first, not how the robot will actually do. Real fields, batteries and barrels differ from any model.
- The drivers are made-up characters chosen to span a classroom, not measurements of real students. Filming a few real runs per driver would let us tune them.
- The AIM robot model uses the published speed limits; its size, acceleration, camera view and friction are our estimates.
- The sample routines are ours, written to show the range. Your team’s code runs exactly the same way.
Try it with your own code: motionbench game verdict games/aim-sort --code my_routine.py. How games are defined and how the simulator works: docs/games.md.