Python

Autonomous Driving System

A modular autonomous-driving simulation project combining perception, decision logic, path planning, vehicle control, and a Streamlit dashboard. It is a simulation project, not a road-ready autonomous vehicle.

Summary

A modular autonomous-driving simulation project combining perception, decision logic, path planning, vehicle control, and a Streamlit dashboard. It is a simulation project, not a road-ready autonomous vehicle.

From README.md in the repository.

Industry-grade autonomous vehicle simulation system integrating deep-learning perception, rule-based + RL decision making, classical path planning, PID vehicle control, and a real-time Streamlit dashboard. Built as an AI/Autonomous Systems internship capstone portfolio project.


๐Ÿ“‹ Table of Contents

  1. Project Overview
  2. System Architecture
  3. Module Breakdown
  4. Installation
  5. Dataset Setup
  6. Running the System
  7. Training the RL Agent
  8. Evaluation
  9. Dashboard Usage
  10. Evaluation Metrics
  11. Results
  12. Project Structure
  13. Future Improvements
  14. References

๐ŸŽฏ Project Overview

This project implements a complete, modular autonomous driving pipeline capable of:

Capability Implementation
Lane detection Hough Transform + temporal smoothing
Object detection YOLOv11 (Ultralytics) + ByteTracker
Traffic sign recognition YOLO + fine-grained CNN classifier
Depth estimation Intel MiDaS (DPT_Large)
Driving decisions Rule-based FSM + Behaviour Planner
Global path planning A* search on occupancy grid
Local path planning Pure Pursuit + potential fields
Vehicle control PID + Stanley controller + AEB
End-to-end RL driving PPO (Stable-Baselines3)
Simulation CARLA 0.9.15+ (5 scenarios)
Monitoring Streamlit real-time dashboard

๐Ÿ— System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                        CARLA Simulator                           โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  RGB Camera  โ”‚  โ”‚  Depth Cam   โ”‚  โ”‚  LiDAR / GNSS / IMU  โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
          โ”‚                 โ”‚                       โ”‚
          โ–ผ                 โ–ผ                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      PERCEPTION LAYER                            โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚ Lane Detectionโ”‚ โ”‚Object Detect โ”‚ โ”‚Sign Detecโ”‚ โ”‚  Depth   โ”‚ โ”‚
โ”‚  โ”‚ (Hough+CV2)   โ”‚ โ”‚ (YOLOv11)    โ”‚ โ”‚(YOLO+CNN)โ”‚ โ”‚ (MiDaS)  โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ”‚                โ”‚              โ”‚             โ”‚
           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ–ผ              โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      PLANNING LAYER                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚  Decision Engine โ”‚      โ”‚      Behavior Planner (FSM)      โ”‚ โ”‚
โ”‚  โ”‚  (Rule-based)    โ”‚      โ”‚  IDLEโ†’LANE_FOLLOWINGโ†’INTERSECT.. โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚           โ”‚        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                     โ”‚
โ”‚           โ–ผ        โ–ผ                                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚  Path Planner: A* Global + Pure Pursuit Local            โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      CONTROL LAYER                               โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Steering (PID+    โ”‚  โ”‚  Throttle (PID)  โ”‚  โ”‚  AEB        โ”‚  โ”‚
โ”‚  โ”‚ Stanley)          โ”‚  โ”‚  Speed control   โ”‚  โ”‚  Emergency  โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚   RL Agent (PPO)      โ”‚ โ† Optional end-to-end
                    โ”‚   Stable-Baselines3   โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚ Streamlit Dashboard   โ”‚
                    โ”‚ (Live monitoring)     โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”ฉ Module Breakdown

Perception (perception/)

File Description
lane_detection.py Canny + Hough lane detection, temporal smoothing, lane-centre computation
object_detection.py YOLOv11 wrapper, distance estimation, threat classification, ByteTrack
traffic_sign_detection.py Two-stage YOLO+CNN, HSV traffic-light colour parsing
depth_estimation.py MiDaS monocular depth, per-object distance enrichment

Planning (planning/)

File Description
decision_engine.py Prioritised rule-stack: emergency brake โ†’ red light โ†’ pedestrian โ†’ follow โ†’ cruise
behavior_planner.py Hierarchical FSM with 9 states + lane-change logic
path_planner.py A* global planner on occupancy grid + Pure Pursuit local planner

Control (control/)

File Description
pid_controller.py Generic PID with anti-windup, derivative filter, gain scheduling
steering_control.py PID + Stanley controller fusion for lateral control
throttle_control.py PID longitudinal control + Automatic Emergency Braking (AEB)

Simulation (simulation/)

File Description
carla_env.py Gymnasium-compatible CARLA environment, 5 scenarios, reward shaping
sensors.py Thread-safe sensor manager: RGB, depth, semantic, LiDAR, GNSS/IMU

RL Agent (rl_agent/)

File Description
train.py PPO trainer with custom CNN feature extractor, EvalCallback, W&B logging
evaluate.py Structured evaluation across all scenarios, JSON/CSV report generation

โš™๏ธ Installation

