From 875642f512db3c8de1285c5f3ff0e1f1afbd9a78 Mon Sep 17 00:00:00 2001 From: Jason <83615043+JJassonn69@users.noreply.github.com> Date: Thu, 23 Apr 2026 07:38:46 +0545 Subject: [PATCH] =?UTF-8?q?fix(gui):=20GUI-C3=20=E2=80=94=20derive=20live-?= =?UTF-8?q?mode=20range/velocity=20resolution=20from=20waveform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RadarDataWorker (live capture path) was converting bin indices to physical units using RadarSettings placeholders (range_resolution=6.0, velocity_resolution=1.0). The 1.0 m/s velocity figure was a stub — the correct value at 167us PRI / 16-chirp sub-frame / 10.5 GHz carrier is ~5.34 m/s, so reported velocities were off by ~5.3x. ReplayWorker already used WaveformConfig.range_resolution_m and velocity_resolution_mps; this commit applies the same pattern to the live worker. WaveformConfig defaults match the AERIS-10 3 km mode parameters. A set_waveform() hook is provided so the dashboard can swap configs when range-mode switching is wired through. Verified: 83/83 v7 GUI tests pass. --- 9_Firmware/9_3_GUI/v7/workers.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/9_Firmware/9_3_GUI/v7/workers.py b/9_Firmware/9_3_GUI/v7/workers.py index 6bf115f..21219af 100644 --- a/9_Firmware/9_3_GUI/v7/workers.py +++ b/9_Firmware/9_3_GUI/v7/workers.py @@ -84,8 +84,16 @@ class RadarDataWorker(QThread): self._recorder = recorder self._gps = gps_data_ref self._settings = settings or RadarSettings() + # GUI-C3: derive range/velocity resolution from waveform parameters + # rather than the RadarSettings placeholders (1.0 m/s velocity was + # ~5.3x off for the 167us PRI / 16-chirp sub-frame at 10.5 GHz). + from .models import WaveformConfig + self._waveform = WaveformConfig() self._running = False + def set_waveform(self, wf) -> None: + self._waveform = wf + # Frame queue for production RadarAcquisition → this thread self._frame_queue: queue.Queue = queue.Queue(maxsize=4) @@ -180,8 +188,8 @@ class RadarDataWorker(QThread): # Extract detections from FPGA CFAR flags det_indices = np.argwhere(frame.detections > 0) - r_res = self._settings.range_resolution - v_res = self._settings.velocity_resolution + r_res = self._waveform.range_resolution_m + v_res = self._waveform.velocity_resolution_mps for idx in det_indices: rbin, dbin = idx