The Sensor Suite and Its Failure Modes

Smoke blinds the camera and the LiDAR together, because both work with light. Radar and wheel odometry keep the fused position within about 9 cm. Take them away and the error along the aisle grows to 40 cm.

Pick a hazard and watch which sensors survive it. Then switch to the optical sensors only. Then we build, one sensor at a time, what each one lies about, why the physics forces it, and the number that gives it away.

You need speed times time, the idea of a variance and a little Python. We build the rest from zero.

Lesson 4 of the Robotics Engineering track. Before: Lesson 3, Uncertainty. Next: Lesson 5, Calibration. Lesson 3 asked how big an error may be. This lesson asks where each error comes from.

Break one sensor, watch the suite

Illustrative suite. Each sensor gives a 1σ position error per update (camera 6 cm, LiDAR 8 cm along the aisle and 2 cm across, wheels with gyro 10 and 15 cm, radar 30 cm and 1.2 m); a weak sensor's error grows 3 to 5 times, a dead one drops out. The errors are assumed independent and are fused by adding information. The ellipse is drawn 5 times larger.

Chapter 0

The Invisible Pallet: Every Sensor Has an Assumption

Name the condition each sensor needs, and sort failures by the trace they leave

A warehouse robot stops 1.8 m short of a pallet of water bottles wrapped in clear film. The planner sees an empty aisle. The LiDAR scan skips the pallet's directions, as if the aisle ran on for 12 more metres. The camera shows the pallet in focus: blue caps, printed labels, glossy film.

Both sensors work and both are calibrated. The LiDAR needs light scattered back into its small receiver; clear film lets most of the pulse through and mirrors the rest away (Chapter 4). The camera collects room light from every direction.

Every sensor rests on an unstated assumption: a physical condition its measurement needs. A camera assumes enough photons and a still scene during the exposure. A LiDAR assumes the surface scatters light back. An IMU assumes its bias stays put. Wheels assume they do not slip. A failure is that assumption breaking, so physics predicts it.

Failures come in five kinds, and each leaves a different trace. Two terms from Lesson 3 name the traces. The innovation is a reading minus what the filter predicted. The NIS (normalised innovation squared) is the innovation squared over its predicted variance; it averages 1 when the model is honest.

KindWhat the data doesWhat reveals it
Dropoutreadings vanishmessage rate; returns per direction
Biasevery reading shifted the same wayinnovation mean over a long window, against an independent reference
Noise inflationright mean, wider spreadNIS well above 1
Late stampright value, wrong timeerror that grows with speed (Lesson 2)
Confident-wronga clean reading of something not thereonly a second sensor with different physics

Break the stream five ways

The pink line is where the robot truly is along the aisle. Blue dots are one sensor's readings; faint blue squares are a second sensor that works by different physics. Pick a failure and read the statistic that names it.

Illustrative stream: 10 s at 10 Hz, sensor noise 5 cm, seeded. The filter's prediction is the truth plus 2 cm noise; for the phantom, the filter has fused this sensor from the start, so its prediction follows the phantom.

The first four kinds show up in the sensor's own statistics or in the filter's innovations. Confident-wrong does not. A mirror return has normal intensity, normal range and a smooth history. With the device's numbers, tripled noise lifts the average NIS from about 1 to about 8. The phantom keeps it near 1, because the filter has trusted that sensor from the start. Only the second sensor disagrees, by 0.8 m: the argument for fusion (Chapter 9).

Symptom: the costmap shows free space where the camera plainly sees a pallet.

Measure: count LiDAR returns per direction. A run of empty directions between strong neighbours marks a clear or mirror-like surface.

Fix: a ray with no return marks its cells unknown, not free. Cross-check free space against the camera. Put clear film, a mirror and a retroreflector on a material board in the acceptance test.

The road

  1. Exposure: photons, motion blur and low light.
  2. Shutter: the rolling shutter and the lens.
  3. Stereo: depth error grows with range squared.
  4. LiDAR: what comes back, and what does not.
  5. Sweep: a spinning scan is not a snapshot.
  6. IMU: three errors, three growth laws.
  7. Wheels and GNSS: bias that never averages out.
  8. Radar: exact range, blurry angle.
  9. Showcase: the suite bench, and why fusion works.
  10. Field guide: the failure table and the code.
Which kind of failure can no statistic of the sensor's own data reveal?

Chapter 1

Cameras: Photons, Exposure and Motion Blur

Trade blur against noise with one knob, the exposure time

A robot turns in a dim aisle and its visual odometry loses track. The camera did not break. It collected light for too long while the scene moved.

Each pixel counts the light that lands on it during the exposure time: the window when the pixel is open. Whatever moves during that window smears. Call the exposure time te, the robot's turn rate ω (omega) and the lens's focal length in pixels f. The smear in pixels is b:

