The Stanley controller is a lateral control algorithm used in autonomous vehicles. It is named after the Stanford Racing Team, which developed and used the controller in the 2005 DARPA Grand Challenge, a competition for autonomous vehicles. Due to its robustness, simplicity, and ease of implementation, it is widely used for lateral control in many successful autonomous vehicle projects.

Stanley controller is based on the pure pursuit guidance law we saw earlier. Take a look at this article for more information. But in short, pure pursuit is a geometric method for determining the desired heading angle of the vehicle to reach a point on the reference path. The Stanley controller extends the pure pursuit guidance law by incorporating a feedback control loop to regulate the vehicle's heading angle and correct any lateral position errors.

Untitled

Note that we use and track the front axle as the frame of reference. This results in an exponential decay in the cross-track error.

The Stanley controller uses a feedback control loop to regulate the vehicle's heading angle and correct any lateral position errors. The goal is to align the heading while reducing the cross-track error such that the steering limit is not exceeded. The feedback control loop uses the vehicle's lateral position error, the difference between the vehicle's actual lateral position and the desired position on the reference path, as the input to the controller. The controller uses this information to adjust the steering commands and to bring the vehicle back to the desired position on the reference path. The combined control law for this controller is as follows:

Untitled

Section 3.3 in this article explains why the Stanley controller works well using examples. Make sure to have a look at the same. That covers a short overview of how this special lateral controller works. For more information, look into the links given below.