Skip to content
AI360XpertBeta

Robot Path Tracking with Pure Pursuit

A mobile robot follows a route by repeatedly steering toward a point farther along it. Pure pursuit fits a turning circle through that point, then converts curvature into wheel or steering commands.

A circle tangent to the robot's heading reaches the lookahead target while departing from the reference path.
A circle tangent to the robot's heading reaches the lookahead target while departing from the reference path.

Why Does This Exist?

A route is a geometric instruction, not a steering command. After a small disturbance, replaying the planned wheel speeds can leave a robot beside the route indefinitely. Path tracking uses the current pose to keep steering back toward progress along the route. Pure pursuit supplies one inexpensive geometric rule for that feedback.

A pose is position plus heading. Wheel odometry estimates how it changes; motion planning chooses a route. Here we connect the two. Following a path does not prescribe an arrival time at every point; tracking a timed trajectory adds a scheduling objective.

Think of It Like This

Steering a shopping cart toward the next floor marker

Push a cart while looking at a floor marker ahead along a curved aisle. You steer toward that marker, then choose a new one as you advance. Looking very close makes each little sideways error provoke a large correction. Looking far ahead smooths the response but can cut inside the bend.

The marker is the lookahead target, your steering correction is curvature, and walking speed is a separate choice. The analogy stops at the cart's freely swiveling casters: the controller here assumes a wheeled base with a defined forward direction and no sideways slip.

How It Actually Works

Choose a target in the robot's frame

Select a point ahead in path progress, then transform it into the current robot frame with x forward and y left. Call its coordinates (xg,yg)(x_g,y_g) in metres. Let L=xg2+yg2L=\sqrt{x_g^2+y_g^2} be the actual straight-line distance from the robot to that point. In the classic construction the lookahead target is an intersection of the path with a radius-LL circle centered on the robot. Path arc length and this chord length are different.

At a crossing, several points may have the same distance. Retain progress along the ordered path and select the intended forward branch. A global nearest-waypoint lookup can jump to a later lap. Near the path end, the actual chord may be shorter than the requested lookahead; use the actual target geometry in the curvature denominator.

Derive the turning circle

The instantaneous circle must be tangent to the forward x-axis at the robot origin, so its center is (0,R)(0,R) for a left turn. The target lies on it:

xg2+(yg−R)2=R2.x_g^2+(y_g-R)^2=R^2.

Expanding and cancelling R2R^2 gives L2=2RygL^2=2Ry_g. Thus signed curvature, the reciprocal turning radius, is

κ=2ygxg2+yg2,ω=vκ.\kappa=\frac{2y_g}{x_g^2+y_g^2},\qquad\omega=v\kappa.

κ\kappa has units m⁻¹, vv is forward speed in m/s, and ω\omega is yaw rate in rad/s. Positive y asks for a left turn. A target straight ahead gives zero curvature without needing an infinite radius in code. Coulter's original implementation report, Sections 2–4, derives the circle geometry and discusses lookahead behavior; its drawing uses a different axis arrangement, so compare physical directions rather than copying variable names.

Worked example: a target, an arc and two wheel speeds

For (xg,yg)=(0.8,0.6)(x_g,y_g)=(0.8,0.6) m, L2=0.64+0.36=1L^2=0.64+0.36=1 m². Therefore κ=1.2\kappa=1.2 m⁻¹ and R=0.833333R=0.833333 m. At v=0.4v=0.4 m/s, ω=0.48\omega=0.48 rad/s. On an ideal differential-drive base with wheel separation b=0.5b=0.5 m,

vL=v−ωb/2=0.28 m/s,vR=v+ωb/2=0.52 m/s.v_L=v-\omega b/2=0.28\ \mathrm{m/s},\qquad v_R=v+\omega b/2=0.52\ \mathrm{m/s}.

These are linear tread speeds, not motor angular speeds; divide by wheel radius for rad/s before gearing. The same curvature for a bicycle model with wheelbase ℓ=0.5\ell=0.5 m requires steering angle δ=arctan⁡(ℓκ)=0.540420\delta=\arctan(\ell\kappa)=0.540420 rad, approximately 30.964∘30.964^\circ.

