02 Sensing & Perception · #4 of 46

Sensing the World

Every robot's reality arrives as a stream of noisy numbers

A spinning Velodyne lidar unit, a black cylinder studded with laser apertures, mounted on a vehicle.
A spinning lidar fires hundreds of thousands of laser pulses a second and times every echo. It does not 'see' the world so much as machine-gun it with light. · APJarvis, CC BY-SA 4.0

A robot has no eyes, no inner ear, no skin. It has transducers, little devices that turn one kind of energy into a voltage, and that voltage into a number.

Everything the robot will ever believe about the universe arrives through that narrow pipe, and every number in it is slightly wrong.

The job of perception is to take that stream of slightly-wrong numbers and build a usable picture of reality from it. Before we filter, fuse, or map anything, we need a clear-eyed inventory of what kinds of senses a robot can have, and exactly how each one lies.

Here is what that pipe actually looks like, in a real room. A robot slides along the near wall and fires a range beam straight ahead at the far wall, asking "how far?" The dashed beam is the true distance the geometry would give. But the answers that come back (the accent dots) never land exactly on it: each reading is the truth plus a little random error, so they pile up into a cloud of uncertainty sitting right there in space. Turn up the noise σ (the noise level) and the cloud spreads wider; turn up the sample rate and it fills in faster. Watch what happens when the beam swings across the doorway: the true distance jumps long, and so does the reading. The robot only ever sees the dots, never the wall.

● ranging the wall reading=--m truth=0.00m err=--m

The robot slides along the near wall and pings the far wall. The dashed beam is the true distance; each accent dot is one reading, scattered by σ (the noise level). When the beam lines up with the doorway it shoots through and reads long. Bigger σ spreads the cloud; a faster rate fills it in.

The first split: am I sensing me, or the world?

Every sensor falls on one side of a single, load-bearing line.

Proprioceptive sensors measure the robot's own internal state. A wheel encoder counts how far the axle turned. An inertial measurement unit (IMU) feels its own acceleration and rotation. These sensors need nothing from the outside world (they work in a pitch-black sealed box), and that self-sufficiency is exactly why they are so seductive and so dangerous.

Exteroceptive sensors measure the world beyond the robot's skin. Lidar, cameras, sonar, a bumper switch: all report something out there. They are the only senses that can tell a robot it has wandered off course, because only they are anchored to something the robot can't fake.

What a measurement actually says

Sensors also differ in the shape of the fact they hand you. Broadly, there are two flavours.

A range-and-bearing sensor tells you "there is something this far away, in that direction." A lidar pulse is the purest example: fire a beam, time the echo, multiply by the speed of light, and you have a distance down a known angle. Sonar and radar play the same game with sound and radio. The robot learns geometry (a wall, a cliff, an obstacle) without yet knowing what the thing is.

A landmark sensor instead recognises a specific, identifiable feature: a fiducial tag on a warehouse floor, a labelled corner in a map, a face. Now the robot doesn't just know something is two metres away; it knows which something. That identity is what lets it pin itself to a map and erase accumulated error in a single observation.

The brutal stopwatch problem hiding inside 'time the echo'

Timing a light pulse sounds simple until you do the arithmetic. Light covers roughly 300,000,000 metres every second. A target sitting 2.5 m away sends its echo back after a round trip of 5 m, which takes about 16.7 nanoseconds:

t=2dc=22.5  m3×108  m/s16.7  nst = \frac{2 d}{c} = \frac{2 \cdot 2.5\;\text{m}}{3 \times 10^{8}\;\text{m/s}} \approx 16.7\;\text{ns}

That is the whole game, and it is unforgiving. If your stopwatch slips by just 10 picoseconds, your distance jumps by 1.5 mm. To put 10 picoseconds in scale: a 3 GHz CPU ticks once every 300 picoseconds, so a single clock tick already smears your reading by 45 mm. Building a sensor that times light to the millimetre means building electronics far faster than the chip running this page.

