How Do Self-Driving Cars Work? Sensors, AI & More

A self-driving car does the same jobs a human driver does: it notices what is around it, works out what that means, decides what to do and moves the controls, then repeats the loop continuously. No single sensor works well in every condition, so these cars rely on several kinds at once, each covering for the others’ blind spots.1PubMed Central. Sensors in Self-Driving Vehicles: A Detailed Literature Review and New Trends Much of the difficulty lies in rare, unusual moments, because those are the situations where crashes tend to happen.2Journal of Intelligent and Connected Vehicles. World model-based long-tail and scenario-specific generation for autonomous driving

The Three Ways a Self-Driving Car Senses the Road

Cameras do the reading. They are the only sensor that can pick out color and text, which makes them essential for traffic lights and road signs.3Averna. Radar vs LiDar vs Cameras: Know Your Sensors They also have limits: they need available light, and they estimate distance rather than measure it.3Averna. Radar vs LiDar vs Cameras: Know Your Sensors Glare, darkness and bad weather can degrade what a camera sees.1PubMed Central. Sensors in Self-Driving Vehicles: A Detailed Literature Review and New Trends

Radar measures distance and closing speed directly.3Averna. Radar vs LiDar vs Cameras: Know Your Sensors It stays reliable in fog and darkness that blind a camera.3Averna. Radar vs LiDar vs Cameras: Know Your Sensors Its picture is coarse, though, so it struggles to tell what kind of object it has detected.3Averna. Radar vs LiDar vs Cameras: Know Your Sensors That is why the two are paired for judging a car ahead. A camera can tell that the shape in front is a car with its brake lights on, but it only guesses how far away it is. Radar knows the distance and how fast the gap is closing, but can say little about what the object is. Together they answer both questions.

LiDAR is the spinning or boxy unit often seen on a robotaxi’s roof. It fires laser pulses and times how long each one takes to bounce back.4YellowScan. LiDAR for Cars: Understanding the Core Technology Distance is half the round-trip time multiplied by the speed of light.4YellowScan. LiDAR for Cars: Understanding the Core Technology Each scan produces millions of points that form a 3D outline of the surroundings, reaching out about 300 to 400 meters.5Think Autonomous. Point Clouds in Self-Driving Cars: 3 Things Perception Engineers Must Know The dots carry no color, so the laser sensor cannot read a sign. Because it supplies its own light, it works the same at noon and at midnight. It does cost more than the other sensors and loses accuracy in fog and snow.3Averna. Radar vs LiDar vs Cameras: Know Your Sensors

Why One Sensor Is Never Enough

Sensors can fail because of hardware defects, electrical noise or weather, so relying on a single sensor for any driving task is unsafe.6Preprints. Sensor and Sensor Fusion Technology in Autonomous Vehicles: A Review Cars therefore combine the readings of complementary sensors into one view.1PubMed Central. Sensors in Self-Driving Vehicles: A Detailed Literature Review and New Trends The fusion software also keeps tracking each object’s position and speed, and predicts where it will be when readings briefly drop out.7PubMed Central. Kalman Filter-Based Fusion of LiDAR and Camera Data in Bird’s Eye View for Multi-Object Tracking in Autonomous Vehicles On a foggy night, the camera sees little and the laser returns weaken, but radar still detects the car ahead and its speed.

Failure does not always mean a sensor goes dark. It can keep sending readings that are noisy, delayed or simply wrong. So the software has to judge how trustworthy each reading is, not only whether one arrived. When two sensors disagree, say the camera sees a shape radar cannot classify, the software weighs which one is more reliable in the current conditions. When they agree, its confidence that something is really there goes up.

How the AI Recognizes What It Sees

A common method labels each pixel of a camera image with a category, such as road or obstacle.8arXiv. Semantic Segmentation for Autonomous Driving: Model Evaluation, Dataset Generation, Perspective Comparison, and Real-Time Capability From that, the car learns where the drivable space is and where things are in its way.8arXiv. Semantic Segmentation for Autonomous Driving: Model Evaluation, Dataset Generation, Perspective Comparison, and Real-Time Capability Deep learning has made this labeling much more accurate.9Applied Sciences. Real-Time Semantic Image Segmentation with Deep Learning for Autonomous Driving: A Survey It also has to run in real time, and some models are fast enough to do it on small computers inside the car.8arXiv. Semantic Segmentation for Autonomous Driving: Model Evaluation, Dataset Generation, Perspective Comparison, and Real-Time Capability

