How tonelliluca/lane_departure_warning_carla works
Project type and purpose
• This is an open-source, vision-based Lane Departure Warning (LDW) system built on the CARLA autonomous driving simulator. It’s not a traditional front-end/backend web app but rather a simulation-centric tool integrating real-time computer vision, messaging (MQTT), logging, and post-run analysis.
File structure
• Top-level directories:
• analysis: scripts and notebooks for post-run data processing and plotting.
• asciidoc: source for the system report (architecture, design, deployment).
• data: model weights (YOLOPv2).
• log: runtime performance logs organized by scenario.
• test_commands: JSON scenario definitions injected into CARLA.
• utils: core modules (YOLOP model wrapper, CARLA client, image cropper, logger).
• Key files:
• launcher.py: entry point that spins up CARLA, attaches sensors, kicks off the LDW pipeline.
• camera_lanes_analysis_sync.py / camera_lanes_analysis_async.py: two modes of running the vision pipeline.
• environment.yml / .env: environment and secret configuration (MQTT credentials).
• typings: type stubs for CARLA Python API.
• CI: .github/workflows/build-doc.yml to generate documentation.
README for additional insights
• Core features: real-time YOLOPv2 lane detection, warning generation, record/playback, MQTT publishing, performance logging, comparison with CARLA ground-truth.
• Tech stack: Python 3.7, PyTorch YOLOPv2, CARLA 0.9.15, HiveMQ MQTT, Conda environment.
• Camera → YOLOP → Warning → MQTT
• Performance metrics → File system → Analysis
• Blue for external systems (CARLA, HiveMQ)
• Green for core runtime modules (image processing, model inference, warning logic)
• Yellow for storage (weights, logs)
• Orange for post-run analysis and documentation