Lab
Goalkeeper interception
The problem behind RoboKeeper, with the lid off. Take a shot: the camera sees the ball exactly twice, at the two gates, and each sighting is a little bit wrong. From that pair the keeper has to decide where the ball will cross the goal — and get a servo there before it does.
The filter the robot runs: six states, gravity in the motion model, marched forward to the goal plane. It predicts an arc, so it aims where the ball is falling to. Both predictions are drawn either way — green is the filter, amber the straight line.
- EKF error at the goal
- —
- Straight-line error
- —
- Reaction time after the near gate
- —
- Saves
- 0 / 0
Why a straight line loses
Two points define a line, and a line is the obvious thing to draw through them. But a football is falling the whole way, so the path from the near gate to the goal is a curve, and the line runs off the top of it. Switch the keeper to straight line and take the same shot twice: the amber prediction lands above the green one, every time, and the gap is the drop the ball made in the last couple of metres.
That gap is not a constant. Wind the shot speed down and the ball spends longer in the air over the same distance, so it falls further and the line misses by more. A hard, flat shot is the one case where ignoring gravity nearly works — which is exactly the case where the servo has the least time to move.
Why the gates matter twice
The far gate and near gate sliders change two things at once, in opposite directions. Sliding them together shortens the baseline the velocity is measured over, and because each sighting carries the same error, halving the gap roughly doubles the error in the estimated speed — the prediction gets worse. Sliding the near gate toward the goal makes the reaction time readout shrink, and below roughly a tenth of a second the servo simply cannot swing far enough, however right the maths was. The verdict line says which of the two failed.
What the filter is actually doing
The Extended Kalman Filter carries six numbers — position and velocity in three axes — and a measure of how much it trusts each one. It advances that state with a model of how a ball moves, gravity included, then folds in each measurement according to whether the model or the camera is more believable at that moment. Turn the noise slider up and watch the green error grow: with two sightings the filter has nothing to average over, so noise goes almost straight through to the prediction.
That is the honest limit of the two-gate design. A filter earns its keep when it has a stream of measurements to smooth; here it earns its keep by knowing that balls fall. The real system chose two gates because detecting reliably is easier than tracking continuously — and the filter is what makes two points enough.
This is a simple simulation of what happens, not a digital twin of the robot: the ball flies on plain ballistics, and the camera is a pair of planes rather than a detector.