Implemented a major architectural refactor of the C-SHENRON radar engine to achieve physically stable, context-independent detections.
1. Physics Engine Refactor (Iteration 16):
- Sceneset.py: Replaced global 1/N normalization with a fixed Area-Density Integration model. This prevents Energy Starvation where buildings previously suppressed car detections.
- Gaussian Damping: Integrated a 20 deg vertical beamwidth profile to physically suppress tree-top clutter while preserving boresight targets.
- ConfigureRadar.py: Standardized hardware profiles with calibrated 110dB gain and removed Iteration 15 bandages.
2. Repository Reorganization:
- Moved analysis and verification scripts to a new scripts/analysis/ directory.
- Updated path resolution in moved scripts to ensure project-wide stability.
3. Documentation & Metrology:
- Created 3D vertical energy suppression.md detailing the Resolution Independence breakthrough.
- Updated Shenron_debug.md with Iterations 14-16, recording a +234% Target Magnitude recovery.
- Updated Shenron_Debug_Plan.md and possible_issue_resolution.md to reflect resolved technical blockers.
## 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