Two-sensor fusion: experiment bench
Two-sensor fusion
Combine a noisy camera that drops out with drifting wheel odometry, and see whether the fused estimate beats either sensor alone.
- 1. Ask
- 2. Hypothesise
- 3. Set up
- 4. Run
- 5. Record
- 6. Change one variable
- 7. Compare
- 8. Interpret
- 9. Limitations & save
If I change …, then … will …, because …
3 · Set up the parameters
Random error on each camera position.
Long-run share of time the camera sees nothing.
A constant error that makes dead reckoning drift.
Random error in each motion step.
Dropouts come in bursts of about this length.
The Kalman filter also estimates the odometry bias.
Trust in the prediction versus the camera.
The seed fixes any random noise. Same parameters + same seed = exactly the same result, every time, on every computer.
6 · Change one variable
Your first run is the baseline. After it, change one thing at a time.
7 · Compare on a graph
5 · Run log
No runs yet.
Equations
Complementary filter: x̂ ← α·(x̂ + Δ) + (1 − α)·z when the camera reading z exists, else x̂ ← x̂ + Δ.
Assumptions (always true in this model)
- 1-D motion along a smooth, known-shape path (truth is a sum of two sines).
- Gaussian, independent sensor noise from a seeded generator.
- Odometry bias is constant over the 20 s run.
Text description of what the chart shows
A line chart of position in centimetres against time over 20 seconds. The true position swings smoothly between about −40 and +40 cm. Odometry alone drifts steadily away from the truth; the fused estimate stays close to the truth, even through camera dropouts.
Did the result support your hypothesis? Use the numbers from the comparison table and link them to an equation.
Which assumptions could change your answer in the real world? For example: Real sensors have outliers, latency and correlated errors that this model leaves out.
Export and save
Exports use the ticked runs (or every run if none are ticked). Your draft saves automatically in this browser only. The Journal is private to you.
Valid parameter ranges
| Parameter | Range | Default |
|---|---|---|
| Camera noise σ | 0 to 10 cm | 3 |
| Camera dropout fraction | 0 to 0.9 | 0.25 |
| Odometry bias | -5 to 5 cm/s | 1.5 |
| Odometry noise σ | 0 to 10 cm/s | 4 |
| Mean dropout length | 0.2 to 5 s | 1.2 |
| Filter (0 complementary, 1 Kalman) | 0 to 1 | 1 |
| Complementary weight α | 0 to 1 | 0.9 |
Independent reference checks
Noise-free odometry with a 2 cm/s bias
Drift e_k = b·kΔt, so RMS = b·Δt·√(Σk²/n) with n = 401, Σk² = 400·401·801/6: 2 × 0.05 × √(21 413 400/401) = 23.108 cm (closed form).
Camera never drops out
With p = 0 the entry probability is 0, so every sample has a reading.
Checked automatically on every change to the code. Educational model, not engineering-grade.
Where this model stops being right
- Real sensors have outliers, latency and correlated errors that this model leaves out.