Sensors aren't perfect
Hold a thermometer still in a still room. Why might it read 20.1, 19.8, 20.3, 19.9?
About 25 min · 3 goals · Checked by automated tests; not yet reviewed by an educator
1.Why should I care?
Beginners trust every reading; engineers know better. Real sensors jitter, drift and occasionally glitch. Good intelligent systems are designed to cope: they average, double-check and leave safety margins. That habit separates machines that work in a demo from machines that work every day.
- ◇ Explain that every sensor reading includes some noise.
- ◇ Use averaging to get a steadier estimate.
- ◇ Work out how far a robot travels between sensor checks.
2.Predict
A distance sensor reads 31, 29, 30, 52, 30 cm while the robot stands still. What's the best guess for the real distance?
Guess first. Being wrong here is how the surprise works.
3.Discover
Watch how individual noisy readings scatter around the true value. Compare trusting one reading with the lab's combined estimate. Which stays closer to the truth?
Explorer 03 — Sensor fusion
Two imperfect sensors, one better estimate
A camera gives absolute position but loses sight of the target; odometry never drops out but drifts. Combining them gives an estimate better than either alone.
- True position
- Camera reading
- Odometry dead-reckoning
- Fused (Kalman)
- ±2σ uncertainty
- Camera dropout
Camera · absolute, drops out
Long-run share of time with no view, in bursts of about 1.2 s (occlusions).
Odometry · relative, drifts
A constant error in measured speed: its position estimate drifts by bias × time.
The Kalman filter weights each sensor by its stated noise, tracks its own uncertainty, and estimates the odometry bias while the camera can see.
Show
Root-mean-square error vs truth · lower is better
- Camera aloneholds last reading in dropouts7.9 cm
- Odometry alonedead reckoning from start15.1 cm
- Kalman filterfused estimate0.9 cm
- Fused, in dropoutsonly samples with no camera1.1 cm
Camera coverage 60 %. Camera error only over frames it saw: 2.9 cm (≈ its σ).
State
Seed 7. The camera saw the target 60 % of the time in 4 dropouts. Error (RMSE): camera alone 7.9 cm holding its last reading, odometry alone 15.1 cm, kalman filter 0.9 cm (1.1 cm during dropouts). Fusion is 88 % better than the better single sensor. Estimated odometry bias 1.53 cm/s (true 1.50).
Seed 7. The camera saw the target 60 % of the time in 4 dropouts. Error (RMSE): camera alone 7.9 cm holding its last reading, odometry alone 15.1 cm, kalman filter 0.9 cm (1.1 cm during dropouts). Fusion is 88 % better than the better single sensor. Estimated odometry bias 1.53 cm/s (true 1.50).
How to read this
Time runs left to right over 20 seconds. The thin solid line is where the object really is. Crosses are camera readings; hatched columns are dropouts where the camera sees nothing. The dashed line is odometry integrated from the start: smooth, but it wanders away as its bias accumulates. The thick line is the fused estimate, with a shaded ±2σ band showing how uncertain the Kalman filter believes it is. The band widens during each dropout and snaps back when the camera returns.
This mirrors Tactiverge's research question: when vision drops out, can local sensing such as force and joint feedback carry the estimate until it returns?
Assumptions & limitations
- One dimension, a smooth known trajectory and a single object: real tracking is 3-D, with orientation, multiple objects and data association.
- Noise is white Gaussian with the σ you set, and the Kalman filter is told the true σ values. Real filters must be tuned against noise they can only estimate.
- Odometry error is a constant bias plus white noise; real drift also comes from slip, scale-factor error and temperature.
- Dropouts are random bursts, independent of where the object is. Real occlusions often happen exactly when the task gets hard, for example when a gripper covers the object.
- The camera has no latency and runs at the same 20 Hz as odometry; real cameras are slower and delayed, which the filter would have to compensate for.
- Figures are from one seeded run of 401 samples; change the seed to see how much the numbers vary by chance.
Can't use the interactive? Read a description instead
The fusion lab can be replaced by this description: a robot's true position moves steadily along a line. Each sensor reading lands a little above or below the truth at random. A single reading can be quite far off; combining many readings, or two different sensors, gives an estimate that stays much closer to the true line.
4.Understand
Noise
Noise is the small, random wobble in every reading. It comes from electrical jitter, vibration, air currents and more. It can't be removed completely, only reduced.
Averaging calms noise
If the wobble is random, some readings are a bit high and some a bit low. Averaging several cancels much of it out. The cost: you have to wait for more readings, so the machine reacts a little more slowly.
Glitches and margins
Sometimes a reading is wildly wrong: a glitch. Throw out readings that disagree hugely with the rest. And never set a safety threshold right at the danger point: leave a margin for noise.
How often to look
A robot only knows about the world at the moments it checks. Between checks it is driving blind. Distance between checks = speed × time between checks. Faster robots need to check more often.
Explain it another way
Guessing how many sweets are in a jar: one person's guess can be way off, but the average of the whole class's guesses is usually surprisingly close.
A reading = true value + noise. Averaging N readings with independent random noise reduces the typical error, though with diminishing returns. Outliers are removed first because one large error can drag the mean.
Readings 20.1, 19.8, 20.3, 19.9 have mean (20.1 + 19.8 + 20.3 + 19.9) ÷ 4 = 80.1 ÷ 4 ≈ 20.0 °C. Between checks: a robot at 40 cm/s checking 10 times a second travels 40 × 0.1 = 4 cm blind.
Planetary rovers count wheel turns to estimate distance, but wheels slip in sand, so the estimate drifts. They correct it now and then by photographing landmarks. Combining sensors like this is called sensor fusion.
Worked example 1
Readings: 48, 51, 50, 49, 12 cm. Estimate the distance.
12 is far from the others: likely a glitch, so drop it. Average the rest: (48 + 51 + 50 + 49) ÷ 4 = 198 ÷ 4 = 49.5 cm. Averaging all five would give 42 cm, badly dragged by the glitch.
Common mix-ups
- A good sensor gives exactly the same reading every time.
✓ Every real sensor has some noise. Good ones just have less. - Averaging always gives the right answer.
✓ A big glitch can drag the average. Remove readings that are wildly off first.
5.Practice
Practice, not a test. Wrong answers get a hint and another try.
Practice 1
A thermometer reads 18, 19, 17 and 18 °C. What is the average, in °C?
Practice 2 · a fresh version every time
A robot drives at 10 cm/s and checks its distance sensor 10 times a second. How far does it travel between one check and the next, in cm?
Practice 3
A robot must never get closer than 10 cm to a wall. Its sensor can be off by up to 2 cm. Which stop rule is safest?
Practice 4
Averaging 20 readings instead of 2 makes the estimate steadier. What's the cost?
6.Apply it
A rover's distance sensor gives readings every 0.5 s and the rover drives at 10 cm/s. How far does it drive blind between readings? Suggest a stop rule with a margin that keeps it at least 20 cm from rocks.
7.Reflect
Concepts: How sensors measure · Noise and filtering