Transitioned the Shenron radar engine from a rigid architecture to a modular,
tunable "Knobs and Dials" framework. This update establishes a physics-first
baseline derived from real-world electromagnetic behavior.
Core Changes:
- Modular Radar Profiles: Pre-configured profiles for TI Cascade, Radarbook,
and AWRL1432 with hardware-specific Bandwidth, Chirp, and nRx parameters.
- Physics Core (Sceneset.py):
- Full implementation of Fresnel and Beckmann-Spizzichino scattering.
- Pure 1/R^4 power law (1/R^2 transmit, 1/R^2 receive) via legacy scaling removal.
- Fixed cos(cos(theta)) bug in CARLA semantic lidar mapping.
- Antenna Gain Integration:
- Implemented separable Azimuth/Elevation gain patterns.
- Added Symmetric Azimuth LUT interpolation and Vertical FOV Hard Cutoff.
- Signal Processing:
- Optimized GPU-accelerated signal synthesis using PyTorch.
- Standardized 110 dB System Calibration Constant for hardware SNR matching.
Architecture & Documentation (intel/radar):
- Reorganized radar intel directory into structured subfolders (core, research,
diagnostics, archive) for better scalability.
- Added SHENRON_MODULAR_ARCHITECTURE.md (System overview).
- Added SHENRON_ANTENNA_GAIN_CALIBRATION.md (Gain physics deep-dive).
- Modernized package README with Windows/Conda specific usage instructions.
- Synchronized all internal and external documentation links.
Calibration: Iteration 18 (Antenna Gain Baseline)
Note: Remaining magic numbers in get_loss_3 are noted for future migration.
Transitioned the Shenron radar engine from a rigid architecture to a modular,
tunable "Knobs and Dials" framework. This update establishes a physics-first
baseline derived from real-world electromagnetic behavior.
Core Changes:
- Modular Radar Profiles: Pre-configured profiles for TI Cascade, Radarbook,
and AWRL1432 with hardware-specific Bandwidth, Chirp, and nRx parameters.
- Physics Core (Sceneset.py):
- Full implementation of Fresnel and Beckmann-Spizzichino scattering.
- Pure 1/R^4 power law (1/R^2 transmit, 1/R^2 receive) via legacy scaling removal.
- Fixed cos(cos(theta)) bug in CARLA semantic lidar mapping.
- Antenna Gain Integration:
- Implemented separable Azimuth/Elevation gain patterns.
- Added Symmetric Azimuth LUT interpolation and Vertical FOV Hard Cutoff.
- Signal Processing:
- Optimized GPU-accelerated signal synthesis using PyTorch.
- Standardized 110 dB System Calibration Constant for hardware SNR matching.
Additional Documentation:
- intel/radar/SHENRON_MODULAR_ARCHITECTURE.md: Architecture and "Knobs/Dials" overview.
- intel/radar/SHENRON_ANTENNA_GAIN_CALIBRATION.md: Physics of Antenna Gain and 1/R^4 logic.
Note: Remaining magic numbers in get_loss_3 (K_sq, scat_normalization, lobe_frac)
are noted for future migration into ConfigureRadar.py.
- Optimized dashboard polling (3s) and suppressed noisy terminal status logs.
- Implemented collapsible 'Configuration Parameters' card with localStorage persistence.
- Overhauled dashboard theme for high-contrast accessibility and element visibility.
- Initialized intel/CHRONICLES.md to document project saga and technical breakthroughs.
- Established intel/memory_update.md protocol for automated repository memory updates.
Restores high-fidelity physical realism to the C-Shenron radar engine by
aligning the synthesis pipeline with the pure Radar Range Equation.
Core Improvements:
- Physics: Restored 1/R^4 power-delay law (1/R^2 voltage) in Sceneset.py
and heatmap_gen_fast.py. Stripped legacy 1/1000 normalizations and
R^2 area-growth workarounds.
- Geometry: Fixed FFT index asymmetry in radar_processor.py, achieving a
perfectly symmetric 120° FOV sector.
- Metrology: Implemented "Radar Blue" (Viridis) 120° fan-projection for
diagnostic Range-Azimuth heatmaps.
- Automation: Integrated RD/RA/CFAR heatmap persistence into the
automated simulation-to-MCAP pipeline (data_to_mcap.py).
- Docs: Comprehensive update of intel/ directory, including Iterations 17-26
and the Physics/Symmetry Milestone deep-dive.
This milestone ensures that target brightness and spatial positioning
correctly mimic real-world TI AWRL1432 radar hardware.
- Engine: Modified CFAR and Processor to extract raw Range-Doppler and Range-Azimuth energy heatmaps.
- Visuals: Integrated high-fidelity Matplotlib colormapping (Viridis/Magma) for Foxglove image streaming.
- Data: Implemented 32-bit raw .npy persistence and JSONL telemetry for frame-level SNR analysis.
- Tools: Added a dedicated verification utility for end-to-end signal flow validation.
- Docs: Comprehensive documentation for the new 'Radar Lab' architecture in /intel/.
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.
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
This commit represents a major architectural upgrade to the CARLA ADAS simulation project, transitioning from stochastic Traffic Manager behavior to a fully deterministic, high-impact demo environment.
1. Deterministic Scenario Architecture
New Showcase Scenario: Implemented
scenarios/showcase.py
for a manual "Left-Turn Across Path" (LTAP) maneuver.
Physics Velocity Injection: Overrode engine/friction variance by directly setting set_target_velocity for NPC actors at 35 km/h.
Multi-Stage Waypoint Guidance: Integrated EGO_MID and P1_MID transition points to ensure realistic, cinematic turning radii and reliable collision-avoidance timing.
Manual Steering Controller: Developed a proportional steering-to-target helper for all actors.
2. Sensor & Data Pipeline
Dual-Camera Support: Integrated a second Third-Person Perspective (TPP) camera.
Radar Serialization Fix: Implemented trigonometric conversion of raw spherical coordinates (Depth, Azimuth, Altitude) into Cartesian XYZ + Velocity 16-byte PointClouds for Foxglove Studio.
Synchronization: Aligned all sensor data (Dash Cam, TPP Cam, Radar, Lidar) at the orchestrator level.
3. Performance & Asynchronous I/O
Asynchronous Recorder: Refactored
src/recorder.py
to use ThreadPoolExecutor, offloading cv2.imwrite operations to background threads to eliminate simulation stutter.
Rapid Iteration: Added --no-record global flag to
main.py
for sub-second iteration during coordinate tuning.
4. Automation & Seamless UX
Auto-MCAP conversion: Integrated
data_to_mcap.py
as a post-simulation callback in
main.py
.
Auto-Video Stitching: Implement automatic .mp4 generation for both camera views using OpenCV's VideoWriter.
Weather/Time CLI: Added --weather flag with presets (Clear, Rain, Sunset, Night).
Console Sync: Integrated tqdm for professional progress tracking and refactored scenario logging to use pbar.write() to prevent terminal flickering/staircasing.
5. Dependency Updates
Added tqdm as a core dependency for enhanced console visualization.
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