How mwasifanwar/autodrive-sim works
Project Type and Purpose
• This is an end-to-end autonomous driving simulation framework (“autodrive-sim”) that integrates perception, planning, and control modules atop a realistic driving environment.
• It supports reinforcement-learning-based control and classical control strategies to develop and evaluate self-driving policies.
High-Level File-Structure Analysis
• Top-level directories:
• control: PID and MPC controllers plus a generic controller API
• environment: car dynamics, traffic simulator, overall simulator
• perception: detector, lane detection, segmentation, tracker
• planning: behavior, motion, path planners
• rl: RL agents (DQN, PPO, TD3) and base Agent class
• scripts: CLI entry points for training, evaluation, benchmarking, demo
• utils: configuration, logging, visualization helpers
• Key config: requirements.txt, setup.py, utils/config.py
• Patterns: modular separation of sensing→planning→actuation, pluggable RL vs. classical controllers, sim environment boundary.
README Insights
• Emphasizes “realistic simulation environment” and plug-and-play of perception, planning, and control using both RL and computer-vision methods.
1. Simulator Environment
– CarDynamics
– TrafficSimulator
– Visualizer (from utils/visualization)
2. Perception Module
– Image/State Input
– Detector, LaneDetection, Segmentation, Tracker
3. Planning Module
– BehaviorPlanner
– PathPlanner
– MotionPlanner
4. Control Module
– PIDController
– MPCController
– Controller interface
5. RL Agent
– Base Agent + DQN, PPO, TD3 implementations
6. Utilities & Scripts
– Config Loader
– Logger
– Training/Evaluation Scripts (train.py, evaluate.py, demo.py, etc.)
• Simulator → raw sensor data (images, states) → Perception
• Perception → environmental representation (objects, lanes, occupancy) → Planning
• Planning → trajectory/waypoints → Control
• Control → actuator commands → Simulator
• For RL training: Simulator ←→ RL Agent (state, reward, next state, done)
• Scripts orchestrate end-to-end runs, training loops, evaluation loops
c. Architectural Patterns & Principles:
• Modular pipeline (Sensing → Perception → Planning → Control)
• Pluggable controllers and planners adhering to common interfaces
• Separation of concerns between classical control and RL-based policies
• Config-driven instantiation (via utils/config.py)
d. Key Technologies & Libraries:
• Python (core language)
• Reinforcement Learning algorithms: DQN, PPO, TD3
• Simulation components (custom)
• Common tooling: logging, visualization, config management