The software learns from huge numbers of labeled example images. It picks up patterns rather than following hand-written rules, so it is only as good as the variety of examples it has seen.

Recognizing is only half the job. Spotting a pedestrian is not enough; the car must also guess where that person will move next, and those guesses feed directly into its driving decisions.

How It Knows Exactly Where It Is

Many self-driving cars carry an HD map, a highly detailed map that records landmarks such as signs and lane markings.10PubMed Central. Simultaneous Localization and Map Change Update for the High Definition Map-Based Autonomous Driving Car The car finds its position by matching a sign its camera sees to that sign’s location on the map.10PubMed Central. Simultaneous Localization and Map Change Update for the High Definition Map-Based Autonomous Driving Car This method can place the car within about 5 cm side to side, though accuracy along the direction of travel is closer to 1 meter.112019 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). Exploiting Sparse Semantic HD Maps for Self-Driving Vehicle Localization

Phone-style GPS is not enough for this. It can be off by several meters, and tall buildings and tunnels can weaken or block the signal.

The detailed map can also go out of date. Roadworks or new signs change what the car sees, so it has to notice the difference and update the map. A stale map is one reason these cars are limited to areas that are regularly mapped.

How It Decides Where to Go

The planner sketches many possible paths and pairs each with a range of speeds.12publications.ri.cmu.edu. A Real-Time Motion Planner with Trajectory Optimization for Autonomous Vehicles It scores each option with cost rules and picks the best one, then fine-tunes the chosen path to be smoother.12publications.ri.cmu.edu. A Real-Time Motion Planner with Trajectory Optimization for Autonomous Vehicles Newer planners increasingly use machine learning alongside these rules.13Engineering Science and Technology, an International Journal. Trajectory planning and tracking control in autonomous driving system: Leveraging machine learning and advanced control algorithms

The scoring rewards keeping a safe distance from other road users and following traffic rules. It penalizes harsh braking and sharp swerves that feel uncomfortable, while still favoring steady progress toward the destination.

The plan is redone many times every second. If a child steps into the road, the scores change immediately, which is how the car reacts without needing a separate emergency mode.

How the Car Steers and Brakes Itself

In drive-by-wire, the controls are run by electronic signals rather than direct mechanical links.14PubMed Central. Drive-By-Wire Development Process Based on ROS for an Autonomous Electric Vehicle The planner sends just two targets, a speed and a curve, which the system converts into a steering angle and wheel speed.14PubMed Central. Drive-By-Wire Development Process Based on ROS for an Autonomous Electric Vehicle Small controllers keep adjusting the electronic controls so the car stays on target.14PubMed Central. Drive-By-Wire Development Process Based on ROS for an Autonomous Electric Vehicle Electric motors move the brake, accelerator and steering on command from microprocessors.15Automotive IQ. Braking and steering systems to control a new generation of autonomous vehicle Wind, slopes and bumps push the car off its target, and the controllers measure the error and fix it continuously.

What Still Trips Self-Driving Cars Up

Crashes often happen in rare situations that do not resemble normal driving.2Journal of Intelligent and Connected Vehicles. World model-based long-tail and scenario-specific generation for autonomous driving Severe failures usually build up from several factors over time rather than a single mistake.2Journal of Intelligent and Connected Vehicles. World model-based long-tail and scenario-specific generation for autonomous driving Examples include a police officer waving traffic through a red light, a mattress falling off a truck ahead, or roadworks with confusing cones. Systems that learn by copying human driving handle these events poorly, because they have few examples of them.16arXiv. Alpamayo-R1: Bridging Reasoning and Action Prediction for Generalizable Autonomous Driving in the Long Tail

More miles alone will not fix this, since rare events seldom appear even in huge amounts of driving data. Developers instead create simplified simulated scenarios to train for them, which lets them repeat a dangerous moment safely as many times as needed. This approach has produced reliable driving in a real test car.17arXiv. Scaling Planning for Automated Driving using Simplistic Synthetic Data Real-world testing is still needed to confirm the simulated training works.