The diagram uses equal spatial scales. The dashed chord connects the robot and target; the radius meets the current heading at a right angle. The solid pursuit arc reaches the selected target but leaves the piecewise reference path before it does. Only the target is shared: the path polyline is an illustrative route, not a claim that a circular controller exactly follows every segment.

What makes the geometry executable?

Lookahead trades responsiveness against path deviation. A shorter distance amplifies sensitivity to local pose and path noise; a longer one can smooth steering while cutting corners. Regulated Pure Pursuit, Sections 2–3, adds speed regulation and projected collision checks to address practical weaknesses of the basic geometric controller. The simple formula does not choose a safe speed.

If the outer wheel can supply at most 0.50.5 m/s in our fixture, 0.520.52 m/s is infeasible. Scaling both wheel speeds by 0.5/0.520.5/0.52 preserves curvature and reduces body speed to 0.3846150.384615 m/s. Clipping only the outer wheel changes curvature and therefore the arc. Acceleration, steering-rate and lateral-acceleration limits need separate treatment. For a no-slip approximation, lateral acceleration magnitude is v2∣κ∣v^2|\kappa|, here 0.1920.192 m/s²; this alone is not a traction guarantee.

Use pure pursuit for a feasible path when simple geometric feedback is sufficient. Use MPC or another constrained tracker when dynamic limits, timing or coupled objectives dominate. Neither tracker makes stale localization or an incorrect obstacle map reliable. Define endpoint stopping, reversing and recovery behavior explicitly; this page's controller handles forward targets only.

Code

This standard-library example verifies that the fitted circle contains the target and demonstrates curvature-preserving wheel saturation. It computes one command, not an obstacle-aware navigation stack.

from math import hypot, isclose, isfinite
def pursuit(x: float, y: float, speed: float, track: float,            wheel_limit: float) -> tuple[float, float, float]:    if not all(isfinite(a) for a in (x, y, speed, track, wheel_limit)):        raise ValueError("finite inputs required")    if x <= 0 or speed < 0 or track <= 0 or wheel_limit <= 0:        raise ValueError("forward target and valid limits required")    curvature = 2*y / (x*x+y*y)    yaw_rate = speed*curvature    left, right = speed-yaw_rate*track/2, speed+yaw_rate*track/2    scale = min(1.0, wheel_limit/max(abs(left), abs(right), 1e-15))    return curvature, left*scale, right*scale
k, left, right = pursuit(0.8, 0.6, 0.4, 0.5, 0.5)radius = 1/kassert isclose(hypot(0.8, 0.6-radius), abs(radius))actual_v = (left+right)/2actual_w = (right-left)/0.5assert isclose(actual_w/actual_v, k)assert isclose(pursuit(1.0, 0.0, 0.4, 0.5, 0.5)[0], 0.0)assert pursuit(0.8, -0.6, 0.4, 0.5, 0.5)[0] < 0print(f"curvature={k:.3f} 1/m; wheels={left:.6f}, {right:.6f} m/s")print(f"limited body speed={actual_v:.6f} m/s")

Output: curvature=1.200 1/m; wheels=0.269231, 0.500000 m/s and limited body speed=0.384615 m/s.

Watch Out For

A world-frame target is used as a body-frame error

The robot turns the wrong way as its heading changes even though the target stays fixed. Subtract the robot position, then rotate by the inverse current heading. Verify that a point physically to the robot's left produces positive y and a positive yaw command under the chosen convention.

A clear path is assumed to imply a clear pursuit arc

The planner's polyline clears a corner, but the executed arc cuts through the inside obstacle. Check the predicted swept footprint of the tracking command, including the load and stopping behavior. Reduce speed, adjust lookahead or replan when the tracked motion is infeasible; changing the steering rule alone doesn't certify clearance.

The Quick Version

  • Pure pursuit fits a tangent circle through a forward target expressed in the robot frame.
  • Curvature is twice the target's lateral offset divided by squared chord length, not squared path arc length.
  • The worked target needs 1.2 m⁻¹ curvature; proportional wheel-speed scaling preserves it under the stated limit.
  • Lookahead, progress selection, collision checking and speed regulation are separate design decisions around the geometric rule.