What is path following? Pure pursuit and a lookahead point
Atlasbot · 17/8/2026 · 11 min read
The article Path Planning yields a path— sequence of stationary points from A to the destination. Path Following is the final step: transform that point sequence into a real-world (v, ω) velocity statement, sending down the robot each control cycle — the correct concept trajectory learned in Trajectory .
Key concepts
Pure Pursuit is the classic, intuitive, simplest algorithm for Path Following: instead of trying to stay absolutely close to each point on the path, select a lookahead point that lies ahead of the path, a fixed distance away from the current location, and calculate the angular velocity needed to turn to that point — in the same way that drivers do not stare at the line just below the wheel, but look ahead to drive smoothly.
Path Following differs from Path Planning at the frequency of run: Path Planning runs once with a new goal (or when the map changes greatly); Path Following runs continuously every control cycle (typically 10 - 50Hz) — exactly the same distinguishing "static path" vs. "time - based trajectory" mentioned in Trajectory.
How it works
1. Find the point on the path at exactly lookahead distance L from the current position
2. Compute angle α between the robot's current heading and the direction to that point
3. Compute the required turning radius: R = L / (2·sin(α))
4. Derive angular velocity: ω = v / R
Lookahead distance is the most important parameter: small L → follows the path more accurately, but is easy to oscillate (zig-zag) at high speeds; large L → moves smoother, but cuts angularly more at folded turns. This is the classic trade - off of Pure Pursuit — with no L value optimal for all situations.
Finally: Pure Pursuit is simple, lightweight computationally efficient, good enough for most indoor low-to-moderate AMR speeds — but does not naturally handle dynamic obstacles (only stationary paths, no "visible" crosswalkers). This is why Nav2 uses more sophisticated controllers (DWB, MPPI — or Controller in Nav2 ) instead of Pure Pursuit as the default, although Pure Pursuit is still present as a optional plugin (Regulated Pure Pursuit Controller).
Technical details
Formulas
Many real-world implementations dynamically change L to current speed (high speed uses larger L to avoid jitter, low speed uses smaller L to stay close when precision is needed, e.g. at docking):
L(v) = L_min + k × v
Example: L_min = 0.3m, k = 0.5
At v = 0.2 m/s (low speed, precision needed): L = 0.3 + 0.5×0.2 = 0.4m
At v = 1.0 m/s (high speed): L = 0.3 + 0.5×1.0 = 0.8m
The radius calculated from the Pure Pursuit formula in the Operating principle section indicates the immediate physical limit: if R is calculated to be less than the minimum radius a robot can perform (drive system option, learned in Choose drive system for AMR), Pure Pursuit will require a motion that the robot can not perform.
Parameters
| Parameters | Effects of increasing | The risk if too large/small |
|---|---|---|
Lookahead distance L | Smoother, more angular cuts. | Too large: sharp corners at the fold. Too small: oscillation at high speed |
speed v | Larger L is needed to remain stable | high speed + L small → zig - zag oscillation |
Practical applications
In AMR real-world operation, the L dynamic speed-driven strategy is particularly important at operations that require high precision such as docking (pulling into the correct charging station position, or parking close to the shelf for pick/drop as learned in the Mecanum Drive for AMR) — robot actively decelerates and decreases L as it approaches the destination point to stay closer to the path more precisely, rather than using the same fixed L for both the long journey and the final accurate parking operation.
Practical example
import math
def pure_pursuit(robot_pos, robot_heading, path, lookahead_dist):
target = None
for point in path:
dist = math.hypot(point[0]-robot_pos[0], point[1]-robot_pos[1])
if dist >= lookahead_dist:
target = point
break
if target is None:
target = path[-1]
dx = target[0] - robot_pos[0]
dy = target[1] - robot_pos[1]
target_angle = math.atan2(dy, dx)
alpha = target_angle - robot_heading
L = lookahead_dist
if abs(math.sin(alpha)) < 1e-6:
return 0.0 # move straight without rotating
R = L / (2 * math.sin(alpha))
v = 0.3 # m/s, assuming constant speed
omega = v / R
return omega
path = [(0,0), (1,0.5), (2,1), (3,1.2)]
omega = pure_pursuit(robot_pos=(0,0), robot_heading=0, path=path, lookahead_dist=1.2)
print(f"omega tinh duoc: {omega:.3f} rad/s")
Output:
omega tinh duoc: 0.309 rad/s
A positive ω value means that the robot needs to rotate towards the lookahead point — which is sent with v down the Driver Layer each control cycle, repeated repeatedly so that the robot follows the path.
Common mistakes
- Select
Lfixed for all speed— as stated, causing oscillations at high speed or too much angular cutting at low speed to be exact, so adjustLdynamically tov. - Non-testing of a physically feasible computed rotational radius— requires that the robot execute rotational radii smaller than the mechanical capacity allowed (particularly with in situ non-rotational Ackermann-type robots). This is the first example of a robot with a non-rotational radius.
- The expectation of Pure Pursuit to dodge dynamic obstacles — as stated in the Summary section, Pure Pursuit sticks to stationary paths, has no internal detection/avoidance mechanism; it needs to be combined with its own costmap/local planner.
- Mismatching lookahead point with the nearest point on path — algorithm for the correct distance point
L, not the closest point to the robot, this confusion causes the robot to respond erroneously when deviating from the path.
Conclusion
Pure Pursuit turns a static path into smooth motion with a simple idea — that always targets a point in front rather than sticking strictly — with lookahead distance being the parameter to be dynamically adjusted according to speed and accuracy requirements. This is the last of a two-part unit on Basic Navigation — The four pieces of Map, Localization, Path Planning, Path Following are now complete. The section Nav2 next goes into how ROS2 realizes these concepts into the complete framework.
Get new articles and lessons by email
When a new technical article or course module is published, Atlas Robotics sends you a short email. No spam.
Unsubscribe any time with the link in each email. See our Privacy policy.