Stanley Controller
What is Stanley Controller?
Developed by Gabriel Hoffmann at Stanford, the Stanley Controller was designed for autonomous vehicles to track a path during the DARPA Grand Challenge. The controller achieved this by tracking both the heading error and the cross-track error.
Kinematics
What are kinematics?
Kinematics are models derived from mathematical relationships that describe an object's motion. These models are essential for understanding the motion and limitations of robots or vehicles.
Ackermann Model
The Ackermann model is typically used to represent four-wheeled vehicles. All four tires turn to create a turning radius centered at a common point, known as the center of the turning cycle.
A challenge with this model is that it requires tracking four individual angular velocities.

Angular Velocity in Descending Order
Where:
b > c > a > d
- B: \( \omega_1 = \frac{v}{R_b} \)
- C: \( \omega_2 = \frac{v}{R_c} \)
- A: \( \omega_3 = \frac{v}{R_a} \)
- D: \( \omega_4 = \frac{v}{R_d} \)
What kinematic model will we be using?
For our Stanley Controller, we will be utilizing a simplified Ackermann model, also known as the bicycle model.
We are using this simplified model to avoid tracking four individual angular velocities. Instead, we only track the front wheel’s angular velocity, which greatly simplifies the model.

Diving into the Stanley Controller
Now that we’ve covered the kinematics, let’s dive into the actual control law used by the Stanley Controller.
Equation
Where:
- \(\delta\): Steering angle
- \(\theta_e\): Heading error
- \(K_e\): Cross-track error gain
- \(e(t)\): Cross-track error
- \(v(t)\): Velocity