A robot that drives runs one loop, over and over
A human driver looks, thinks, and moves the wheel, all in a blink. A self-driving car does the same jobs in four steps: sense, perceive, plan, act. Then it starts again, many times every second.
Before we go on, one word. A sensor is a part that measures the world, like a camera that measures light. Click through the loop below. The example is a ball rolling into the road.
Sense
How often is "many times a second"? It varies by car. Many systems refresh what they see somewhere around 10 to 30 times per second.
Cameras, radar, and lidar: three ways to see
No single sensor is perfect. So most self-driving cars use more than one and compare notes. Mixing them is called sensor fusion.
Takes pictures
Works like the camera in a phone. It records color and detail.
- Good at
- Reading signs, traffic light colors, and lane lines. Telling a pedestrian from a pole.
- Struggles with
- Darkness, fog, and glare from the sun. It does not measure distance directly, so software has to estimate it.
Listens for radio echoes
Sends out radio waves and times how long they take to bounce back.
- Good at
- Measuring distance and speed, even in fog, rain, and dark. Great at spotting metal cars far away.
- Struggles with
- Fine detail. It sees a blurry blip, not a shape. Small, non-metal things like a tire or a person can be weak echoes.
Measures with lasers
Short for "light detection and ranging." It fires laser pulses and builds a 3D dot map called a point cloud.
- Good at
- Exact distances and shapes, day or night, all around the car.
- Struggles with
- Heavy fog, rain, and snow, which scatter the light. It has often cost more than cameras or radar, though prices vary and keep changing.
Cars add more helpers too. Short-range sound sensors (ultrasonic) help with parking. GPS and detailed maps say roughly where the car is. A motion sensor tracks turning and braking.
Companies disagree on the mix. Some use cameras, radar, and lidar together. Others rely mostly on cameras and radar. Engineers are still testing which approach works best, so you will hear strong opinions on both sides.
The bird's-eye lab: what can each sensor see?
This is a top-down view. The car is at the bottom, facing up. Place people, bikes, cars, and debris, then switch sensors on and off. Cones show where each sensor looks. A box means the sensor found the object. Try fog and darkness too.
Things to try: hide a pedestrian behind a car. Turn on fog and watch which sensors go blind. Put debris on the road with radar only.
- Camera box
- Radar blip
- Lidar box
- Unseen
Keyboard: Tab to the scene, Arrows move the crosshair (Shift for big steps), Enter places or selects, M moves the selected item to the crosshair, Backspace removes it. With a mouse you can also drag items.
1. Place an item
2. Switch sensors
3. Pick the weather
Quick setups
| Item | Camera | Radar | Lidar |
|---|
Ranges and angles are simplified for teaching. Real sensors differ by model, and real cars also have sensors that point sideways and backward.
What you just saw is why cars mix sensors. Each one has blind spots, but they are different blind spots. When two sensors agree, the car can trust the object more. When only one sensor sees something, a careful car slows down and keeps checking.
How the car labels what it sees
Raw sensor data is just numbers: pixels and dots. The perceive step turns them into a list of things: "pedestrian, 12 meters ahead, walking left." This job is called computer vision.
The car uses a neural network, a kind of AI trained on huge numbers of street photos that people labeled. For each thing it finds, it draws a bounding box (a rectangle around the object), gives a label, and gives a confidence score. That is how sure it is, such as 91%. Confidence is a guess, not a promise. The AI can be confident and still wrong.
Now be the checker. In each scene the AI has drawn a box and a label. Is it right? Boxes are cyan when confidence is 80% or more and magenta when the AI is less sure.
Scene 1 / 9 Correct 0
Pick an answer to see why.
One picture is not enough. The car does not decide from a single photo. It follows each object across many frames, checks other sensors, and uses maps. A mannequin never moves. A sign picture on a bus travels with the bus. Time and extra sensors fix many single-frame mistakes. Learn how these AI models are built in How Does Computer Vision Work?
Guessing what others will do, then choosing a path
Knowing where things are is only half the job. A road is full of moving people. So the car makes a prediction: a short list of things each object might do in the next few seconds, with a chance for each.
Then it does path planning. It imagines many possible paths and speeds. It scores each one for safety, following the rules, passenger comfort, and making progress. It picks the best score and re-plans a moment later. Safety counts most.
Pick what the pedestrian is doing and watch the prediction and the plan change. The percentages are made-up teaching numbers.
Notice the car does not wait to be sure. When the future is uncertain, it picks a path that is safe in most of the likely futures. A careful driver does the same thing near a curb.
Fast computers still cannot cheat physics
A car cannot stop instantly. Total stopping distance has two parts:
- Reaction distance. How far the car travels while the driver, or the software, notices and starts braking.
- Braking distance. How far it keeps rolling while the brakes slow it. This grows with the square of speed: twice as fast means about four times as far.
Set a speed, a road, and who is driving. Then slide the obstacle closer and see if the car stops in time.
- Reaction distance
- Braking distance
- Obstacle in the road
Road
Who is reacting?
These numbers are approximate. Real stopping depends on tires, brakes, slope, and the road. The reaction times here are typical round figures: people vary, and so does software.
The lesson: quick reactions help, but they only shrink the first part. The braking part is physics. That is why self-driving cars also drive more carefully near hidden places, like a spot behind a parked truck.
Levels of autonomy: who is really driving?
Autonomy means doing something on your own. Engineers use a six-step scale from 0 to 5 to describe how much a car does by itself. This is a simplified version. The big question at every level is: who must watch the road?
- Who drives?
- Who watches the road?
- Where it works
The tricky one is Level 3. People are bad at staying alert when they have nothing to do, and then being asked to grab the wheel in a few seconds. Names that carmakers use for features do not always match these levels, so look at what the car actually asks you to do.
What self-driving cars still cannot do well
Bad weather
Snow can hide lane lines. Fog, heavy rain, and snow weaken cameras and lidar. Radar helps but sees little detail. Many driverless services slow down or pause in bad weather.
Rare situations
Training covers what is common. The odd cases are endless: a person in a costume, a couch in the road, a police officer waving cars through. Engineers call these rare cases edge cases. A person can use common sense. A car only knows what it was trained and tested on.
Mistakes by the AI
As the labeling game showed, the AI can be wrong and sure at the same time. Good systems cross-check with other sensors, track objects over time, and choose the cautious move when unsure.
What about hard choices?
You may have heard of a puzzle: a crash cannot be avoided, so who should the car protect? It is a famous thought experiment, and it makes people argue. In real driving, those moments are extremely rare. Most engineering effort goes into never reaching them: driving at safe speeds, leaving space, and slowing down near hidden spots like the ones in the lab above.
Still, a car has to follow some rules for risk, and people choose those rules. Nobody has a perfect answer. Here are fair questions to ask:
- Who is responsible when a driverless car makes a mistake: the company, the owner, or the maker of one part?
- Who tests these cars, and are the results open for anyone to check?
- Does the car work equally well for everyone it meets, including children, wheelchair users, and people of every skin tone? If the training photos leave people out, the AI may miss them. Read more in AI Bias and Fairness.
Safety claims need evidence. You will hear that driverless cars are safer than people, or that they are worse. Both can be hard to prove. Ask: how many miles, in what places and weather, and who checked the numbers?
Think it through
A tricky night
It is a foggy night. A person in a dark jacket stands behind a parked truck, about to step out. Which sensors might notice them, and what would you want the car to do? Try to answer before you open the hint. You can recreate it in the lab.
Sample answer. The truck blocks the camera and lidar from seeing the person. Fog and darkness would weaken them even without the truck. Radar might pick up a weak echo, but a person is a faint target. So the car may not see the person at all.
A good car would act on what it cannot see: slow down near parked vehicles, and treat the hidden space as a place a person could appear. That is cautious planning for uncertain places.
Words to know
- Sensor
- A part that measures the world, like a camera or radar.
- Camera
- A sensor that records light as a picture.
- Radar
- A sensor that sends radio waves and measures the echo for distance and speed.
- Lidar
- A sensor that sends laser pulses to measure distance and shape.
- Point cloud
- The 3D map of dots that lidar produces.
- Sensor fusion
- Combining several sensors so one covers for another.
- Computer vision
- AI that finds and names things in images.
- Bounding box
- A rectangle drawn around a detected object.
- Confidence
- How sure the AI says it is. It can be wrong.
- Prediction
- A guess, with chances, of what an object will do next.
- Path planning
- Choosing a route and speed that scores best for safety, rules, and comfort.
- Reaction time
- The delay between noticing a danger and starting to brake.
- Levels of autonomy
- A 0 to 5 scale for how much the car does itself.
- Edge case
- A rare, odd situation the car may not have seen before.
Questions people ask
How do self-driving cars see the road?
They use sensors. Cameras take pictures, radar bounces radio waves off objects, and lidar bounces laser light to measure distance. Software combines all of it into a list of nearby objects with a position, a label such as car or pedestrian, and a speed.
Do self-driving cars need lidar?
Companies disagree. Many use cameras, radar, and lidar together so that one sensor can cover for another. Some companies rely mostly on cameras and radar and argue that good software can make up the difference. Engineers keep testing both approaches, and the answer may depend on the car and where it drives.
Are self-driving cars safe?
It depends on the system, the place, and the weather. Some driverless services run only in mapped areas in good conditions. Companies publish safety reports and outside researchers also study them, and results are still being collected. When you read a safety claim, ask how many miles were driven, where, and who checked the numbers.
Can a self-driving car drive in snow or heavy rain?
It is much harder. Snow can cover lane lines, and rain, fog, and snow can weaken cameras and lidar. Radar handles weather better but sees fewer details. Because of this, many driverless services limit or pause rides in bad weather.
What are the levels of self-driving?
A common scale runs from Level 0 to Level 5. At Levels 0 to 2 the person is always the driver and must watch the road. At Level 3 the car drives in limited conditions but may ask the person to take over. At Level 4 the car drives itself within limited places and conditions. Level 5 would drive anywhere a person could, and it does not exist today.
Check what you learned
1. Which sensor measures distance by sending out laser pulses?
2. Which step of the loop turns raw sensor data into a list of labeled objects?
3. A car doubles its speed. Roughly how does its braking distance change, not counting reaction time?
Keep learning and keep building
You can now trace how a car senses, labels, predicts, and plans, and you know where it can go wrong. Next, learn how computers see pictures, or meet other robots.
Related: What Is a Robot? Sense, Think, Act