Overview
Systematic benchmark of four lateral control algorithms (Pure Pursuit, Stanley, LQR, MPC) in CARLA using real vehicle physics (synchronous mode, Tesla Model 3 blueprint). Tracks are discovered automatically from the CARLA map topology and each controller is evaluated on RMSE CTE, max CTE, heading error, and steering activity.
Map: Town10HD_Opt · Target speed: 14.0 km/h · Timestep: 0.05 s (20 Hz)
Full benchmark report: REPORT.md
Controllers
| Controller | Method | Key Parameters |
|---|---|---|
| Pure Pursuit | Geometric look-ahead | k=0.5, Ld_min=4.0 m |
| Stanley | Front-axle CTE + heading | k=2.5, k_soft=1.0 |
| LQR | Continuous-time optimal, gain-scheduled via CARE | Q=[2,0.5,2,0.5], R=0.5 |
| MPC | Kinematic brute-force search, N=10 horizon | q_lat=3.0, q_head=1.0, r_steer=0.1, r_rate=0.5 |
All controllers share a PID longitudinal controller (Kp=1.0, Ki=0.1, Kd=0.05).
Tracks
| Track | Waypoints | Length | Description |
|---|---|---|---|
| Curve | 100 | ~200 m | Gentle single-direction curve |
| S-Curve | 100 | ~200 m | Back-to-back opposite curves |
| T-Junction | 90 | ~180 m | Straight approach into a junction turn |
| Roundabout | 80 | ~160 m | Consistently curved loop |
Results

LQR dominates on path accuracy, with 2-4x lower RMSE CTE than MPC (second best) on every track, keeping peak excursions under 0.35 m. The tradeoff: its gain-recomputation at each tick produces steering activity 20-70x higher than any other controller, which would require a rate-limiter in real deployment.
MPC achieves the best steering smoothness thanks to an explicit rate penalty in its cost function. Stanley consistently shows the worst RMSE despite its strong reputation, likely because real actuator lag and tire dynamics hurt its front-axle formulation at low speed.
RMSE Cross-Track Error

| Controller | Curve | S-Curve | T-Junction | Roundabout |
|---|---|---|---|---|
| Pure Pursuit | 0.2790 | 0.2098 | 0.2039 | 0.2985 |
| Stanley | 0.3440 | 0.2409 | 0.2475 | 0.3717 |
| LQR | 0.0986 | 0.0736 | 0.0531 | 0.1086 |
| MPC | 0.1698 | 0.1202 | 0.1211 | 0.1834 |
Radar Overview

Live Runner
An interactive runner lets you switch controllers on-the-fly with a pygame HUD:
python -m src.control.main --controller stanley
# Keys: 1 Pure Pursuit 2 Stanley 3 LQR 4 MPC Q HUD ESC QuitGetting Started
# Requires CARLA server running on localhost:2000
python -m src.benchmark.run_benchmark
# Custom speed or specific tracks
python -m src.benchmark.run_benchmark --speed 8.0 --tracks curve s_curve roundabout
# Generate plots from existing CSVs
python -m src.benchmark.plot_resultsAll tunable parameters live in config/config.yaml.
Dependencies
carla 0.9.16 numpy scipy pygame matplotlib