Autonomous Driving via Deep RL — Mani Chandan Mathi
OPEN SOURCE · 2025 github.com/mathi0405/Autonomous-driving ↗

Driving from pixels alone

How do learned policies compare with classical controllers? A dual-backend research framework with a documented fallback/state benchmark and separate CARLA integration.

ROLE

Solo researcher & engineer

AGENTS

PPO · SAC vs. PID · Stanley

ENVIRONMENT

CARLA ≥ 0.9.14 + CPU fallback

OBSERVATIONS

Raw camera pixels via CNN

01 · RESEARCH QUESTION

A learned policy vs. forty years of control theory.

Can a deep RL agent, trained entirely from simulation, match or surpass hand-engineered classical controllers on structured driving tasks?

The agent must hold its lane, take curves at varying curvature, regulate speed to a target, and avoid obstacles — with no rules encoded, operating from camera pixels alone while the classical baselines enjoy privileged state.

02 · SYSTEM

One interface, two worlds.

SIMULATION

CARLA / fallback env

identical Gymnasium
interface on both

PERCEPTION

CNN encoder

raw RGB → compact
latent representation

POLICY

PPO / SAC — or PID / Stanley

learned agents and classical
baselines, same conditions

PIPELINE

Train → checkpoint → eval

automated evaluation
+ HTML dashboard

A lightweight CPU-only kinematic simulator supports development and CI alongside the CARLA adapter. A shared software interface does not demonstrate successful policy transfer; evaluate each backend separately.

03 · REWARD DESIGN

Behavior, decomposed.

rt = wv·speed + wp·progress − wl·lane − wh·heading − ws·steer − wj·jerk + terminal
+ speedtrack the target velocity + progressarc-length advancement along route − lane errorlateral deviation from centerline − heading errormisalignment with road tangent − steer effort / jerksmoothness, no twitchy control terminallarge penalty on collision / off-road

Every sub-reward is logged independently in training telemetry — when the agent misbehaves, the responsible term is visible immediately instead of buried in a scalar.

PPO's clipped surrogate objective made it the primary algorithm for its stability on continuous control; SAC's maximum-entropy formulation serves as the off-policy comparison point.

04 · RESULTS

95% success — in fallback simulation, with state observations.

FALLBACK · 20 EPISODESSUCCESSROUTECOLLISION
PPO (state)95%98%0.05
SAC (state)85%89%0.15
PID (state)100%99%0.00
Stanley (state)100%99%0.00

The checked-in results use state observations in the lightweight fallback environment. PPO succeeds in 19 of 20 episodes; SAC succeeds in 17. These numbers do not establish camera-only CARLA performance.

Both classical baselines achieve 20/20 successes in this configuration. Performance in CARLA, on unseen routes, or under sensor degradation requires separate evaluation.

05 · ENGINEERING

CI gates every commit.

$ git push origin main

✓ ruff — lint & imports

✓ mypy — static type checking

✓ pytest — unit + integration

✓ smoke PPO training episode

✓ evaluation pipeline

✓ dashboard generation

all checks passed — merge allowed

Modular ad_rl package — envs, perception, agents, rewards, control, training, evaluation — with Dockerized environments and YAML-configured experiments for full reproducibility.

Python 3.10+ Stable-Baselines3 PyTorch Gymnasium CARLA OpenCV Docker GitHub Actions
Car on an open road

06 · FUTURE DIRECTIONS

  • Reactive traffic participants for social navigation under interactive uncertainty
  • Unsignalized intersections, roundabouts, and parking scenarios
  • World-model pretraining (DreamerV3, TD-MPC2) for sample efficiency
  • CARLA Leaderboard 2.0 evaluation against published state of the art

NEXT CASE STUDY

Sign language, understood

Deep learning for accessibility — published in IEEE, 2023 →