Prerequisites

  • Ubuntu 20.04+ or Windows 10/11
  • Python 3.11+
  • NVIDIA GPU with CUDA 11.8+ (recommended; CPU fallback available)
  • CARLA 0.9.15 (download)

Step 1 โ€” Clone & Create Environment

git clone https://github.com/yourusername/autonomous-driving-system.git
cd autonomous-driving-system

python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate

Step 2 โ€” Install Python Dependencies

pip install --upgrade pip
pip install -r requirements.txt

Step 3 โ€” Install CARLA Python Client

# For CARLA 0.9.15
pip install carla==0.9.15

# OR install from the CARLA PythonAPI egg (if server is local)
cd /opt/carla/PythonAPI/carla/dist
pip install carla-0.9.15-cp311-cp311-linux_x86_64.whl

Step 4 โ€” Download YOLO Weights

# YOLOv8n (auto-downloads on first run)
python -c "from ultralytics import YOLO; YOLO('yolov8n.pt')"

# Or for YOLOv11:
python -c "from ultralytics import YOLO; YOLO('yolo11n.pt')"

Step 5 โ€” Verify Installation

python main.py --mode benchmark

๐Ÿ“ฆ Dataset Setup

CARLA โ€” No dataset download needed

The CARLA simulator generates synthetic sensor data in real-time. Start the server and the system auto-collects training data.

Optional: Pre-trained Sign Classifier

For enhanced traffic-sign classification, train the CNN on:

Dataset Classes Link
German Traffic Sign (GTSRB) 43 Kaggle
LISA Traffic Sign Dataset 47 UCSD
# Prepare dataset
mkdir -p datasets/traffic_signs
# Download and extract to datasets/traffic_signs/
# Expected structure:
#   datasets/traffic_signs/
#     train/  (class_0/, class_1/, ...)
#     val/
#     test/

Train the sign classifier:

python scripts/train_sign_classifier.py \
  --data datasets/traffic_signs \
  --epochs 50 \
  --output models/sign_classifier.pt

๐Ÿš€ Running the System

1. Start CARLA Server (separate terminal)

# Linux
cd /opt/carla
./CarlaUE4.sh -carla-server -fps=20 -ResX=1280 -ResY=720

# Windows
CarlaUE4.exe -carla-server -fps=20

2. Rule-Based Agent

# Default straight road scenario
python main.py --mode rule --scenario STRAIGHT_ROAD

# Urban traffic scenario
python main.py --mode rule --scenario DENSE_URBAN --steps 3000

# Night driving
python main.py --mode rule --scenario NIGHT_DRIVING --device cuda

3. RL Agent Inference

python main.py --mode rl \
  --model models/ppo_autonomous_driver_final \
  --scenario INTERSECTION

4. All 5 Scenarios (Sequential)

for SCENARIO in STRAIGHT_ROAD INTERSECTION PEDESTRIAN_CROSS DENSE_URBAN NIGHT_DRIVING; do
  python main.py --mode rule --scenario $SCENARIO --steps 1000
done

๐Ÿง  Training the RL Agent

# Quick training (testing)
python main.py --mode train --timesteps 50000 --scenario STRAIGHT_ROAD

# Full training
python main.py --mode train --timesteps 500000 --scenario DENSE_URBAN

# OR via the training script directly (more options)
python rl_agent/train.py \
  --timesteps 500000 \
  --scenario INTERSECTION

# Resume from checkpoint
python rl_agent/train.py \
  --resume models/ppo_autonomous_driver_100000_steps.zip \
  --timesteps 400000

# Monitor with TensorBoard
tensorboard --logdir results/rl_logs

Reward Function

Event Reward
Lane keeping (offset < 0.5 m) +1.0
Progress toward destination +2.0 ร— delta
Speed compliance +0.5
Smooth steering +0.2
Collision โˆ’5.0 + episode end
Lane departure โˆ’3.0
Accident (major) โˆ’10.0

๐Ÿ“Š Evaluation

# Evaluate all 5 scenarios (5 episodes each)
python main.py --mode eval \
  --model models/ppo_autonomous_driver_final \
  --episodes 5

# Evaluate single scenario
python rl_agent/evaluate.py \
  --model models/ppo_autonomous_driver_final \
  --scenario INTERSECTION \
  --episodes 10

# Perception latency benchmark
python main.py --mode benchmark

# View results
cat results/evaluation_report.json

Evaluation output: results/evaluation_report.json, results/evaluation_metrics.csv,
results/episode_details.csv


๐Ÿ“บ Dashboard Usage

streamlit run dashboard/app.py
# Opens at http://localhost:8501

Dashboard Features

Panel Content
Live Feed Front camera with lane + detection overlays
Speed Gauge Real-time speedometer (0โ€“120 km/h)
Steering Gauge Steering angle indicator (ยฑ1.0)
Warning Panel AEB, collision, lane departure, overspeed alerts
Drive State Current FSM state (CRUISING / EMERGENCY_BRAKE / ...)
Metrics Tab Rolling speed, steer, reward, FPS time-series charts
Detections Tab Live detection table + class distribution chart
Evaluation Tab Loaded evaluation report with scenario bar charts
System Info Tab Architecture overview, quick-start guide

