@ -9,32 +9,49 @@ This document is the consolidated source of truth for AI agents working on the F
**Objective:** A modular, scenario-driven simulation framework built on CARLA 0.9.16 for demonstrating structured ADAS driving scenarios with multi-modal sensor data.
**Objective:** A modular, scenario-driven simulation framework built on CARLA 0.9.16 for demonstrating structured ADAS driving scenarios with multi-modal sensor data.
- **Outcome:** The simulation now correctly models how energy drops over distance, allowing for realistic sensitivity-threshold testing.
- **Outcome:** The simulation now correctly models how energy drops over distance, allowing for realistic sensitivity-threshold testing.
### 🧩 The Stage-Based Pipeline (Fox v1.1 "Ares")
As the repository grew, the monolithic `main.py` became a maintenance hazard.
**The Refactor:** In v1.1, we transitioned to a **Modular Stage Architecture**.
- **Decision:** Encapsulated Simulation, Radar Synthesis (Shenron), and Data Export (MCAP) into discrete `PipelineStage` classes.
- **The "Why":** This allows for selective execution (e.g., re-running MCAP on old data) and ensures that failures in one stage (like a Shenron crash) don't corrupt the raw simulation data.
- **Outcome:** Reduced `main.py` complexity by 85% and enabled robust background resource management.
### 🖥️ GPU Resource Control (Idle Mode)
### 🖥️ GPU Resource Control (Idle Mode)
The Shenron engine is heavy. Running it alongside a 30 FPS CARLA simulation causes thermal throttling.
The Shenron engine is heavy. Running it alongside a 30 FPS CARLA simulation causes thermal throttling.
**The Fix:** We implemented **"Idle Mode."**
**The Fix:** We implemented **"Idle Mode."**
@ -122,7 +129,21 @@ After 30 iterations of parameter tuning, we identified the fundamental reason fo
- **Architecture**: Completed the full refactor to a modular stage-based pipeline. Isolated `SimulationStage`, `ShenronStage`, and `McapStage`.
- **Logic**: Centralized all radar physics and ADAS metrology in `src/processing/physics.py`.
- **Robustness**: Migrated all path resolution to `Pathlib` to fix the `stop.flag` detection bug and ensure cross-platform compatibility.
- **Sync**: Achieved 100% feature parity between the simulation pipeline and `test_shenron.py` diagnostics.
- **Metrology**: Integrated `FastHeatmapEngine` for stateful rendering, dual RA plots (Static vs. Dynamic), and hardware-specific 3D FOV frustum wireframes.
- **UX**: Bumped Dashboard version to v1.1.
### **April 22**
- **Task**: Radar Visualization Modularization.
- **Action**: Extracted all plotting and scan-conversion logic from `data_to_mcap.py` into a reusable `sim_radar_utils/plots.py` module.
- **UX**: Implemented `FastHeatmapEngine` to enable high-speed diagnostic rendering without UI blocking.
@ -58,7 +58,15 @@ When the `/api/run` endpoint is hit:
4. **Event Streaming (Yield):**
4. **Event Streaming (Yield):**
Instead of waiting for the process to return an exit code, Flask uses a specific Python generator (`def generate():`) paired with a standard `Response(mimetype="text/event-stream")`.
Instead of waiting for the process to return an exit code, Flask uses a specific Python generator (`def generate():`) paired with a standard `Response(mimetype="text/event-stream")`.
As `process.stdout.readline()` pulls new text from the unbuffered stream, Flask yields it to the browser wrapped in `data: ... \n\n` syntax. The JS EventSource catches these fragments and appends them to the `<div id="console">` log box.
As `process.stdout.readline()` pulls new text from the unbuffered stream, Flask yields it to the browser.
**Visual Feedback Tags:**
The dashboard JS (`app.js`) specifically listens for bracketed tags to drive UI components:
- `[FRAME X/Y]`: Drives the primary simulation progress bar.
- `[SHENRON_INIT]`: Sends hardware specs (GPU, VRAM) to the Telemetry HUD.
- `[SHENRON_STEP]`: Drives the secondary "Synthesis" progress bar and real-time signal metrics (SNR, Pts).
- `[AUTO-MCAP]`: Signals the transition to the final data serialization phase.
- `[PROCESS_COMPLETED]`: Triggers the final cleanup and re-enables the "Launch" button.