Say it aloud

b equals f times omega times t-e.

b
b the motion blur: how many pixels one point smears across, from rotation alone.
f
f the focal length in pixels: how many pixels one radian of angle spans. 600 px here.
ω
omega the turn rate in radians per second. 60°/s is 1.047 rad/s.
te
t-e the exposure time in seconds.
In plain words

During the exposure t-e the camera turns by omega times t-e radians. Multiply that angle by f to turn it into pixels. That is the smear b.

With numbers

With illustrative numbers: f = 600 px, ω = 1.047 rad/s, te = 10 ms. b = 600 × 1.047 × 0.010 = 6.3 px. A corner detector wants under about 1 px, so the features smear away.

Driving blurs too, but only near things: f · v / Z pixels per second for a point at depth Z. At 1.5 m/s and 3 m that is 3 px in 10 ms.

So why not use a short exposure? Light arrives as photons. A pixel that collects S photo-electrons has shot noise of √S, plus a fixed read noise of about 3 electrons. Its signal-to-noise ratio is S divided by √(S + 9). Indoors, 10 ms might give 1,000 electrons and a ratio of 31. At dusk the same 10 ms gives 50 electrons and a ratio of 6.5.

Set the exposure, see blur against noise

The top strip is the true bar target. The lower strip is what one image row records. Lengthen the exposure in the dim aisle and the noise drops while the bars smear.

10 ms
60°/s

Illustrative sensor: f = 600 px, full well 10,000 electrons (brighter pixels clip), read noise 3 electrons, seeded noise. The light rates are made up to span sun, aisle and dusk.

Auto-exposure lengthens te to fix the noise, and the blur grows with it: 30 ms at 60°/s is 18.8 px. Sunlight fails the other way: a bright pixel fills its 10,000-electron well and clips. Full well over read noise, 3,333 (70 dB), is the dynamic range; an HDR camera merges short and long exposures to cover a wider one.

Symptom: visual odometry loses its features only when the robot turns in dim aisles.

Measure: log the exposure time with every frame and plot tracked features against f · ω · te. The count collapses past a pixel or two of blur.

Fix: cap the exposure (4 ms gives 2.5 px at 60°/s), add light or gain, or slow the turn. An event camera has no exposure at all.

f = 600 px, the robot turns at 1.047 rad/s and auto-exposure picks 20 ms. How large is the rotation blur?

Chapter 2

Rolling Shutter and the Lens: An Image Is Not One Instant

Read the lean of a pole as a time, and undo a lens by iteration

Most cheap camera sensors have a rolling shutter: they read the rows one after another, top to bottom. A global shutter captures every row at once. Lesson 2 gave each row its own timestamp. Here we measure what happens when nobody does.

Call the time to read the whole frame the readout time tr. While the rows are read, the robot turns at ω, and the lens maps angle to pixels with focal length f. The bottom row lands shifted from the top row by s pixels:

Say it aloud

s equals f times omega times t-r.

s
s the skew: how far the bottom row shifts sideways from the top row, in pixels.
f
f the focal length in pixels, 600 px here.
ω
omega the turn rate, in radians per second.
tr
t-r the readout time from the first row to the last, in seconds.
In plain words

Between the first row and the last, t-r seconds pass and the camera turns omega times t-r radians. Times f, that angle is the skew s in pixels.

With numbers

With illustrative numbers: f = 600 px, ω = 1.047 rad/s (60°/s), tr = 33.3 ms over 1,080 rows. s = 600 × 1.047 × 0.0333 = 20.9 px. A vertical pole leans by arctan(20.9 / 1,080) = 1.11°.

Turn, then drive, and watch the poles lean

Pink outlines are where the poles truly are. Blue is what the rows record. Turning leans both poles the same. Driving sideways leans only the near one.

60°/s
0.0 m/s

Illustrative camera: 1,920 by 1,080, f = 600 px. Near pole at 3 m, far pole at 30 m. Skew from turning is f ω tr; from driving, f v tr / Z. The lean is drawn 5 times larger.

Turning shears every pixel by the same amount, near or far. Driving shears near objects more: at 1.5 m/s, 10 px at 3 m and 1 px at 30 m. Under 1 px at 60°/s needs a readout below 1/(fω) = 1.6 ms. Few rolling sensors read a frame that fast, so a turning robot needs a global shutter or per-row times.

The lens bends too. A wide lens pulls each point toward the centre by a factor that depends on its radius r: about 1 − 0.28 r² + 0.07 r⁴ here (the Brown-Conrady model). The point (0.35, 0.20) lands 10.6 px from its pinhole place. The inverse has no closed form, so iterate: guess, divide by the factor there, repeat. The error goes 9.17, 0.78, 0.068, 0.006 px. The camera model is derived in VNAV Lecture 5 and AA 274A.

