Vaibhav Shende Vaibhav Shende

CARLA Steer Lab (Lateral Control Benchmarking)

Benchmarking Pure Pursuit, Stanley, LQR, and MPC lateral control algorithms in CARLA with real vehicle physics. Includes a live interactive runner with pygame HUD and full telemetry analysis across four track types.

Software Robotics Autonomy
CARLA Steer Lab (Lateral Control Benchmarking)

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

ControllerMethodKey Parameters
Pure PursuitGeometric look-aheadk=0.5, Ld_min=4.0 m
StanleyFront-axle CTE + headingk=2.5, k_soft=1.0
LQRContinuous-time optimal, gain-scheduled via CAREQ=[2,0.5,2,0.5], R=0.5
MPCKinematic brute-force search, N=10 horizonq_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

TrackWaypointsLengthDescription
Curve100~200 mGentle single-direction curve
S-Curve100~200 mBack-to-back opposite curves
T-Junction90~180 mStraight approach into a junction turn
Roundabout80~160 mConsistently curved loop

Results

Overall Ranking

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

RMSE CTE Bar RMSE CTE Heatmap

ControllerCurveS-CurveT-JunctionRoundabout
Pure Pursuit0.27900.20980.20390.2985
Stanley0.34400.24090.24750.3717
LQR0.09860.07360.05310.1086
MPC0.16980.12020.12110.1834

Radar Overview

Radar Curve

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 Quit

Getting 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_results

All tunable parameters live in config/config.yaml.

Dependencies

carla 0.9.16  numpy  scipy  pygame  matplotlib