You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6.3 KiB
6.3 KiB
Shenron Radar Architecture Breakdown
This document provides a precise architectural analysis of the Shenron radar simulation pipeline, focusing on ownership, energy flow, and multi-radar extensibility.
🏗️ Radar Abstraction & Ownership
- Radar Instance Representation: Represented as a
radarclass inConfigureRadar.py. It is a configuration-heavy object containing both hardware specs (frequency, bandwidth) and physics parameters (beamwidth, gain). - Signal Generation Ownership: Each
ShenronRadarModel(inmodel_wrapper.py) own its ownradar_obj. The pipeline is private to the instance; radars share the input Semantic LiDAR but do not share intermediate artifacts like ADC cubes or calculated losses. - Metadata Storage: All sensor-specific metadata (mount pose, FOV, waveform, noise floor) is stored as attributes of the
radarclass. It is accessed by name (e.g.,radar_type='awrl1432') during model initialization. - Sequential vs Parallel: Processing is currently sequential. Within a single frame, the orchestrator iterates through defined radar profiles, generating one set of ADC samples and one point cloud at a time.
⚡ Energy Flow & Reuse
- Reflected Energy Stage: First computed in
Sceneset.pywithin theget_loss_3function. - Energy Form: Linear power (normalized unitless factor representing RCS + Path Loss).
- Storage Granularity: Stored per-point in a 1D array of length $N_{pts}$.
- Reuse vs Recompute: It is currently recomputed for every radar profile. Even if the points are identical,
get_loss_3is called fresh for each radar instance to account for radar-specific gains. - Radar-Agnostic Stages: Only the raw
semantic_lidar_dataingestion and the basic axis-swap inlidar.pyare truly radar-agnostic. Once the data entersCropped_forRadar, it becomes radar-dependent.
🌐 Coordinate Frames & Angular Knowledge
- Transformation Point: Points are transformed into radar-local coordinates in
lidar.pyinsideCropped_forRadarvia therotate_pointsfunction and mount-offset subtraction (e.g.,CARLA_X - 2.0). - Derived Quantities: Azimuth (
theta) and Elevation (elev_angle) are computed derivationally inspecularpoints()(Lines 221-222) before being passed to the loss function. They are not currently stored in the point structure. - Re-casting Rays: Points are represented in Cartesian XYZ; azimuth and elevation can be (and are) computed analytically without re-casting rays.
- Occlusion & Incidence: Occlusion is strictly radar-dependent (calculated from the
radar.centerviewpoint). Incidence angle is calculated relative to surface normals and is partially shared as it is scene-dependent, but its power-contribution is radar-dependent.
📉 Loss / Gain Modeling
- Modular Support: Modular support is limited. Code uses fixed functions (
get_loss_3); there is no plug-in architecture for gain blocks yet. - Application Relative Order: Applied in the following order: Range Loss ($1/R^2$ transmit) → Material Permittivity Loss → Surface Roughness Loss → Vertical Antenna Gain. Horizontal gain is currently missing.
- Mathematical Domain: Applied multiplicatively in linear space.
- Scaling Mechanism: Scaling is currently injected via the
radar.gainandradar.vertical_beamwidthproperties passed into the physics functions.
🛡️ Multi‑Radar Safety
- Shared Tick Structures: The incoming
semantic_lidar_datanumpy array is the primary shared structure. - Contamination Risk: Low.
lidar.pyandScenesetoperate on slices or copies (e.g.,skew_pc,new_pc). Internal modifications topc[:, 4]exist but usually target local copies. - Immutability: Not strictly enforced by Python, but the workflow treats the input LiDAR as a read-only source.
- Attribute Cloning: Introducing per-radar antenna loss would not require cloning the whole attribute list; it simply requires a new temporary array produced by the radar-specific loss function.
📡 ADC & Noise Injection
- Thermal Noise Stage: Added during the ADC synthesis in
heatmap_gen_fast.py(Line 146). It is added to the clean signal after beamforming. - ADC Sharing: Strictly per-radar. ADC cubes are not shared across profiles.
- SNR Variation: Easily introduced via the
radar.noise_ampproperty in the profile. - Power Preservation: Signal power and noise power are calculated separately and summed; they are not tracked as separate streams after summation.
⚙️ Configuration & Extensibility
- Profile Loading: Hardcoded Python classes/dictionaries in
ConfigureRadar.py. - Sensor LUTs: Existing precedent in
lidar.pyfor semantic-to-material mapping tables. - Radiation Patterns: Can be attached as scalar beamwidths (current) or arrays/LUTs (feasible).
- Runtime Switching: Fully supported via the
ShenronRadarModelwrapper.
🚀 Performance & Scaling
- Point Budget: 5,000 – 15,000 points per radar per frame (post-cropping).
- LUT Performance: Highly acceptable; NumPy vectorized lookups for material/angle coefficients are not a bottleneck.
- Memory Pressure: Low for point data. High for ADC cubes and large Range-Doppler FFT matrices if many radars run concurrently.
🐞 Validation & Debugging
- Logging Hooks: The
last_metrologydictionary inmodel_wrapper.pyserves as the primary hook for internal diagnostics. - Energy Annotation: The internal
lossarray is calculated but usually discarded; it is not currently appended to the return point cloud. - Comparison Hook: Radars can be compared frame-by-frame by running two model instances on the same
semantic_lidar_databuffer.
🔮 Future‑Proofing
- MIMO/Virtual Antennas: Logic lives in
heatmap_gen_fast.pyinside the torch-accelerated phase-delay loop. - Physics Separation: A partial separation exists.
Sceneset.pyis "Scene Physics" (Reflection/Scattering), whileConfigureRadar.pyis "Sensor Physics." - Antenna Pattern Logic: Logically belongs to the Sensor Model (
ConfigureRadar) but must be applied during the Scene Physics stage to attenuate incident rays before they become ADC signals.
Generated by Antigravity AI | Fox Radar ADAS Pipeline Architecture Review