Symptom: the online camera-to-IMU yaw is steady at rest but shifts by about 1° during 60°/s turns, always toward the turn.

Measure: plot the apparent offset against |ω|. A rolling shutter gives a line through zero with slope tr/2 = 16.7 ms, so 60°/s × 0.0167 s = 1.0°. Bracket flex would follow acceleration or temperature instead.

Fix: give each feature its row's time, or buy a global shutter.

A skew from a rolling shutter is the same for near and far objects. What caused it?

Chapter 3

Stereo Depth: The Error Grows With the Square of Range

Size a baseline from a requirement, and see where depth dies

Two cameras side by side see a near object shifted more than a far one. The shift between the left and right images, in pixels, is the disparity. Call the depth Z, the distance between the cameras (the baseline) B and the focal length in pixels f. Similar triangles give disparity = f · B / Z, so depth = f · B / disparity.

The matcher finds the disparity to within about σd pixels (sigma-d). Depth changes by f B / d² per pixel of disparity; put d = f B / Z in and you get the depth error σZ:

Say it aloud

sigma-Z equals Z squared times sigma-d, over f times B.

σZ
sigma-Z the depth error (one standard deviation), in metres.
Z²
Z squared the depth times itself. Twice as far, four times the error.
σd
sigma-d the matcher's disparity error, in pixels. 0.2 px for a good sub-pixel matcher.
f
f the focal length in pixels, 700 px here.
B
B the baseline, the distance between the two cameras, in metres.
In plain words

Square the depth Z, multiply by the matcher's error sigma-d, and divide by f times B. A wider baseline or a longer lens shrinks the error; range grows it fast.

With numbers

With an illustrative rig: f = 700 px, B = 0.12 m, σd = 0.2 px, so f B = 84. At 1 m, σZ = 1 × 0.2 / 84 = 2.4 mm. At 10 m it is 100 × 0.2 / 84 = 23.8 cm, and the whole signal is only 8.4 px wide.

Pick a baseline from a requirement

Blue is stereo depth error; dashed blue is a LiDAR's flat 3 cm. Red is the blind zone. Widen the baseline until the curve passes under the yellow target.

0.12 m
0.20 px

Illustrative rig: f = 700 px, disparity search 0 to 128 px, so nothing nearer than f B / 128 is matched. Linear error model; past half a pixel of error the exact form differs by a few percent.

Invert it to size a rig: 10 cm at 10 m needs f B ≥ 100 × 0.2 / 0.10 = 200, so B ≥ 0.29 m. The cost is up close. A 128 px disparity search sees nothing nearer than f B / 128: 0.66 m at B = 0.12, 1.64 m at B = 0.30. Against a 3 cm LiDAR, the 0.12 m rig wins only inside 3.55 m.

Depth also dies in specific ways. A blank wall gives no clear cost minimum; repeating texture gives several. A highlight on metal matches confidently at the wrong depth. An infrared-pattern camera loses its pattern in sunlight: 0.26 W/m² from a 1 W projector at 2 m against about 28.5 W/m² of sun in its filter, 0.9% contrast.

Symptom: in front of a rack of identical totes at 2.0 m, the depth map shows a smooth, hole-free surface at 2.8 m. The robot plans through it.

Measure: the totes repeat every 12 px and the match landed one period off: 84 / (42 − 12) = 2.8 m. The uniqueness ratio, second-best cost over best, sits near 1.0 there and at 1.5 to 3 on real texture.

Fix: publish the uniqueness ratio as confidence and reject regions near 1. A LiDAR is not fooled.

A rig has 6.0 cm of depth error at 5 m. Nothing else changes. What is the error at 10 m?

Chapter 4

LiDAR Returns: What Comes Back, and What Does Not

Run the photon budget, and predict holes, phantoms and blooming from one equation

A LiDAR fires a short laser pulse and times the echo. Back to the pallet: how much light comes home?

Call the pulse's peak power Pt, the surface's diffuse reflectivity ρ (rho), the aperture area Ar, the optics' throughput η (eta) and the range R. A matte surface scatters over a half-sphere, so the received power Pr is:

Say it aloud

P-r equals P-t times rho times A-r times eta, over pi times R squared.

Pr
P-r the power that reaches the detector, in watts.
Pt
P-t the peak power of the outgoing pulse, 25 W here.
ρ
rho the diffuse reflectivity: 0.8 white card, 0.02 black paint.
Ar
A-r the aperture area, 4.91 × 10⁻⁴ m² for 25 mm.
η
eta the share that survives the optics, 0.8.
π
pi from the half-sphere of scattered light.
R²
R squared the range times itself, in square metres.
In plain words

