Physical AI · Level 2 · Intermediate

Staying on the Path: How a Self-Driving Car Steers

How a self-driving car follows its planned path, shown with the pure pursuit method in our simulation: why the right look-ahead distance depends on the speed.

By 5 min read
How a self-driving car follows its planned path, shown with the pure pursuit method in our simulation: why the right look-ahead distance depends on the speed.

A planned route is only a line on a map. To drive it, a car has to turn the steering wheel at the right moment and by the right amount, many times per second, while it moves at speed. This task is called path tracking. One of the simplest and most widely used methods for it in robots and research vehicles has a vivid name: pure pursuit, the car chases a point on its path that always stays a fixed distance ahead.

This is part 3 of Level 2 in our learning path Physical AI. We simulated a car on a test route with a lane change and a curve and steered it with pure pursuit at four speeds and with six settings. You will learn how the method computes a steering angle, why its single setting, the look-ahead distance, decides between a nervous and a sloppy driver, and why the best setting depends on the speed.

How pure pursuit steers

At every moment, the method picks the point on the planned path that lies one look-ahead distance ahead of the car. It then computes the circular arc that would take the rear axle of the car exactly to that point and sets the steering angle that drives this arc. A moment later, the car has moved, the target point has moved on, and the calculation starts again. Our simulation repeats it 100 times per second.

Sketch of a car seen from above on a curved path: a target point lies on the path some distance ahead, a dashed circular arc leads from the rear axle of the car to the target point, and the front wheels are turned to drive this arc
Pure pursuit: aim at a point on the path ahead and steer the arc that leads there.

Staying on the Path: How a Self-Driving Car Steers
TermWhat it meansIn our simulation
Look-ahead distanceHow far ahead the target point lies2 to 30 meters, or growing with speed
Cross-track errorSideways distance from the planned pathMeasured 100 times per second
WheelbaseDistance between front and rear axle2.8 meters, like a midsize car
Steering delayThe steering needs time to reach the new angle0.15 seconds

Short look-ahead: precise when slow, nervous when fast

With a target point only 2 meters ahead, the car reacts strongly to every small deviation. At 18 km/h (11 mph), that is exactly right: the car stayed within 0.01 meters of the path. At 72 km/h (45 mph), the same setting made the car swing from side to side, up to 3.53 meters off the path, enough to leave the lane. At 108 km/h (67 mph), the swings kept growing until the car left the road. The reason is the one we saw for the feedback loop in Level 1: the steering reacts with a small delay, and at high speed, the car has already moved on by the time the wheels have turned. Strong, late corrections turn into oscillation.

Long look-ahead: calm, but it cuts corners

With a target point 30 meters ahead, the car drives calmly, but it aims at a point that is already past the start of the curve or the lane change. It begins to steer too early and cuts the inside of the curve. At 18 km/h, it was up to 2.43 meters off the path, at 72 km/h up to 2.18 meters. A medium setting of 8 meters kept the car within 0.07 meters at 72 km/h.

Three driven lines at 72 km/h through a lane change and a curve, drawn over the planned path: with 2 meters look-ahead, the line swings around the path; with 8 meters, it lies on the path; with 30 meters, it starts the lane change too early and cuts the inside of the curve
The same route at 72 km/h with three look-ahead distances.

Largest deviation by speed and look-ahead (meters)
Speed2 m ahead4 m ahead8 m ahead15 m ahead30 m aheadGrowing
18 km/h (11 mph)0.010.030.150.552.430.02
36 km/h (22 mph)0.020.020.120.482.340.06
72 km/h (45 mph)3.530.080.070.382.180.22
108 km/h (67 mph)leaves the road0.670.190.312.020.48

Our own simulation: vehicle model (bicycle model, wheelbase 2.8 m, steering follows with a 0.15 s delay, at most 35°) on a 243 m route with a lane change (3.5 m) and a curve (radius 40 m); pure pursuit steering, step 0.01 s. Value = largest sideways deviation from the ideal line in meters; “growing” = look-ahead of 0.6 s × speed, at least 3 m.

The fix: look further ahead the faster you drive

The table shows that no fixed setting works at every speed. The common solution is to let the look-ahead distance grow with the speed, just as people look further down the road on a highway than in a parking lot. With a look-ahead of 0.6 seconds of driving, at least 3 meters, our car stayed within 0.22 meters of the path at 72 km/h and within 0.48 meters at 108 km/h, on the same route and with the same delay in the steering.

What production systems do

Pure pursuit is simple, robust and easy to check, which is why it is popular for robots and test vehicles. Production systems for automated driving usually go further:

  • Prediction instead of a single point. Model predictive control simulates the next few seconds with a vehicle model and chooses steering and speed together so that the whole predicted path stays close to the plan.
  • Limits for comfort and grip. The controller limits steering speed and sideways acceleration so that passengers feel comfortable and the tires keep their grip.
  • Speed is part of the plan. The planner slows the car before tight curves instead of leaving the controller to fight them.
  • Better vehicle models. At high speed or on wet roads, the tires slip a little, which the simple model in our simulation ignores.

How we simulated

We used the kinematic bicycle model, a standard simple model of a car with a wheelbase of 2.8 meters, a steering that reaches a new angle with a delay of 0.15 seconds and a maximum steering angle of 35 degrees, and computed the motion in steps of 0.01 seconds in Python with numpy. The test route consists of 40 meters straight, a lane change of 3.5 meters over 40 meters, another 40 meters straight, a 90-degree curve with a radius of 40 meters and 60 meters straight. We measured the largest sideways distance to the planned path; more than 6 meters counts as leaving the road. The next part looks at how such controllers can be learned instead of designed: training in simulation and the gap to the real world.