This commit marks the completion of the Iteration 13 'Golden Mix' calibration.
- intel/: Structured documentation into /radar, /scenarios, and /internal subfolders.
- Shenron_debug.md: Comprehensive history of all 13 calibration iterations.
- radar_processor.py: Implemented Blackman-Harris windowing for sidelobe suppression.
- lidar.py: Applied -2.0m parallax shift and ground suppression filtering.
- Sceneset.py: Calibrated specular thresholds and material roughness for stability.
This commit introduces a Flask-based web dashboard for the BATL CARLA orchestrator
and hardens the underlying data processing pipeline to support real-time UI tracking.
Dashboard & GUI:
- Added `dashboard/` directory containing the Flask backend (`app.py`), HTML UI,
and static assets (CSS/JS) for a seamless browser-based simulation controller.
- Created `dashboard.bat` to launch the web dashboard environment.
Pipeline Stability (Unbuffered Streaming):
- `run.bat`: Forced `PYTHONUNBUFFERED=1` to ensure subprocess stdout/stderr
is immediately available.
- `dashboard/app.py`: Injected the unbuffered environment flag into `subprocess.Popen`
to prevent the UI console from freezing during heavy post-processing tasks.
- `src/recorder.py` & `data_to_mcap.py`: Appended `flush=True` to stdout prints
to guarantee immediate log propagation to the web dashboard text stream.
Foxglove Data Integrity:
- `data_to_mcap.py`: Hardened internal JSON schemas (`foxglove.Pose`,
`foxglove.CompressedImage`, `foxglove.PointCloud`) by adding `$schema`, `$id`,
and `title` metadata tags over draft-2020-12. This prevents Foxglove Studio from
attempting internet CDN lookups, fully resolving the "Unable to parse ok response
body as json" crashes when importing local MCAP sets.
- Updated context.md with new CLI, framework contracts, and Z-axis safety rules
- Added .cursorrules to codify PowerShell and environment requirements
- Added braking.md deep-dive post-mortem on spawning challenges
- Formally marked scenario parameterization as a core feature
Expanded object state to include physical (acceleration), geometric (bounding boxes),
and relative ADAS metrics (range, azimuth, closing velocity) for vehicles and pedestrians.
## Summary
First commit of the Fox CARLA simulation pipeline. Establishes a fully working,
end-to-end ADAS data collection and visualization system built on CARLA 0.9.16.
---
## What is included
### Core Pipeline
- Multi-sensor synchronous simulation (Camera, Radar, LiDAR) at configurable FPS
- Frame-aligned sensor data captured using CARLA synchronous mode with fixed delta time
- Structured dataset output: PNG images, NPY arrays, JSONL metadata per frame
- MCAP conversion script producing Foxglove-compatible topics (/camera, /lidar, /radar, /ego_pose)
- Ground truth vehicle tracking embedded in every frame record
### Modular Scenario Architecture
- Abstract ScenarioBase plugin interface (setup / step / cleanup lifecycle)
- Dynamic scenario loader via importlib main.py never imports scenarios by name
- Three implemented ADAS test scenarios:
- braking : Lead vehicle hard braking (emergency stop at configurable frame)
- cutin : Adjacent lane NPC forced lane change into ego lane
- obstacle : Static traffic cone placed on ego lane
- All NPC placement via CARLA waypoints zero hardcoded world coordinates
- Scenario metadata embedded into every JSONL frame record for MCAP traceability
### Orchestrator (src/main.py)
- Fully scenario-agnostic scenarios selected via --scenario CLI flag
- Supports --frames override for quick test runs without editing config
- Supports --list-scenarios for dry-run discovery (no CARLA server required)
- Deferred CARLA import so the process works without a live server for non-simulation commands
### Configuration (config.py)
- Single source of truth for all simulation, sensor, and scenario constants
- Scenario trigger frames and distances fully configurable without code changes
### Recorder (src/recorder.py)
- Session folders named <scenario>_YYYYMMDD_HHMMSS for easy identification
- extra_meta parameter merges scenario state into every frame record automatically
### Developer Tooling
- run.bat: one-click launcher that activates the carla312 conda environment
- intel/context.md: comprehensive AI-agent and developer reference document
- .gitignore: excludes data/, *.mcap, __pycache__, logs/, *.pyc
---
## Architecture
src/main.py (orchestrator)
|-- scenario_loader.py (importlib-based dynamic loader)
|-- sensors.py (SensorManager: camera + radar + lidar)
|-- recorder.py (per-frame data writer)
scenarios/
|-- base.py (ScenarioBase ABC)
|-- braking.py (BrakingScenario)
|-- cutin.py (CutInScenario)
|-- obstacle.py (ObstacleScenario)
config.py (all constants)
data_to_mcap.py (dataset -> MCAP converter)
run.bat (conda env launcher)
intel/context.md (codebase reference)
---
## Usage
run.bat braking
run.bat cutin --frames 120
run.bat obstacle
python data_to_mcap.py
---
## Environment
- CARLA 0.9.16
- Python conda env: carla312 (miniconda)
- Key deps: carla, numpy, opencv-python, mcap
---
## Known Limitations (future work)
- MCAP uses JSON encoding (functional; Protobuf migration planned)
- Intersection scenario not yet implemented (requires junction-aware waypoint logic)
- Single ego vehicle assumed throughout
- Foxglove layout presets not yet defined