Multiply the pulse power P-t by the share sent back, rho, the aperture A-r and the throughput eta. Divide by pi R squared, because the light spreads out.

With numbers

With illustrative numbers (25 W, 25 mm, η = 0.8) at R = 5 m: white card returns 100 µW, black car paint 2.5 µW, clear film's diffuse part (ρ ≈ 0.005) 0.63 µW.

Each surface of clear film reflects about 4%, so about 92% of the pulse goes straight through. The reflection is specular, like a mirror, and curved film steers it off the receiver. Only a diffuse sliver near ρ = 0.005 (our estimate) comes home, close to a detector floor of tens of nanowatts.

The floor is fixed, so the maximum range grows as √ρ. A unit rated 120 m at 10% reaches 120 × √(0.03 / 0.10) = 65.7 m on a 3% black object.

Weather takes its share out and back. Call the air's extinction coefficient α (alpha). The share that survives the round trip is T:

Say it aloud

T equals e to the minus two alpha R.

T
T the fraction of the echo that survives the air, out and back.
e
e the base of natural logarithms, 2.718.
α
alpha the extinction per kilometre: 3.912 over the visibility in km, so 20 for 196 m fog.
R
R the range in kilometres, crossed twice.
In plain words

Each kilometre of air keeps a fixed share of the light. Over the round trip, 2 R, that share is T.

With numbers

A target at 50 m: heavy rain (α ≈ 1 per km) keeps e−0.1 = 90%. Fog with 196 m visibility keeps e−2 = 13.5%. Droplets also echo back phantom points close ahead; last-echo mode keeps the far surface.

Run the photon budget

Blue is the returned power. Under the yellow floor the point is missing; over the dashed ceiling it saturates. Pick a surface and weather, then drag the range.

20 m

Illustrative receiver: 25 W, 25 mm aperture, η = 0.8, floor 20 nW, saturation above 1 mW.

Glass is a mirror. A beam bounces off it, hits boxes beside the robot and returns the same way. The LiDAR puts the echo along the outgoing beam at the total path length: glass at x = 3 m and boxes at (1, 2) give a phantom stack at (5, 2), 5.39 m away. A retroreflector such as vest tape acts like ρ ≈ 50: 39 mW at 2 m, 62 times white card. The receiver saturates, neighbouring beams report the tape (blooming), and strong pulses read short (range walk).

Symptom: a film-wrapped pallet is missing; a glass door adds boxes behind it.

Measure: empty directions between strong neighbours mean a clear surface; a phantom sits at the mirror image behind a glass plane.

Fix: no return means unknown, never free. Map glass planes and reject returns behind them.

A LiDAR is rated 120 m at 10% reflectivity. How far can you promise against a 3% black obstacle in clear air?

Chapter 5

A Sweep Is Not a Snapshot

Move every point to the pose of the sweep's last instant, and get the sign right

A spinning LiDAR at 10 Hz takes 100 ms per turn, but the driver hands you one message with one timestamp. At 1.5 m/s the robot moved 15 cm meanwhile; at 60°/s it turned 6°. Both dwarf the 2 cm range noise.

The fix is de-skew: move each point into the sensor's pose at one reference instant. Use the end of the sweep, because that is the pose you publish. Call a point's firing time ti, the sweep's end tend, the turn rate ω, the velocity v and the point as measured pi. Then:

Say it aloud

p-end equals R of omega delta-t times p-i, plus v delta-t, where delta-t is t-i minus t-end.

pend
p-end the point in the sensor frame at the end of the sweep: the de-skewed point.
R(ωΔt)
R of omega delta-t a rotation by the angle the robot turns between the firing and the end.
pi
p-i the point as measured: range times beam direction, in the sensor frame at its firing.
v
v the robot's velocity, here 1.5 m/s forward.
Δt
delta-t the firing time minus the end time. It is negative for every point but the last.
In plain words

For each point, find how long before the end it fired, delta-t. Rotate the point by the turn over that time and shift it by the distance driven. Every point now shares the end pose.

With numbers

With illustrative numbers: v = 1.5 m/s, ω = 60°/s, a 10 m return straight ahead at mid-sweep, Δt = −0.05 s. Rotate by −3°: (9.986, −0.523). Shift by vΔt = (−0.075, 0): (9.911, −0.523). The raw cloud had it 52.9 cm away. Using the average heading over the 3° adds 2 mm sideways; the Code Lab uses that exact form.

De-skew the room, then flip the sign

Pink is the true room. Blue is the raw sweep, assembled as if instant. Purple is the de-skewed cloud. Raise the turn rate, then press the classic bug.

1.5 m/s
60°/s

Illustrative room 12 m by 8 m, 10 Hz sweep, 360 beams, exact ray casting with a constant twist. The robot is drawn at its end-of-sweep pose.

