Skip to the lesson
FixTheRobot Explore Robotics / Navigation / M5 Trajectories and Path Following / M5-T4

Navigation · Theory · M5

M5-T4 — Pure Pursuit

Aim at a point ahead on the path, drive the circle that gets you there, and look again a moment later.

  • Lesson 4 of 7
  • Module 5: Trajectories and Path Following
  • Theory
  • About 8 minutes to read

Pure pursuit is the simplest path follower that works. It fits in twenty lines, it tolerates rough paths, and it has one knob, the lookahead distance. Everything that goes wrong with it comes from that knob: too short and Scout weaves, too long and it cuts every corner.

Learning objectives

After this lesson, you should be able to:

  • Derive the pure-pursuit curvature from the position of the look-ahead point in the robot frame.
  • Find the look-ahead point as the place where the path leaves a circle around the robot.
  • Convert the curvature to a turn rate or a steering angle.
  • Choose a lookahead from speed and latency, and say what goes wrong at each extreme.

The intuition

Imagine chasing a rabbit that always runs along the path a few metres ahead of you. You do not try to be on the path; you run straight at the rabbit, and because it keeps moving along the path, so do you. If the rabbit is far ahead you take a gentle, straight line and cut across the bends. If it is close you turn sharply and follow the path closely, but you also jerk about whenever the rabbit moves sideways.

In pure pursuit the rabbit is a point on the path at a fixed distance L, the lookahead distance. The robot steers along the one circular arc that starts in its current heading and passes through the point. A moment later it does the same again.

Pure pursuit geometryA robot with a heading arrow, a look-ahead point on the path at distance L, the angle alpha between the heading and the line to the point, and the circular arc that starts tangent to the heading and passes through the point. look-ahead point Lα robotarc: κ = 2 sin α / L path
The look-ahead point is where the path leaves a circle of radius L around the robot. The robot drives the arc tangent to its heading that passes through it.

The mathematics

The steering curvature

Put the goal point in the robot frame, with x forward and y to the left, at (lx, ly), and let L² = lx² + ly². The circle tangent to the heading has its centre on the robot’s left at distance R. The point is on it when lx² + (ly − R)² = R², which gives L² = 2·R·ly:

Pure pursuit
κ=1R=2⋅lyL2=2⋅sin⁡(α)L\kappa =\frac{1}{R}=\frac{2\cdot l_{y}}{L^{2}}=\frac{2\cdot \sin (\alpha )}{L}
(α = angle of the point from the heading)
ω=v⋅κ\omega =v\cdot \kappa
unicycle(differential drive)\text{unicycle}\text{(differential drive)}
δ=arctan⁡(wheelbase⋅κ)\delta =\arctan (\text{wheelbase}\cdot \kappa )
car-like robot, reference point on the rear axle

The sign of ly is the direction to steer, and a point straight ahead gives κ = 0. The lateral part ly needs the goal in the robot frame: ly = −sin θ·(gx − x) + cos θ·(gy − y). Using the map-frame offset is correct only when the robot happens to face along the map’s x axis (lab M5-L3, stage 1).

Finding the point

  1. Find the point of the path nearest to the robot.
  2. Walk forward along the path from there until it leaves the circle of radius L around the robot. Interpolate on the last segment (a quadratic in the segment parameter).
  3. If the path ends inside the circle, use the last waypoint.

Scanning the waypoints from the start of the path, or returning the first waypoint that is far enough, is the classic bug: the point is then behind the robot, or jumps from vertex to vertex.

Choosing the lookahead

Speed-dependent lookahead
L=clamp⁡(v⋅tla, Lmin⁡, Lmax⁡)L=\operatorname{clamp}(v\cdot t_{\text{la}},\,L_{\min},\,L_{\max})
tla≈1 s of travel as a starting pointt_{\text{la}}\approx 1\,\mathrm{s}\,\text{of travel as}\,a\,\text{starting point}
Effect of the lookahead
Too shortToo long
Tracks bends closelyCuts corners: the robot starts to turn well before the bend
Reacts to every small error: oscillatesConverges slowly onto the path from an offset
Unstable when the command arrives late (latency)Very stable and smooth

The rule of thumb that links the lookahead to latency: during the delay τ the robot travels v·τ. A lookahead of only a little more than that makes each correction arrive after the robot has passed the point it was aimed at. Keep L several times v·τ (lab M5-L3).

A worked example

One command. Scout is at the origin facing east and the look-ahead point is at (1.2, 0.3) in the robot frame. Then L² = 1.44 + 0.09 = 1.53 (L = 1.237 m), α = atan(0.3 / 1.2) = 14.0° and

Worked pure pursuit step
κ=2⋅0.31.53=0.392 1m\kappa =\frac{2\cdot 0.3}{1.53}=\frac{0.392\,1}{m}
R=2.55 mR=2.55\,\mathrm{m}
ω=1.0⋅0.392=0.39 rad/s\omega =1.0\cdot 0.392=0.39\,\mathrm{rad}/\mathrm{s}
(at v=1.0 m/s)(\text{at}\,v=1.0\,\mathrm{m}/\mathrm{s})
δ=arctan⁡(0.8⋅0.392)=17.4∘\delta =\arctan (0.8\cdot 0.392)=17.4^{\circ}
a tug with wheelbase 0.8 m

As a check, 2 sin α / L = 2 × 0.2425 / 1.237 = 0.392.

