Lidar uses lasers to scan the surroundings and measure distance to objects.The sensor emits pulses of light and measures how long reflections take to return.From millions of these measurements per second, the car builds a three dimensional point cloud.This cloud outlines cars, curbs, buildings, trees, and even small roadside objects.Lidar provides very accurate distance and shape information but not color or text.Radar plays a different yet essential role in the sensor suite.It sends out radio waves that bounce off objects and return to the receiver.From these reflections, radar can estimate the distance, angle, and speed of surrounding objects.Radar works well in fog, rain, and dust where cameras and lidar can be blinded.It is especially useful for tracking vehicles ahead on highways and detecting sudden braking.Ultrasonic sensors fill in the close range blind spots around the car.They work at short distances, ideal for parking, low speed maneuvers, and tight spaces.They can detect curbs, walls, and other vehicles during precise positioning.This makes them valuable for automated parking and low speed obstacle avoidance.Though simple, they help prevent minor collisions in crowded environments.Sensor fusion is the method that binds all these sources into one coherent picture.Each sensor has weaknesses that others can cover under different conditions.Software combines their outputs and weighs their reliability for the current environment.For example, cameras might dominate on a clear day while radar and lidar gain weight in fog.The fused result is a robust estimate of what surrounds the vehicle from moment to moment.Once the car has raw sensor data, it must build a structured representation of the scene.This stage of the technology is called perception and it mimics parts of human vision.Perception algorithms identify objects, track their movements, and classify them.They separate cars from cyclists, pedestrians from signs, and lanes from simple road cracks.They try to understand not just what is present but how it is changing over time.Modern perception heavily relies on deep learning and neural networks.These algorithms are trained on vast datasets of labeled driving scenes.The networks learn to detect vehicles, recognize pedestrians, and read traffic lights.They estimate lane boundaries even when lines are faded or partially blocked.They also detect unusual objects such as fallen cargo or road construction equipment.Object detection networks look at images and highlight regions containing important items.They might draw a virtual box around another car and label it with a category and confidence.Tracking systems then follow these objects across consecutive frames from the sensors.This allows the car to know not only where something is but also where it is heading.Combining detection and tracking enables a continuous understanding of the dynamic environment.Perception systems extend beyond simple classification into scene understanding.They segment images into drivable and non drivable areas using pixel level predictions.They estimate the free space where the car could safely move.They also identify road edges, medians, pedestrians on sidewalks, and crosswalk zones.This detailed map of drivable space feeds into the planning systems that choose actions.Next comes prediction, where the car must anticipate what others will likely do.Humans routinely guess whether a pedestrian will step off the curb.We sense if a driver in the next lane seems impatient and ready to merge.Self driving cars attempt something similar using statistical and learning based models.They forecast short term future paths of nearby vehicles, cyclists, and pedestrians.Prediction models evaluate motion history, positions, and road structure.They generate possible future trajectories with associated probabilities.A car approaching a green light might either continue straight or suddenly brake.A pedestrian near a crosswalk could either wait or begin crossing soon.The system must consider many such possibilities when planning its own behavior.With perception and prediction in place, the vehicle must decide how to move.Planning and decision making form the brain that turns understanding into action.High level planning chooses long term goals like following a route to a destination.Mid level planning decides lane changes, passing maneuvers, and turns at intersections.Low level planning generates the exact path and speed profile within meters and seconds.Route planning resembles traditional navigation software but with more constraints.The system must consider road rules, speed limits, and preferred paths for safety.It uses digital maps combined with the perception layer to avoid blocked roads and hazards.The route planner hands off segments to local planners that manage real time traffic.This hierarchy allows the vehicle to balance long term goals with immediate conditions.Local path planning computes a safe and comfortable trajectory for the car body.It considers boundaries like lane edges, nearby vehicles, and fixed obstacles.The planner selects a path that obeys traffic rules and maintains safe distances.Optimization algorithms balance multiple objectives such as safety, smoothness, and progress.The result is a continuous path the vehicle can follow while adapting moment by moment.Decision logic handles discrete choices that resemble human driving judgments.Should the car yield to a merging vehicle or assert its right of way.Should it change lanes now or wait until after passing a truck.These decisions follow carefully crafted rules combined with learned policies.Most systems strongly prioritize caution and predictable behavior over aggressive maneuvers.Once the path is chosen, control systems make the car follow it precisely.Control converts desired paths and speeds into commands for steering, throttle, and brakes.Feedback loops continuously measure the current motion using wheel sensors and gyroscopes.The controller adjusts outputs many times per second to reduce any tracking error.This makes the car feel stable and smooth, even during curves or quick stops.Two main control problems are lateral and longitudinal motion.Lateral control keeps the car centered in the lane and aligned with the path.Longitudinal control manages acceleration, cruising speed, and braking distances.Together they maintain safe gaps, comfortable acceleration, and responsive handling.They also enforce constraints like maximum curvature and jerk to protect passenger comfort.All of this relies on accurate knowledge of where the car is located on earth.Localization combines global navigation satellite systems, inertial sensors, and wheel odometry.In simple systems, satellite positioning provides approximate location on roads.More advanced systems compare sensor readings against detailed high definition maps.This alignment yields centimeter level positioning in favorable conditions.High definition maps are richer than standard consumer navigation maps.They can include precise lane geometry, curb positions, and exact sign locations.Some also store the three dimensional shapes of buildings and roadside objects.The car uses current sensor data to match its surroundings to this stored map.Once aligned, it knows precisely which lane and which part of that lane it occupies.