The sign is where it goes wrong. With Δt = ti, the walls come out perfectly straight, in the frame of the sweep's start. The published pose says "end", so the map lags by one sweep: 1.5 m/s × 0.1 s = 15 cm. A straight wall does not prove a correct de-skew.

De-skew needs the motion during the sweep; the 200 Hz IMU spans it and is the usual source. De-skew before voxel downsampling, which would average points from different poses. A solid-state LiDAR with a non-repeating pattern breaks one more habit: direction no longer tells you when a beam fired, so keep each point's time.

Symptom: the map is crisp on straight runs and shows double walls 15 to 20 cm apart wherever the robot turned, worse for far walls.

Measure: fit a line to a flat wall in each scan and plot the residual against |ω|. Distortion gives a line through zero; a calibration error gives a flat offset. De-skew the log offline: if a slope remains, it is a time offset.

Fix: de-skew every scan with the IMU twist, straight after assembly.

After enabling de-skew, walls look perfect but the robot thinks it is 15 cm behind its true position at 1.5 m/s with a 10 Hz LiDAR. What is the bug?

Chapter 6

The IMU: Three Errors, Three Growth Laws

Follow a gyro bias through gravity into position, and read which error wins when

An IMU never minds the dark, fog or a blank wall, and runs at 200 Hz. It is also the one sensor whose position error grows without limit. Its accelerometers measure specific force: acceleration plus the push that holds it up against gravity. Sensor Fusion 13 builds the full model and VNAV Lecture 11 uses it in an estimator. Here we need the growth laws.

A gyro bias is a constant offset in the turn rate. It tilts the attitude estimate, so the software resolves gravity slightly sideways, and that sideways part grows with the tilt. Call gravity g, the gyro bias bg and the time on the IMU alone t. The position error is p:

Say it aloud

p equals g times b-g times t cubed, over six.

p
p the horizontal position error, in metres.
g
g gravity, 9.81 m/s². It is the large gain that makes tilt so costly.
bg
b-g the gyro bias in radians per second. 0.01°/s is 1.745 × 10⁻⁴ rad/s.
t³
t cubed the time without aiding, in seconds, times itself three times.
6
six from integrating a ramp twice: t, then t² over 2, then t³ over 6.
In plain words

The tilt grows as b-g times t. Gravity g times that tilt is a false sideways acceleration that grows with time. Integrate it twice and divide by six: that is the drift p.

With numbers

With bg = 0.01°/s (36°/h, a typical consumer part): after 1 s, p = 0.29 mm. After 10 s, 28.5 cm. After 60 s, 9.81 × 1.745 × 10⁻⁴ × 216,000 / 6 = 61.6 m.

Two more errors grow more slowly. An accelerometer bias of 2 milli-g (0.0196 m/s²) grows as ½ b t²: 0.98 m at 10 s and 35 m at 60 s. The two biases tie at 34 s; after that the cube wins. White noise, given by the velocity random walk (0.1 m/s per √hour here), grows as t1.5: 3.0 cm at 10 s, 0.45 m at 60 s. At one minute the bias contributes 138 times the noise. Inertial drift is a bias problem.

Grade the IMU, find the crossover

On log axes each error is a straight line of slope 1.5, 2 or 3. Change the grades and read how long the robot coasts inside the yellow 20 cm budget.

36°/h
2.0 mg
0.10 m/s/√h

Closed forms, checked against a strapdown simulation in numpy (the Code Lab). Grades are illustrative: consumer about 30°/h, industrial 3, tactical 0.3, navigation 0.01.

An Allan deviation plot grades a part: its flat bottom over 0.664 is the bias instability, its rising right side the rate random walk. Two failures sit outside it. Saturation: a ±250°/s gyro hit by a 0.2 s, 400°/s jolt loses 30° of heading. Vibration turns into a bias through the sensor's nonlinearity.

Symptom: an IMU shows 8°/h of bias instability on a granite block and about 40°/h on the running robot.

Measure: stop the motors. An instant recovery is vibration rectification (illustrative 0.5 mg/g² at 2 g rms is 2 mg); a slow decay is heat.

Fix: isolate the mount and filter before the converter, or model the temperature. Estimate the bias as a state.

The robot must coast 30 s on its IMU with under 20 cm of error. Which gyro bias do you need?

Chapter 7

Wheels and Satellites: Bias That Never Averages Out

Tell a systematic error from a random one by its growth, and catch a fix that lies

A 4,096-count encoder on a 0.10 m wheel resolves 0.15 mm. Yet a robot on encoders alone closes a 60 m loop metres off. The culprit is the model, not the encoder.

Call the distance driven s, the track width between the wheels b, and the right wheel's radius over the left's Ed. The software assumes equal wheels, so the heading error Δθ grows:

Say it aloud

delta-theta equals E-d minus one, times s over b.

Δθ
delta-theta the heading error the odometry does not see, in radians.
Ed
E-d right wheel radius over left wheel radius. 1.01 means 1% larger.
s
s the distance driven, in metres.
b
b the track width between the wheels, 0.50 m here.
In plain words

The right wheel travels E-d minus one more of the distance s than the left. That extra length, spread over the track width b, is the turn the robot made without knowing it.

With numbers

With illustrative numbers: Ed = 1.01, b = 0.50 m. After 1 m, Δθ = 0.01 × 1 / 0.5 = 0.020 rad = 1.15°. After 10 m, 11.5°, and the robot has drifted about 1.0 m sideways.

That error grows with distance, so averaging never removes it. Slip is random and grows as the square root of distance. On log axes, slope 1 is a wrong constant and slope 0.5 is noise. Borenstein and Feng's UMBmark drives a square both ways to measure the ratio. Catch slip by comparing the wheels' turn rate with the gyro's.

A GNSS receiver times satellite signals: about 3 m from the code alone. RTK also tracks the carrier wave, 0.1903 m long on GPS L1, and counts whole cycles using a base station: 1 to 2 cm when the count is right. When it is wrong, the receiver still says "fixed", and the error sits near whole wavelengths.

Drive the loop, then ask the satellites

Pink is the true 20 by 10 m loop. Purple is what odometry believes. Blue dots are GNSS fixes. Mismatch the wheels, add slip, then switch how the satellites behave.

1.004

Illustrative robot: b = 0.50 m, a 60 m loop, seeded slips up to 3 cm. Multipath adds up to 2 m near the wall. The wrong fix shifts one side by 0.38 m; the scatter stays 1.4 cm.

Multipath is a reflected signal arriving late. A wall 8 m away adds 2 d cos E cos Δaz = 2 × 8 × 0.940 × 0.5 = 7.5 m of path for a satellite at 20° elevation, 60° off the wall's normal. The range reads long, by a few metres, for as long as you pass the wall. An urban canyon blocks low satellites and reflects the rest. Mask satellites under about 15°, and treat successive fixes as correlated.

Symptom: the RTK position steps 38 cm, holds 90 s, steps back, while reporting "fixed" at 1.4 cm. IMU and wheels disagree with it.

Measure: 0.38 / 0.1903 = 2.00 cycles. The receiver's ratio test (second-best over best integer fit) sits just above its usual threshold of 3.

Fix: alarm on marginal ratios; gate each fix against the IMU-propagated position.

Odometry error against distance has slope 1.0 on log axes. What should you do?

Chapter 8

Radar: Exact Range, Blurry Angle

Count antennas to find the angle a radar can split, and see why fog does not stop it

An automotive radar at 77 GHz sends a chirp: a tone that sweeps up in frequency over a bandwidth B in a few tens of microseconds. The echo returns late, so it is mixed with the current chirp into a low beat frequency proportional to range. Range resolution is c / (2B): 15 cm for 1 GHz, 3.75 cm for 4 GHz.

Speed comes free. Between chirps the echo's phase advances with the target's motion, so one frame gives each target's radial speed. With a 3.9 mm wavelength and 50 µs chirps the radar reads speeds up to ±19.5 m/s without ambiguity. No tracking is needed.

Angle is the weak part. A radar finds direction by comparing the phase across a row of antennas. Call the number of antenna elements (real, or virtual from several transmitters) N, spaced half a wavelength apart. The smallest angle it can split straight ahead, Δθ, is:

Say it aloud

delta-theta is about two over N.

Δθ
delta-theta the angular resolution straight ahead, in radians.
2
two from the half-wavelength spacing: the beam's first null is at 2 / N.
N
N the number of antenna elements. 12 transmitters and 16 receivers make 192 virtual ones.
In plain words

Divide 2 by the number of antennas N. More antennas make a wider array and a narrower beam, so the radar can split closer targets.

With numbers

With N = 8: Δθ = 0.25 rad = 14.3°, a 12.5 m blur across the road at 50 m. With N = 192: 0.6°, 0.52 m. Range resolution was 15 cm all along.

Add antennas until two cars split

Two pink cars sit side by side, 3.5 m apart, one lane each. The blue curve is the radar's response across the road. Add antennas, or bring the cars closer, until the curve shows two peaks.

50 m

Illustrative uniform array at half-wavelength spacing; the curve is the array's power response to two equal targets, summed. Real radars taper the array, which widens the beam a little.

A radar's wavelength, about 4 mm, is thousands of times larger than a fog droplet, so it passes rain, fog, dust and darkness with little loss. Its own failures are specific. Ghost targets come from bounces off the road or a guardrail; the ghost's range is the length of the bounced path. Clutter from the ground needs a threshold that adapts to the local noise (CFAR). Most units have almost no elevation resolution, so an overhead sign and a stopped car can look alike.