Frames. The robot is at (3, 2) facing north (θ = 90°) and the goal point is (2.2, 3.1). The offset is (−0.8, 1.1), and in the robot frame lx = cos θ·dx + sin θ·dy = 1.1 and ly = −sin θ·dx + cos θ·dy = 0.8. So κ = 2 × 0.8 / (0.64 + 1.21) = 0.865 1/m, to the left. The map-frame shortcut 2 · dy / L² would have given 1.19, and the wrong steering.

Corner cutting. In the simulation of lab M5-L3 (a 14 m corridor and a 90° corner) Scout creeps at 0.3 m/s and the corner is cut by the following amount, measured as the largest distance from the path:

Corner cutting against lookahead
Lookahead L0.5 m1.0 m1.5 m2.5 m
Corner cut0.13 m0.26 m0.40 m0.67 m

Weaving. At 1.2 m/s with 0.4 s of latency Scout covers 1.2 × 0.4 = 0.48 m before a command acts. Starting 0.5 m off a straight line, the error changes sign 20 times with L = 0.35 m, 28 times with 0.6 m and 36 times with 0.9 m; with L = 1.2 m (one second of travel) the error crosses zero three times and dies away, and with 1.5 m and 2.0 m it crosses at most once. The three weaving values are about 0.7 to 1.9 times v·τ; the first stable one is 2.5 times it. That is the origin of the rule "several times v·τ".

Engineering implications and limitations

Regulated pure pursuit

Plain pure pursuit drives at a constant speed and ignores curvature and obstacles. The regulated variant slows down when the path curves sharply, when near obstacles and when near the goal, and uses a speed-scaled lookahead with a minimum and a maximum. The ROS 2 Nav2 stack ships a controller of this kind. It is a good default for a differential-drive robot on a smooth global path (lesson M6-T7 compares it with DWA and MPPI).

Set the lookahead from the speed, then check at both ends

Test the slowest speed for corner cutting and the fastest speed with the real latency for weaving. A single fixed lookahead can serve only one speed.

The path matters

Pure pursuit does not need a smooth path, which is a strength, but it cuts the corners of the path it gets. A path that hugs a wall at a corner and a controller that cuts it meet in the wall. Inflate enough room, or shorten the lookahead at corners.

Feed it a reference that starts at the robot

When the robot is farther from the path than L, there is no point on the circle. A sensible implementation steers back to the nearest point of the path.

Common misconceptions

“Pure pursuit steers towards the path.”

It steers towards a point on the path that lies L ahead. The robot is rarely on the path and usually inside the bends.

“A longer lookahead is always more stable.”

It is more stable and also cuts corners and converges slowly. The right value depends on speed, latency and the bends.

“The lookahead point is the next waypoint.”

It is the point where the path leaves the circle around the robot; a waypoint is only a good proxy on a dense path.

“The goal point can be left in map coordinates.”

Only its lateral offset in the robot frame matters for steering. Mixed frames are right only for one heading.

Engineering takeaways

  1. Pure pursuit drives the arc through a look-ahead point: κ = 2·ly / L² = 2 sin α / L.
  2. The point is where the path leaves a circle of radius L around the robot, ahead of the nearest point.
  3. ω = v·κ for a unicycle, δ = atan(wheelbase·κ) for a car-like robot on its rear axle.
  4. The lookahead trades corner cutting (too long) against oscillation (too short); set it from speed and latency, about a second of travel at least.
  5. The regulated variant adds speed limits for curvature, obstacles and the goal.

References and further reading

The original pure pursuit report, a comparison of path-tracking methods, and the regulated variant.

  • R. C. Coulter, “Implementation of the Pure Pursuit Path Tracking Algorithm”, Carnegie Mellon University Robotics Institute, Technical Report CMU-RI-TR-92-01, 1992.
  • J. M. Snider, “Automatic Steering Methods for Autonomous Automobile Path Tracking”, Carnegie Mellon University Robotics Institute, Technical Report CMU-RI-TR-09-08, 2009.
  • S. Macenski, S. Singh, F. Martín and J. Ginés, “Regulated Pure Pursuit for Robot Path Tracking”, Autonomous Robots, 2023.

Knowledge check

Three conceptual questions. Write an answer, then reveal the explanation. Your answers stay in your browser.

Question 1

The look-ahead point is at (2.0, 1.0) in the robot frame. What is the curvature and the radius?

Explanation

L² = 5, κ = 2 × 1.0 / 5 = 0.4 1/m, so R = 2.5 m, to the left.

Question 2

Scout travels at 1.5 m/s and the command latency is 0.3 s. How far does it move during the latency, and what lookahead does the rule of thumb give?

Explanation

1.5 × 0.3 = 0.45 m. About one second of travel gives 1.5 m, which is more than three times 0.45 m.

Question 3

Why does a long lookahead cut corners although it makes the steering calm?

Explanation

The point it aims at is far round the bend, so the robot starts turning early and drives inside the corner. Calm steering and corner accuracy pull in opposite directions.

What’s next

Next: a controller that looks at the error under the robot instead of a point ahead.

Practice this lesson

Tune Pure Pursuit

Scout cuts corners at speed and weaves at low speed: choose a lookahead that works at both.

Next lesson

M5-T5 — Stanley and Cross-Track Control

Write the Stanley law from heading and cross-track error, and compare it with pure pursuit.

Nothing below is required to finish this lesson.