There are two honest ways to cheat the stopwatch. Direct time-of-flight just races a single sharp pulse and clocks its return, the way a flash lidar lights a whole scene at once. Indirect time-of-flight (the trick inside most depth cameras and the second-generation Kinect) sends out light flickering at a steady rate and measures how far the returning flicker has slipped out of step, then works backward to the delay. Same question, two different ways to read the clock.

The rooftop sensor module of a Waymo self-driving car: a spinning lidar dome, a ring of cameras, and side sensor pods.
A Waymo robotaxi's rooftop stack: a spinning lidar, a 360-degree camera ring, and radar pods. Every sensor is just a stream of noisy numbers. · 9yz, CC BY 4.0

Every sensor lies: pick your poison

Here is the rule that humbles every roboticist: every sensor lies a little, and it lies in three distinct flavours. Confusing them is how robots end up confidently wrong.

Why drift is so much deadlier than noise

Model a single reading as truth plus three corruptions:

zt=zttrue+b+dt+νtz_t = z_t^{\text{true}} + b + d_t + \nu_t

where bb is a fixed bias, dtd_t is slowly-varying drift, and νt\nu_t is zero-mean noise with variance σ2\sigma^2.

If you average nn independent readings, the noise term shrinks like the standard error:

σzˉ=σn\sigma_{\bar{z}} = \frac{\sigma}{\sqrt{n}}

So noise is defeatable: collect more samples and it melts away. Bias bb is constant, so averaging does nothing; it survives untouched and must be measured during calibration.

Drift is worst of all because proprioceptive estimates integrate the signal. A gyro gives angular rate ωt\omega_t, and heading is its running sum:

θt=θ0+k=1tωkΔt\theta_t = \theta_0 + \sum_{k=1}^{t} \omega_k \, \Delta t

A tiny drift dd in the rate becomes a heading error that grows linearly with time, dtd \cdot t, and the error in position, which integrates heading again, grows faster still. This is why a great IMU can hold course for a few minutes and then needs an exteroceptive "fix" to survive the hour.

How often must you look? The Nyquist rate

A sensor does not watch the world; it blinks at it, grabbing a reading, then going dark until the next one. Sample too slowly and you do not just lose detail, you can be handed a confident, completely wrong answer.

Picture a wheel spinning fast under a strobe light. Flash it at the right rate and the wheel looks frozen, or even drifts backward. The wheel never changed; your sampling did. The same trap waits for every robot that reads a vibrating, oscillating, or fast-moving signal too rarely.

The rule that saves you is clean and unforgiving. To capture a wave honestly, you must take more than two samples per cycle of the fastest motion in it. Take fewer, and the samples stop pinning the wave down: an impostor wave of lower frequency slips through them just as neatly, and your reconstruction locks onto the impostor. That fake is called an alias, and once it forms, no amount of clever math downstream can tell it from the truth.

Drag A below 2 and watch the signal die:

● ≥ 2 samples/cycle: signal preserved A=1.6 apparent=--×

Drag A. Above 2 samples per cycle the accent reconstruction sits right on top of the true wave. Push A below 2 and the dots no longer pin the wave down: the reconstruction folds to a slower, wrong wave. That is aliasing, and the original signal is gone.

The 2× rule, and the folding that destroys the signal

Write the true signal as a sine at frequency ff and the sampler as taking fsf_s samples per second. The Nyquist-Shannon sampling theorem says a signal is perfectly recoverable only if

fs>2ff_s > 2 f

The threshold fs/2f_s / 2 is the Nyquist frequency: the highest frequency your sampling rate can honestly represent. Anything above it does not vanish; it folds back below the line. A true frequency ff sampled at fsf_s shows up at an apparent frequency

falias=fkfs,k=round(f/fs)f_{\text{alias}} = \bigl|\, f - k\,f_s \,\bigr|, \qquad k = \text{round}(f / f_s)

