Give every sensor the same 95% uptime. Three speed sensors that vote stay correct 99.3% of the time. Two cameras that must both work give depth only 90.25% of the time.
Switch sensors off on the robot. Watch which of its three estimates survive. Then we build, piece by piece, the three ways sensors relate, where you combine them, and the arithmetic that says when a new sensor helps.
You need what a probability is and a little Python. We build the rest from zero.
Lesson 1 of 22 in Sensor Fusion: Classical to Modern. The three relationships follow Durrant-Whyte (1988); the levels follow Dasarathy (1997). Next: Fusion Architectures.
Illustrative toy. Position is complementary (GPS and IMU), speed is competitive (three sensors, two-of-three vote), depth is cooperative (two cameras for stereo). The uptimes assume each part works 95% of the time and fails on its own: 0.95 squared is 0.9025, and two-of-three gives 0.99275.
Chapter 0
See one sensor go blind in a tunnel and another drift away, and see the pair survive together
A self-driving car enters a tunnel. For forty seconds no satellite is in view. Its GPS (a receiver that gives absolute position from satellites, to a few metres) has no fix. The car does not get lost. A second sensor keeps counting.
That sensor is the IMU (inertial measurement unit): a chip of accelerometers and gyroscopes that feels motion hundreds of times a second. It never sees satellites, so a tunnel does not stop it. But it measures change, not place. To get position it adds up every small motion since the last sure fix. This is dead reckoning. It adds in every small error too.
Say the accelerometer reads a little too high, all the time. Call this constant error the bias, a, in metres per second squared. Call the time since the last GPS fix t, in seconds. The IMU turns acceleration into speed, then speed into position, so it adds the bias up twice. Call the resulting position error e.
e equals one half, times a, times t squared.
Take the seconds t since the last fix and square them. Multiply by the bias a. Halve the result. That is the error e.
With a = 0.01 m/s²: after 10 s, e = 0.5 × 0.01 × 100 = 0.5 m. After 60 s, e = 0.5 × 0.01 × 3,600 = 18 m. After 5 minutes it is 450 m. Ten times the wait gives a hundred times the error.
GPS has the opposite shape. Its error does not grow, but it gives one fix a second and dies under a blocked sky. Press Run.
The grey band is the tunnel. Each height line is ten times the one below it. Pick a sensor, set the tunnel length, and press Run.
Illustrative toy: the car moves at 20 m/s, the IMU bias is 0.01 m/s², GPS is good to about 2 m in the open. Inside the tunnel the GPS output holds its last fix, so its error grows as the car moves on.
GPS alone freezes in the tunnel. The IMU alone drifts all drive. The fused estimate rides the IMU through the tunnel, and GPS pulls it back at the exit. Trust the IMU over seconds and GPS over minutes.
Combining many imperfect sensors into one estimate that is better than any of them is sensor fusion. It works because different sensors fail in different places.
| Sensor | Good at | Goes blind or lies |
|---|---|---|
| GPS | absolute position, error does not grow | tunnels, indoors, city streets; slow, about 1 Hz |
| IMU | fast motion, works anywhere | drifts as t squared; no absolute reference |
| Camera | texture, colour, meaning | dark, glare, fog, blank walls |
| LiDAR | exact 3D shape, day or night | heavy rain and dust, glass, mirrors |
| Wheel encoder | distance rolled, cheap, fast | wheel slip on ice reads motion that did not happen |
| Radar | speed, works in rain and fog | coarse detail, ghost echoes off metal |
Pick sensors whose failure rows do not overlap. But "add more sensors" is not one rule. Two sensors can relate in three ways, and those ways obey opposite rules.
Chapter 1
Blend an absolute anchor with a fast dead reckoner using one trust dial
You cross a foggy field. You count your steps to know how far you walked. Every minute the fog lifts for a moment and you see a landmark. You walk by counting and correct yourself at each landmark. The landmark stops the counting error from growing. The counting carries you between landmarks.
That is complementary fusion: two sensors measure the same quantity in different regimes, so each covers the other's blind spot. In 1988 Hugh Durrant-Whyte split multisensor fusion into three relationships. Complementary is the first, and GPS with an IMU is its standard example.
| Property | GPS | IMU |
|---|---|---|
| Rate | about 1 per second | 100 to 1,000 per second |
| Measures | where you are | how you moved |
| Error over time | stays the same size | grows without bound |
| Dies | under a blocked sky | never, but drifts |
Call the position GPS reports xG and the position the IMU reports xI, both in metres. Pick a number w from 0 to 1: how much you trust GPS. Call the fused position x̂.
x-hat equals w times x-G, plus one minus w, times x-I.
Multiply the GPS position x-G by w. Multiply the IMU position x-I by what is left, 1 minus w. Add the two. The sum x-hat always lies between the two readings.
With made-up numbers: GPS comes back at x-G = 100 m. The drifted IMU says x-I = 104 m, and w = 0.8. x-hat = 0.8 × 100 + 0.2 × 104 = 80 + 20.8 = 100.8 m. The answer sits near GPS and moves a little toward the IMU.
Blue is GPS, warm is the IMU, teal is the fused estimate. Drag w, then switch the GPS fix off as if you drove into a tunnel.
Illustrative numbers, the same as the worked example.
With no fix, w must be 0 and the fuser uses the IMU alone. When GPS returns, w rises and GPS pulls the drift out. One dial does the whole handover.
The failure: both sensors blind at once. A long tunnel lets the IMU drift with nothing to reset it. Symptom: the error climbs during each GPS gap. Measure: plot the error against the time since the last fix; a t-squared curve is IMU drift. Fix: add a third source that works in the gap, such as wheel odometry or a camera.
Chapter 2
Set the trust dial from each sensor's spread, and get an answer sharper than either sensor
Chapter 1 picked w = 0.8 by hand. A fuser computes it. The rule: trust each sensor in proportion to how tight its errors are.
Measure a sensor's spread by its variance: the average squared error, written σ² (sigma squared), in square metres. One over the variance is the precision: its vote strength. Call the GPS variance σG² and the IMU variance σI².
w equals one over sigma-G squared, divided by the sum of one over sigma-G squared and one over sigma-I squared.
Turn each variance into a vote: one over sigma squared. Add the votes. The GPS share of the total is w.
With made-up numbers: σG² = 4 m² and the drifted IMU has σI² = 16 m². The votes are 1/4 = 0.25 and 1/16 = 0.0625. w = 0.25 / 0.3125 = 0.8. The guess from Chapter 1 now has a reason.
In a tunnel the GPS fix is stale, so its variance goes toward infinity. Its vote 1/σG² goes to 0, and w slides to 0 by itself. The variance does the switching, with no special case in the code.
Call the variance of the fused estimate σF². If the two sensors' errors are independent, their precisions add.
One over sigma-F squared equals one over sigma-G squared, plus one over sigma-I squared.
Add the two precisions. Flip the sum over. That is the fused variance sigma-F squared, and it is smaller than either input variance.
0.25 + 0.0625 = 0.3125, so σF² = 1 / 0.3125 = 3.2 m². That beats GPS at 4 m² and the IMU at 16 m².
Each bell is one sensor's belief. A narrow bell is a precise sensor. Change the variances, then switch on the tunnel.
Illustrative numbers. The bells assume Gaussian errors that are independent of each other.
The failure: a variance set wrong by hand. Tell the fuser GPS has variance 0.01 m² and w pins near 1, so the IMU never counts. Symptom: the fused output copies one sensor. Measure: log w over a drive; it should move when conditions change. Fix: estimate each variance from data. The Kalman filter does this every step, and its gain plays the role of w.
Chapter 3
Measure the same thing three times, take the middle value, and catch the sensor that lies
An airliner measures airspeed with three independent probes called pitot tubes. Two read 251 and 249 knots. Ice blocks the third, and it reads 80. A blend from Chapter 1 would mix the lie in. You need a rule that throws it out.
That is competitive fusion, also called redundant fusion: several sensors measure the same quantity, in the same conditions, at the same time. The overlap lets you cross-check them. You cannot catch a liar with one witness.
The average is (251 + 249 + 80) / 3 = 193.3 knots. No probe reported that. The one bad probe pulled it 56 knots below the truth. The median is the middle value after sorting: [80, 249, 251] gives 249 knots. One wild value cannot move the middle.
Three pink bars read the same true airspeed (dashed). Drag the fault on sensor 3. Watch the grey average and the teal median.
Illustrative toy: true airspeed 250 knots, healthy sensors jitter by about 1.5 knots, a sensor is flagged when it sits more than 10 knots from the median.
Voting does two jobs. Fault tolerance gives a good answer despite a bad sensor. Fault isolation names the bad sensor, so you can flag it. Compare each sensor with the vote: sensor 3 is 169 knots away, past a 10-knot threshold, so the voter flags it.
| Scheme | Rule | Survives | Names the bad sensor? |
|---|---|---|---|
| Median of 3 | take the middle value | 1 wild sensor | no |
| 1oo3 (one of three) | use any working sensor | 2 dead sensors | no |
| 2oo3 (two of three) | two must agree | 1 failure | yes, the odd one out |
Once the voter isolates sensor 3, two are left. If those two disagree, you cannot tell which is right. That is why safety systems start with three or more.
The failure: identical copies. In 2009 ice crystals blocked the pitot tubes of Air France 447, and its airspeed readings became inconsistent. Three probes of one design met one cause. Symptom: several sensors fail at the same moment. Measure: list what they share (model, power, mounting, weather). Fix: dissimilar redundancy: different designs, suppliers or software.
Chapter 4
Get depth from two cameras, and lose all of it when one goes dark
Hold up a finger. Close one eye, then the other. The finger jumps against the background. Bring it closer and it jumps more. Your brain reads distance from that jump.
One camera sees a flat image. A small object near and a large object far can make the same image. Two cameras a known distance apart see the object from two angles. The pixel shift between the two images is the disparity, and it encodes depth. This is cooperative fusion: the quantity exists only when two or more sensors work together.
Call the distance between the two cameras the baseline, B, in metres. Call the lens's focal length f, measured in pixels. Call the disparity d, in pixels, and the depth of the object Z, in metres. Two similar triangles give d / f = B / Z. Solve for Z.
Z equals f times B, divided by d.
Multiply the focal length f by the baseline B. Divide by the pixel shift d. A big shift means a near object.
With f = 700 px and B = 0.12 m, f × B = 84. An object that shifts d = 42 px is at Z = 84 / 42 = 2.0 m. At d = 84 px it is at 1.0 m. Double the shift, half the depth.
Purple dots show where the object lands in each image. Move the object, widen the baseline, then switch a camera off.
Focal length 700 px, images 640 px wide. The top view is not to scale. The depth error assumes the disparity is off by one pixel.
Read the weak spots off the formula. A far object has a small d, so one pixel of error moves Z a lot. At 2 m it moves about 5 cm; at 20 m, about 5 m. A wider baseline helps far away, but a near object then shifts out of the second image. And on a blank wall the cameras find nothing to match, so d does not exist.
The failure: one camera fails. Symptom: the depth map goes blank, not noisy. Measure: the existence test: remove one sensor and ask if the quantity still exists. Fix: if depth must survive, add a source that gives depth on its own, such as LiDAR.
Chapter 5
Merge sensors at the raw signal, at the features, or at the decisions, and pay in data or in detail
A camera and a radar both look for pedestrians. Each runs a pipeline: raw signal, then features, then a decision. You can join the two pipelines at any of those three points. Belur Dasarathy's 1997 survey sorted fusion by this choice. It is a second axis, separate from the three relationships.
The camera lane is purple, the radar lane is grey. Pick a level and see what crosses into the teal fuser, and how much data that is.
Sizes are illustrative orders of magnitude for one frame. A 1920 × 1080 colour image is 6.2 million bytes.
| Level | Data sent | Detail kept | Swap one sensor alone? |
|---|---|---|---|
| Raw | most | most | no, tightly coupled |
| Feature | medium | medium | partly |
| Decision | least | least | yes |
Any relationship works at any level. Airspeed voting is competitive at the decision level. Stereo depth is cooperative at the raw level, because it needs pixels. A GPS and IMU filter is complementary at the feature level: positions and speeds, not satellite signals.
The failure: two objects merged into one. At the decision level the fuser sees two "pedestrian" verdicts at the same bearing. It cannot tell if they are one person or two. Symptom: tracks merge or split near crowds. Measure: compare counts against labelled frames. Fix: move the merge earlier, to features that carry position.
Chapter 6
Multiply two probabilities and watch the same sensors go in opposite directions
"More sensors make a system more robust." This is true for competitive fusion and false for cooperative fusion. Two multiplications prove it.
Call the chance that one sensor works at a given moment its reliability, R. Say R = 0.95. Call the number of sensors n. Assume each sensor fails on its own, so one failure does not make another more likely. Then the chance that several things all happen is the product of their chances.
Stereo depth needs both cameras. A system that needs all of its sensors is a series system, like old fairy lights where one dead bulb kills the string.
R-series equals R to the n.
Every sensor must work. Multiply the chance R once for each of the n sensors. A number below 1, multiplied by itself, shrinks.
Two cameras: 0.95 × 0.95 = 0.9025. Three required sensors: 0.857. Five: 0.774. The stereo pair works less often than one camera alone.
Redundant speed sensors need only one survivor. A system that fails only when all its sensors fail is a parallel system, like three torches in one room. Call the chance a sensor fails 1 − R.
R-parallel equals one minus, one minus R, to the n.
Find the chance that every sensor fails: multiply the failure chance 1 minus R once per sensor. The system works in every other case, so subtract that from 1.
Two sensors: 1 − 0.05 × 0.05 = 0.9975. Three: 1 − 0.000125 = 0.999875. One failure in 20 becomes one in 8,000.
Purple is series (all required). Pink is parallel (any one works). The dashed line is one sensor. Drag n up.
Assumes independent failures. Hours per year are (1 − reliability) × 8,760.
Same parts, opposite results. In hours: one 95% sensor is down about 438 hours a year. Two in series are down 854 hours, nearly twice as long. Two in parallel are down 22 hours.
The failure: a team requires three sensors to agree "for safety". That is a series design, so R falls from 0.95 to 0.857. Symptom: outages rise after the team adds sensors. Measure: write each output as "needs ALL of" or "needs ANY of". Fix: rewire the robust outputs as "any one survives", or vote.
Chapter 7
Work out two-of-three voting term by term, then see one shared cause cap every redundant design
"Any one works" (1oo3) gives 0.999875, but it cannot say which sensor lied. Aircraft use two-of-three voting (2oo3): two healthy sensors must agree, so the system can vote and also name the odd one out. How reliable is that?
A 2oo3 system works when at least two of its three sensors work. There are two separate ways:
R-two-out-of-three equals R cubed, plus three times R squared times one minus R.
Find the chance all three work, R cubed. Find the chance of one "two work, one fails" case and multiply it by 3. The two cases cannot both happen, so add them.
With R = 0.95: R³ = 0.857375. One case is 0.9025 × 0.05 = 0.045125, and three cases give 0.135375. The sum is 0.99275. Below 1oo3, far above one sensor, and it can name the faulty one.
There is a catch. If R is below 0.5, two bad sensors outvote the good one, and voting does worse than one sensor. Redundancy helps only sensors that beat a coin flip.
Every formula so far assumed the failures are independent. Now add a common-mode failure: one event, such as icing, a shared power rail or one firmware bug, that kills all the sensors at once. Call its chance c. No amount of voting can beat it, so the system reliability can never pass 1 − c.
Each bar is hours down per year. Each grid line is ten times the one before. Raise the shared cause and watch the redundant bars hit a floor.
Illustrative toy. The shared cause hits every design, so each is multiplied by 1 − c. A year is 8,760 hours.
With c = 1% and R = 0.95, 1oo3 falls from 0.999875 to about 0.99. The downtime goes from about 1 hour a year to about 89. Counting sensors is easy. Making their failures independent is the expensive part.
The failure: a redundant system that fails in clusters. Symptom: several sensors drop together, far more often than the formula says. Measure: an independence audit: list every resource the sensors share and ask if one event could take out two. Fix: dissimilar redundancy and separate power, clocks and mounts.
Chapter 8
Answer three questions about a quantity and read off the relationship it needs
A design lands on your desk: these sensors, that quantity. Which relationship? Ask three questions in order, once for each quantity you estimate.
Pick a product, or set the answers yourself. The lit path shows the decision.
The products are common examples of each pattern, not the design of any one maker.
A small drone must land on a 1 m pad. It has GPS, an IMU, a downward camera and a barometer.
Set the voting threshold by which mistake costs more. A robot vacuum stops if any stair sensor fires, because a needless stop costs seconds and a missed stair costs the robot. A car on a motorway brakes only when a majority agree, because braking for a ghost can cause a crash behind it.
The failure: a cooperative chain on a safety-critical quantity. Symptom: the safest feature has the worst uptime. Measure: multiply the R values of every sensor the quantity needs, before you build. Fix: if the product is below spec, change the wiring, not the sensor brand.
Chapter 9
Switch off one sensor at a time and find the fuser that only looked redundant
Two speed fusers read the same three sensors. With all sensors healthy, both are within 0.2 knots of the truth. Which one is redundant? You cannot tell from healthy data. You have to break things.
An ablation test disables one sensor at a time and records the fused error. A healthy fuser degrades a little each time. A fuser with a silent single-source dependence collapses when its one favourite sensor goes. Fuser B below gives sensor 2 a weight of 0.99, the hand-set variance trap from Chapter 2.
A dead sensor here sticks at 180 knots. Pick a fuser, then kill each sensor and read its bar.
Illustrative toy: truth 250 knots; healthy readings 250.1, 249.8 and 250.3. Fuser B weighs the sensors 0.005, 0.99 and 0.005.
Work fuser B with sensor 2 dead: 0.005 × 250.1 + 0.99 × 180 + 0.005 × 250.3 = 180.7 knots. The error is 69.3 knots. Fuser A takes the median of 250.1, 180 and 250.3, which is 250.1. Its error is 0.1 knots.
| Trap | Symptom | Test |
|---|---|---|
| Series where you wanted parallel | adding sensors raises outages | does the output need ALL sensors or ANY one? |
| Silent single source | fused failures match one sensor's failures | ablation: kill each sensor alone |
| Wrong label | "redundant" cameras all go blind together | existence: does the output exist without this sensor? |
| Shared cause | failures arrive in clusters | independence audit of power, firmware, mounts |
The wrong label is common. A team adds a second camera "for redundancy", but its software computes stereo depth. They wrote complementary; the maths is cooperative. The existence test finds it in one question: with only the left camera, does the output exist? For stereo depth, no.
Chapter 10
Keep the numbers, the terms, the checks and the core code of the lesson on one page
Every sensor has a place where it fails, so we fuse sensors that fail in different places. Two sensors relate in one of three ways. Complementary sensors cover each other and blend by precision. Competitive sensors measure the same thing and vote, which raises reliability. Cooperative sensors make a quantity together, which lowers reliability. Where you combine (raw, feature, decision) is a separate choice.
| What | Number | Why it matters |
|---|---|---|
| IMU drift, bias 0.01 m/s² | 0.5 m at 10 s; 18 m at 60 s; 450 m at 5 min | error grows as t squared |
| Precision weighting | variances 4 and 16 give w = 0.8, fused 3.2 m² | fused beats both sensors |
| Average vs median | 251, 249, 80: 193.3 vs 249 kt | one liar ruins the average |
| Stereo, f 700 px, B 0.12 m | d 42 px gives 2.0 m; 1 px error is about 5 cm | far depth is weak |
| Series, R = 0.95 | 0.9025 (n 2); 0.857 (n 3); 0.774 (n 5) | required sensors cut uptime |
| Parallel, R = 0.95 | 0.9975 (n 2); 0.999875 (n 3) | spare sensors raise uptime |
| 2oo3, R = 0.95 | 0.99275 | reliable and names the fault |
| Downtime per year | 438 h single; 854 h two in series; 64 h 2oo3; 1.1 h 1oo3 | the wiring decides the hours |
| Shared cause 1% | 1oo3 capped near 0.99 | independence is the real limit |
| Term | Meaning |
|---|---|
| Complementary | Same quantity, different regimes; each covers the other's gap. |
| Competitive | Same quantity, same conditions; cross-check and vote. |
| Cooperative | The quantity exists only from several sensors together. |
| Precision | One over the variance; a sensor's vote strength. |
| Disparity | The pixel shift of one point between two camera images. |
| Series / parallel | Needs every sensor / needs any one sensor. |
| 2oo3 | At least two of three sensors must agree. |
| Common-mode failure | One cause that fails several sensors at once. |
| Ablation test | Disable each sensor alone and record the fused error. |
| Existence test | Remove one sensor and ask if the output still exists. |
pythonimport statistics def fuse(x_gps, var_gps, x_imu, var_imu): # complementary, by precision p_gps, p_imu = 1 / var_gps, 1 / var_imu w = p_gps / (p_gps + p_imu) return w * x_gps + (1 - w) * x_imu, 1 / (p_gps + p_imu) def vote(readings, threshold=10): # competitive: median plus fault flags v = statistics.median(readings) return v, [i for i, r in enumerate(readings) if abs(r - v) > threshold] def stereo_depth(x_left, x_right, f=700, baseline=0.12): # cooperative: needs both d = x_left - x_right return f * baseline / d if d > 0 else None def series(R, n): return R ** n # all required: falls def parallel(R, n): return 1 - (1 - R) ** n # any survives: rises def two_of_three(R): return R**3 + 3 * R**2 * (1 - R) fuse(100, 4, 104, 16) # (100.8, 3.2) vote([251, 249, 80]) # (249, [2]) stereo_depth(320, 278) # 2.0 m series(0.95, 2), parallel(0.95, 2), two_of_three(0.95) # 0.9025, 0.9975, 0.99275
Now press Present or Teach and explain from memory: the three relationships, the two reliability formulas, and the two tests. Then go back to the robot, switch off one camera and one speed sensor, and say why only depth died.