Symptom: a target appears under a parked truck, at a range just past the truck, and vanishes when the robot moves a little.

Measure: the ghost's range equals a bounce path, it does not persist in a track, and the camera and LiDAR see nothing there.

Fix: require track consistency over several frames and cross-check with a second modality before acting.

Two cars 3.5 m apart sit 50 m ahead. Roughly how many antenna elements must the radar have to split them?

Chapter 9

Showcase: The Suite Bench, and Why Fusion Works

Add information, choose sensors that fail differently, and gate the ones that lie

Take two independent measurements of one position with standard deviations σ1 and σ2. Weight each by its precision, one over its variance. The fused standard deviation σf obeys:

Say it aloud

One over sigma-f squared equals one over sigma-1 squared, plus one over sigma-2 squared.

σf²
sigma-f squared the variance of the fused estimate.
σ1²
sigma-1 squared the variance of the first sensor's measurement.
σ2²
sigma-2 squared the variance of the second sensor's measurement.
In plain words

Turn each standard deviation into a precision, one over its square. Add the precisions. One over the total is the fused variance sigma-f squared.

With numbers

Two LiDARs, σ1 = 0.10 m and σ2 = 0.30 m: 100 + 11.1 = 111.1, so σf = 0.095 m. A whole second sensor bought 5%.

In two dimensions each precision becomes a matrix, and direction matters. A LiDAR in a corridor knows the lateral position to 5 cm and the position along it to 1 m; wheels know the reverse. Add the two information matrices and both axes come out at 5.0 cm: the error ellipse shrinks 20 times in area. Same arithmetic, sensors pointed differently: a 20-fold smaller ellipse instead of 5% (Sensor Fusion 3).

The rule assumed independence. Two cameras behind one window share rain, a bracket and a clock. With correlation 0.9 between two 10 cm sensors, the true fused error is 9.7 cm while the filter claims 7.1 cm. Its NIS averages 1.9 instead of 1. If you cannot bound the correlation, covariance intersection stays honest for any correlation, at twice the ellipse area on the corridor example (Sensor Fusion 11).

Stack hazards, then gate the liars

The pink cross is the truth. Blue dots and ellipses are each sensor's reading; purple is the fused estimate. Switch hazards on together. Wet floor and glass make a sensor confident-wrong; turn on the gate to throw out readings that disagree with the rest.

Illustrative suite, the hero's numbers. Wet floor makes the wheels report 0.5 m of motion that did not happen; the glass door gives the LiDAR a phantom 0.4 m off. The gate drops the reading whose distance d² from the others' fused estimate exceeds 9.21, then repeats.

Two lessons sit in the bench. Choose the suite so hazards do not coincide: smoke takes both optical sensors, but radar and wheels carry on. And gate: fusion launders a confident-wrong reading into a confident estimate. A χ² gate drops a reading whose distance d² from the others' estimate exceeds 9.21 (99% for two numbers). See Lesson 3 and Sensor Fusion 21.

Symptom: a second front camera drops the reported sigma from 8.0 to 5.7 cm, but the error against motion capture stays at 8.1 cm.

Measure: cross-correlate the two cameras' innovations at lag zero. Independent sensors sit near zero; these sit near 0.9. The fused NIS reads about 1.9.

Fix: separate the shared causes (mount, window, calibration, clock), or fuse with covariance intersection.

Which pair adds the most to a warehouse robot's position estimate?

Chapter 10

Field Guide

Keep the failure table, the code and the next steps in one place

Every sensor measures through a physical channel that assumes something about the world. When the assumption breaks, the sensor fails in a way its physics predicts, and each kind of failure leaves its own trace. Learn the trace, put a detector on it, and build the suite so that no single hazard removes every sensor that pins a direction.

SensorIt assumesBreaks onTrace that names it
Cameraenough photons, a still scenedark, sun glare, fast turnsfeatures lost when f ω te passes 1 to 2 px
Rolling shutterone instant per imagerotationoffset grows with |ω|; slope tr/2
Stereounique texture in both imagesblank, repeating, shiny surfaces; long rangeuniqueness ratio near 1; error grows as Z²
LiDARdiffuse backscatterglass, film, black paint, fogempty directions; phantoms behind glass
Spinning LiDARan instant sweepmotion during 100 mswall residual grows with |ω|
IMUa known, steady biastime, heat, vibration, saturationdrift as t³; bias tracks vibration or heat
Wheelsno slip, known radiiwet floors, wear, loaderror slope 1 against distance; wheel and gyro turn rates disagree
GNSS / RTKa direct path from each satellitewalls, canyons, tunnelsjumps near 0.19 m multiples; C/N₀ dips on low satellites
Radarone compact reflector per detectionbounces, clutter, fine angleghosts at bounce ranges; cross-range blur R · 2/N
python
import numpy as np