Weather is the other trouble spot. Rain scatters the laser sensor’s light, shortening how far it can see.18PubMed Central. An Overview of Autonomous Vehicles Sensors and Their Vulnerability to Weather Conditions Within the roughly 250 m these cars usually need, rain does not noticeably hurt it until it is heavy.18PubMed Central. An Overview of Autonomous Vehicles Sensors and Their Vulnerability to Weather Conditions

Backup Systems When Something Fails

A highly automated car must be able to finish its driving task even when a part fails.19arXiv. Formal Verification of a Fail-Operational Automotive Driving System A basic design might simply shut down when something breaks, which is fine for a machine you can walk away from. A moving car cannot switch off, so it has duplicate systems and logic that switches to a backup level after any electrical or electronic failure.19arXiv. Formal Verification of a Fail-Operational Automotive Driving System Electronic braking, for instance, needs a dependable power supply, fault-tolerant communication links and backup hardware and software.20Reliability Engineering and System Safety. Architectural design and reliability analysis of a fail-operational brake-by-wire system from ISO 26262 perspectives

In practice, a safe fallback may mean the car slows down and pulls over, with backup brakes and power working through the switch. The goal is a safe stop rather than a sudden loss of control. When the car meets a situation it cannot handle, a remote human can help guide it.21U.S. Department of Transportation. Managing Cybersecurity for Automated Vehicles—and Risks for Commercial Motor Vehicle Teleoperation

That remote link creates its own risk. One U.S. government analysis of remote-help systems found more than 90 possible cybersecurity threats.21U.S. Department of Transportation. Managing Cybersecurity for Automated Vehicles—and Risks for Commercial Motor Vehicle Teleoperation These systems need secure communications and controlled access to operate safely.21U.S. Department of Transportation. Managing Cybersecurity for Automated Vehicles—and Risks for Commercial Motor Vehicle Teleoperation Protection alone is not enough, because attacks also have to be detected.22IEEE Access. A Physics-Informed Context-Aware Approach for Anomaly Detection in Tele-Driving Operations Under False Data Injection Attacks

Levels of Automation and When You Must Take Over

Industry groups describe automation in steps, and the most widely used scale is the SAE’s six levels, from 0 to 5.23Elsevier. Talking about automated vehicles: what do levels of automation do? At lower levels the car only assists, and you are still the driver, watching the road all the time. Most cars on sale offer assistance, not full self-driving. Lane-keeping and adaptive cruise control still need you to watch the road, and your car manual states the level of automation it actually provides.

At Level 3 the car drives itself in certain conditions but can ask the driver to take over.24PubMed. Psychophysiological responses to takeover requests in conditionally automated driving The job of watching shifts to the system for that stretch, yet you are still the fallback when conditions leave the range it can handle. Drivers who have been out of the loop find it hard to retake control.24PubMed. Psychophysiological responses to takeover requests in conditionally automated driving

Warning time matters here. The alert to take over gives the driver only a short window. When drivers get only 4 seconds of warning, their stress is higher than with 7 seconds.24PubMed. Psychophysiological responses to takeover requests in conditionally automated driving In one study, 16 to 30 seconds of warning gave drivers the best awareness before exiting a freeway.25PubMed. The effects of takeover request lead time on drivers’ situation awareness for manually exiting from freeways: A web-based study on level 3 automated vehicles The more aware drivers are of their surroundings, the faster they react.26PubMed Central. Impact of SA-related visual characteristics on driver takeover reaction time in L3 automated vehicles: an eye-movement-based evaluation method So keep your eyes and attention near the road even when the car is driving.

Responsibility in a crash is still being worked out. In partly automated cars, it is often unclear whether the driver or the maker is liable.27The Global Insurance Market and Change. Autonomous Vehicles Drivers should know their own legal responsibility before relying on the system.

The Trolley Problem in Real Life

The dilemma of which group a car should hit dominates public debate.28PubMed Central. Solving the Single-Vehicle Self-Driving Car Trolley Problem Using Risk Theory and Vehicle Dynamics Given the limited information a car has and how tires grip the road, though, braking straight is usually the least risky option.28PubMed Central. Solving the Single-Vehicle Self-Driving Car Trolley Problem Using Risk Theory and Vehicle Dynamics Turning while braking hard reduces grip, and the car may skid unpredictably.