When fs>2ff_s > 2f the nearest multiple is k=0k = 0, so falias=ff_{\text{alias}} = f and nothing moves. Drop below that and kk jumps to 1, folding a fast wave down onto a slow one. This is exactly why the demo's reconstruction collapses to a lazy, wrong wave the moment A crosses 2: every sample still lands perfectly on a slower sine, so a naive reconstruction has no way to know it picked the wrong one.

The practical defence is an anti-aliasing filter: a low-pass filter in front of the sampler that erases everything above the Nyquist frequency before it can fold, so the impostor never gets a chance to form. You throw away the detail you cannot sample honestly, rather than letting it lie to you.

Active vs passive: do you make your own light?

One last axis, and it has real engineering teeth. A passive sensor only receives whatever energy the world happens to send it: a camera waits for ambient photons, a microphone for sound that's already there. Cheap, silent, low-power, and stealthy. The catch: no light, no data. A passive camera in a dark warehouse is a brick.

An active sensor emits its own energy and measures what bounces back: the lidar's lasers, sonar's chirp, a depth camera's projected dot pattern. It carries its own sun, so it works in total darkness and gives clean range. The price: power draw, cost, and the awkward fact that two active sensors can dazzle each other. A room full of lidars is a room full of robots shouting over one another.

Carrying your own sun has a catch: there is a real sun, and it is much louder than you. A typical depth camera lights the scene with about one watt. Sunlight lands at roughly 1,000 watts per square metre, and even after a narrow optical filter that throws away every colour but the sensor's own, about 50 watts get through. So on a bright day the sun can outshout the camera's own signal by something like fifty to one, and the depth image dissolves into glare. This is why a gadget that works flawlessly on your desk can go blind the moment you carry it outdoors.

An automotive 4D imaging radar sensor, a flat circuit-board module studded with patch antennas behind a protective cover.
An automotive imaging radar: a textbook active sensor. It emits its own 60 GHz radio energy and listens for the echo, so it works in pitch dark, fog, or blinding sun, paying for that independence in power, cost, and the risk of two such sensors dazzling each other. · Amyreed444, CC BY-SA 4.0
Why a flash lidar barely trips over its neighbours, and how that got a robot onto an asteroid

The "dazzle each other" worry is real for the slow, steady kind of active sensor, but a flash lidar mostly dodges it, and the reason is just arithmetic. A direct flash lidar fires one short pulse, say 10 nanoseconds, and listens for the echo. Light covers 300 metres in a microsecond, so for anything within 100 metres the whole round trip is over in about 660 nanoseconds. The camera only opens its shutter for that brief window, then sits dark until the next pulse. At 30 frames a second the gap between pulses is about 33 milliseconds. So the odds that a second lidar fires exactly while your shutter happens to be open are roughly the open window divided by the gap:

P0.66  μs33  ms150,000P \approx \frac{0.66\;\mu\text{s}}{33\;\text{ms}} \approx \frac{1}{50{,}000}

A one-in-fifty-thousand collision is a risk you can live with. That same single-pulse-grabs-the-whole-scene trick is exactly what you want in space, where there is no time to scan dot by dot while you fall toward a rock. A 3D flash lidar of this kind flew on NASA's OSIRIS-REx mission and helped it reach down and grab a sample from the asteroid Bennu. The same class of sensor has been flight-tested for landing helicopters by themselves. Direct time-of-flight is not just a cheaper depth camera; it is the sense that lets a machine touch a world no one has ever stood on.

Stanley, a sand-colored Volkswagen Touareg with roof-mounted laser scanners, the driverless car that won the 2005 DARPA Grand Challenge.
Stanley, Stanford's driverless VW Touareg, won the 2005 DARPA Grand Challenge by fusing roof-mounted lidar, a camera, radar, and GPS to cross the Mojave Desert with no one at the wheel. · DARPA, public domain

Key takeaways

There is no such thing as a robot that perceives the world directly. There is only a machine listening to a chorus of imperfect witnesses (one that drifts, one that's blind in the dark, one that's off by a constant inch) and deciding, thousands of times a second, what to believe.

Everything that comes next in this course is the science of believing them well.

full glossary →