def blur_px(f_px, omega_rad_s, exposure_s):
    """Rotation blur b = f * omega * t_e, in pixels."""
    return f_px * omega_rad_s * exposure_s

def stereo_sigma(Z, f_px, B, sigma_d=0.2):
    """Depth error sigma_Z = Z**2 * sigma_d / (f * B), in metres."""
    return Z * Z * sigma_d / (f_px * B)

def lidar_range_at(R_spec, rho_spec, rho, alpha_per_km=0.0):
    """Datasheet range R_spec at rho_spec, rescaled to rho (clear air: sqrt rule).
    With fog, solve rho * T(R) / R**2 = rho_spec / R_spec**2 by bisection."""
    target = rho_spec / R_spec ** 2
    lo, hi = 0.01, R_spec * np.sqrt(max(rho, 1e-9) / rho_spec) + 1e-9
    for _ in range(80):
        R = 0.5 * (lo + hi)
        P = rho * np.exp(-2 * alpha_per_km * R / 1000) / R ** 2
        lo, hi = (R, hi) if P > target else (lo, R)
    return R

def deskew(rng, az, t, t_end, v, w):
    """2-D de-skew into the sweep-END frame (exact constant-twist form)."""
    dt = t - t_end                          # negative for all but the last beam
    th = w * dt
    safe = np.where(np.abs(th) < 1e-12, 1.0, th)
    A = np.where(np.abs(th) < 1e-12, 1.0, np.sin(th) / safe)
    Bc = np.where(np.abs(th) < 1e-12, 0.0, (1 - np.cos(th)) / safe)
    px, py = rng * np.cos(az), rng * np.sin(az)
    X = np.cos(th) * px - np.sin(th) * py + A * v * dt
    Y = np.sin(th) * px + np.cos(th) * py + Bc * v * dt
    return np.stack([X, Y], axis=1)

def gyro_drift(bias_deg_per_h, t, g=9.81):
    """Position error from a gyro bias: g * b_g * t**3 / 6, in metres."""
    b = np.radians(bias_deg_per_h / 3600.0)
    return g * b * t ** 3 / 6

def coast_time(bias_deg_per_h, budget_m, g=9.81):
    """How long the IMU alone stays inside the budget."""
    b = np.radians(bias_deg_per_h / 3600.0)
    return (6 * budget_m / (g * b)) ** (1 / 3)

def fuse_gated(means, covs, gate=9.21):
    """Information-form fusion with a chi-square gate (2 dof, 99%).
    Drops the worst reading while it disagrees with the others' fused estimate."""
    keep = list(range(len(means)))
    while True:
        Y = sum(np.linalg.inv(covs[i]) for i in keep)
        y = sum(np.linalg.inv(covs[i]) @ means[i] for i in keep)
        P = np.linalg.inv(Y); x = P @ y
        worst, d2max = None, gate
        for i in keep:
            if len(keep) < 3:
                break
            Yo = Y - np.linalg.inv(covs[i])
            Po = np.linalg.inv(Yo); xo = Po @ (y - np.linalg.inv(covs[i]) @ means[i])
            r = means[i] - xo
            d2 = r @ np.linalg.inv(covs[i] + Po) @ r
            if d2 > d2max:
                worst, d2max = i, d2
        if worst is None:
            return x, P, keep
        keep.remove(worst)

We ran every function above in numpy on this lesson's examples: lidar_range_at(120, 0.10, 0.03) gives 65.7 m, stereo_sigma(10, 700, 0.12) gives 0.238 m, gyro_drift(36, 60) gives 61.6 m, and the gated fusion rejects the slipping wheels in the bench's wet-floor case.

Where it sits. Production stacks stamp each sensor in hardware (Lesson 2), calibrate the extrinsics (Lesson 5), then fuse in an error-state filter or factor graph with per-sensor gates. Newer sensors attack the old failures: event cameras remove the exposure, FMCW LiDARs measure each point's speed, and imaging radars with hundreds of virtual antennas bring the angle cell under a degree.

Keep going

Read next

The habit. Before trusting any sensor, ask what it assumes about the world. Then ask which other sensor would disagree if that assumption broke.
A robot must work in smoke. Which addition to a camera and LiDAR suite helps most?

Now teach it: press Present or Teach and explain why smoke takes the camera and the LiDAR together but not the radar. Then go back to the suite and predict the fused error in a blank aisle before you press it.

The Sensor Suite and Its Failure Modes · Robotics Engineering, Lesson 4
Previous: Uncertainty · Next: Calibration · Back to Gleams