mirror of
https://github.com/NawfalMotii79/PLFM_RADAR.git
synced 2026-06-10 07:27:23 +00:00
chore(repo): PR-S — m-1..m-9 hygiene sweep (audit cleanup)
Bundled minor-tier fixes from project_aeris10_audit_2026-05-02. No
behavioural changes to the production happy path; mostly stale comments,
defaults, and one new emit-path (m-9) that lets cosim_dir replay show
detections instead of an empty mask.
m-1 — processing.py:59 RadarProcessor.range_doppler_map placeholder
shape (1024, 32) -> (NUM_RANGE_BINS, NUM_DOPPLER_BINS) imported
from radar_protocol so the legacy literal stops leaking to
anything reading the attribute before frame 0.
m-2 — radar_receiver_final.v:596 stale "// 32" comment for
RP_CHIRPS_PER_FRAME -> "// 48 (PR-F: 3 sub-frames * 16)".
m-4 — radar_protocol.py "16384 x 2 = 32768" arithmetic comment was
already corrected by an earlier edit; verified clean.
m-5 — usb_data_interface_ft2232h.v:961 "Frame header: 8 bytes"
comment -> "9 bytes (PR-G: added version byte at offset 1)".
m-6 — radar_system_top.v cold-reset host_chirps_per_elev 32 -> 48
+ status doc-comment so any sanity-checking parser sees the
value matching RP_CHIRPS_PER_FRAME instead of latching a
chirps_mismatch_error.
m-7 — radar_receiver_final.v:370 RX DDC mixers_enable(1'b1)
annotated: documented as intentional asymmetry vs TX (counter-
UAS RX has no quiesce scenario; CDC would add cost without
operational benefit).
m-8 — RadarSettings range_resolution / velocity_resolution flagged
inline as PLACEHOLDER (docstring already explains; inline
marker makes it visible at the field).
m-9 — gen_realdata_hex.py now also emits fullchain_cfar_flags.npy
(uint8 detection mask) and fullchain_cfar_mag.npy (|I|+|Q|),
produced by run_cfar_ca() with the FPGA cold-reset defaults
(guard=2 train=8 alpha=0x30 mode=CA). Replays through
v7.replay's COSIM_DIR loader: 22 detections on the synthetic
scene (was 0). The hex/ directory's two new .npy files are
included in this commit.
Regression: 247/247 (test_v7 130 + test_GUI_V65_Tk 117). Ruff clean.
This commit is contained in:
@@ -121,8 +121,11 @@ class RadarSettings:
|
||||
not be relied on for physics-accurate display.
|
||||
"""
|
||||
system_frequency: float = 10.5e9 # Hz (carrier, used for velocity calc)
|
||||
range_resolution: float = 6.0 # Meters per range bin (c/(2*Fs)*decim = 1.5*4)
|
||||
velocity_resolution: float = 1.0 # m/s per Doppler bin (calibrate to waveform)
|
||||
# PLACEHOLDER — see class docstring. Live workers derive the real values
|
||||
# from WaveformConfig (per-subframe LONG/MEDIUM/SHORT v_res). Do not use
|
||||
# these literals for physics-accurate display.
|
||||
range_resolution: float = 6.0 # placeholder; legacy 1.5 m * decim=4
|
||||
velocity_resolution: float = 1.0 # placeholder; legacy 167 us / 16-chirp / 10.5 GHz
|
||||
max_distance: float = 3072 # Max detection range (m), 3 km mode
|
||||
map_size: float = 4000 # Map display size (m)
|
||||
coverage_radius: float = 3072 # Map coverage radius (m), 3 km mode
|
||||
|
||||
@@ -56,7 +56,11 @@ class RadarProcessor:
|
||||
"""Full radar processing pipeline: fusion, clustering, association, tracking."""
|
||||
|
||||
def __init__(self):
|
||||
self.range_doppler_map = np.zeros((1024, 32))
|
||||
# Placeholder shape matches production (NUM_RANGE_BINS x NUM_DOPPLER_BINS
|
||||
# = 512 x 48 from radar_protocol). Overwritten on every frame; pre-frame
|
||||
# readers see the correct shape rather than a legacy (1024, 32).
|
||||
from radar_protocol import NUM_RANGE_BINS, NUM_DOPPLER_BINS
|
||||
self.range_doppler_map = np.zeros((NUM_RANGE_BINS, NUM_DOPPLER_BINS))
|
||||
self.detected_targets: list[RadarTarget] = []
|
||||
self.track_id_counter: int = 0
|
||||
self.tracks: dict[int, dict] = {}
|
||||
|
||||
Reference in New Issue
Block a user