๐Ÿ“ˆ Evaluation Metrics

Metric Formula Target
Collision Rate Collisions / episode < 0.1
Lane Keeping Accuracy Steps within 0.5m / total steps > 85%
Success Rate Episodes without collision & > 80% route > 70%
Route Completion Steps completed / max steps > 80%
Average Speed Mean speed (km/h) during episode โ‰ˆ cruise target
Inference Latency Per-module forward pass (ms) < 50ms/frame
Detection mAP YOLO mAP@0.5 on test set > 0.75

๐Ÿ“ Project Structure

autonomous_driving/
โ”‚
โ”œโ”€โ”€ perception/                 # Sensing & interpretation
โ”‚   โ”œโ”€โ”€ lane_detection.py       # Hough-transform lane detector
โ”‚   โ”œโ”€โ”€ object_detection.py     # YOLOv11 multi-class detector
โ”‚   โ”œโ”€โ”€ traffic_sign_detection.py # YOLO + CNN sign classifier
โ”‚   โ””โ”€โ”€ depth_estimation.py    # MiDaS monocular depth
โ”‚
โ”œโ”€โ”€ planning/                   # Intelligence layer
โ”‚   โ”œโ”€โ”€ decision_engine.py      # Rule-based priority engine
โ”‚   โ”œโ”€โ”€ behavior_planner.py     # FSM behavior planner
โ”‚   โ””โ”€โ”€ path_planner.py         # A* + Pure Pursuit planner
โ”‚
โ”œโ”€โ”€ control/                    # Actuation
โ”‚   โ”œโ”€โ”€ pid_controller.py       # Generic PID controller
โ”‚   โ””โ”€โ”€ steering_control.py     # Steering + Throttle + AEB
โ”‚
โ”œโ”€โ”€ simulation/                 # CARLA interface
โ”‚   โ”œโ”€โ”€ carla_env.py            # Gymnasium environment
โ”‚   โ””โ”€โ”€ sensors.py              # Sensor manager
โ”‚
โ”œโ”€โ”€ rl_agent/                   # Reinforcement learning
โ”‚   โ”œโ”€โ”€ train.py                # PPO training pipeline
โ”‚   โ””โ”€โ”€ evaluate.py             # Evaluation & benchmarking
โ”‚
โ”œโ”€โ”€ dashboard/                  # Monitoring
โ”‚   โ””โ”€โ”€ app.py                  # Streamlit dashboard
โ”‚
โ”œโ”€โ”€ configs/
โ”‚   โ””โ”€โ”€ config.yaml             # Central configuration
โ”‚
โ”œโ”€โ”€ models/                     # Trained weights
โ”œโ”€โ”€ datasets/                   # Training data
โ”œโ”€โ”€ results/                    # Logs, reports, checkpoints
โ”‚
โ”œโ”€โ”€ main.py                     # System orchestrator + CLI
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ README.md

๐Ÿ”ฎ Future Improvements

  • Semantic Segmentation โ€” Replace Hough lanes with DeepLabV3+/SegFormer drivable-area mask
  • Transformer Perception โ€” DETR / BEVFormer for multi-view object detection
  • Multi-Camera Fusion โ€” 360ยฐ surround-view with BEV projection
  • LiDAR Integration โ€” PointPillar / VoxelNet for LiDAR object detection
  • HD Map Integration โ€” OpenDRIVE map parsing for precise path planning
  • V2X Communication โ€” Vehicle-to-infrastructure signal simulation
  • Driver Monitoring โ€” Drowsiness / distraction detection
  • Imitation Learning โ€” Pre-training from expert CARLA demonstrations
  • Uncertainty Estimation โ€” Bayesian detection confidence for safety
  • Real-world Deployment โ€” ROS2 + Autoware.Universe integration

๐Ÿ“š References

  1. Dosovitskiy et al. (2017) โ€” CARLA: An Open Urban Driving Simulator
  2. Redmon et al. โ€” YOLO: Real-Time Object Detection
  3. Ranftl et al. (2021) โ€” Vision Transformers for Dense Prediction (MiDaS)
  4. Schulman et al. (2017) โ€” Proximal Policy Optimization
  5. Coulter (1992) โ€” Pure Pursuit Path Tracking
  6. Hart, Nilsson, Raphael (1968) โ€” A* Search Algorithm

๐Ÿ‘จโ€๐Ÿ’ป Author

Built as an AI/Autonomous Systems Internship Capstone Project.
Demonstrates mastery of: deep learning ยท computer vision ยท robotics ยท reinforcement learning ยท simulation ยท software engineering.

Tech Stack: Python ยท PyTorch ยท OpenCV ยท Ultralytics YOLOv11 ยท MiDaS ยท Stable-Baselines3 ยท CARLA ยท Streamlit ยท NumPy ยท Pandas


โญ Star this repo if it helped you! ยท ๐Ÿด Fork it for your own project

Resources

GitHub data synced 25 Oct 2026