From b9d1f6361e361fd8ac66debea6704caf15b2d98b Mon Sep 17 00:00:00 2001 From: arsen Date: Mon, 18 May 2026 13:02:30 +0700 Subject: [PATCH] =?UTF-8?q?feat(mmwave):=20dual-source=20vital=20signs=20(?= =?UTF-8?q?WiFi-CSI=20=F0=9F=93=B6=20vs=20mmWave=20=F0=9F=93=A1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously only WiFi-CSI produced breathing/HR estimates. With the HLK-LD2402 radar wired up we can compute a second, physically independent breathing estimate from chest-induced cm flicker in the distance time-series β€” a useful cross-check that catches the case when one modality is blind (e.g. WiFi-CSI when nodes are offline, or mmWave when nothing's in the radar's field of view). mmwave.rs: - Plumb a per-reading VitalSignDetector tuned for the module's 6 Hz Normal-Mode cadence (Nyquist 3 Hz comfortably covers the 0.1-0.5 Hz breathing band). - Distance (cm) feeds the detector as the "amplitude" channel; phase is empty so heartbeat falls back to amplitude residual. - Gate `current_vitals()` on data freshness so a disconnected radar doesn't return stale cached BPMs. main.rs: - New GET /api/v1/mmwave/vitals returning the same shape as /api/v1/vital-signs plus buffer status for UI warm-up feedback. ui/raw.html: - Each vital pill now shows both πŸ“Ά (WiFi-CSI) and πŸ“‘ (mmWave) values side-by-side, separated by `|`. mmWave HR is labelled "n/a" β€” cm precision at 6 Hz puts heartbeat below the noise floor. Buffer fill (e.g. "120/180") shown while detector is warming up so the operator knows BPM is on the way. Co-Authored-By: Claude Opus 4.7 --- ui/raw.html | 77 ++++++++++++++++--- .../wifi-densepose-sensing-server/src/main.rs | 31 ++++++++ .../src/mmwave.rs | 52 +++++++++++++ .../static/raw.html | 77 ++++++++++++++++--- 4 files changed, 215 insertions(+), 22 deletions(-) diff --git a/ui/raw.html b/ui/raw.html index f91dbd22..fe6f6a3a 100644 --- a/ui/raw.html +++ b/ui/raw.html @@ -48,22 +48,25 @@ last: -- absent CV 0% - + - 🫁 β€” BPM - Π½ΠΎΡ€ΠΌΠ° 12–20 - Β· + title="Breathing rate, two sources: πŸ“Ά = WiFi-CSI bandpass 0.1-0.5 Hz (ADR-021). πŸ“‘ = HLK-LD2402 mmWave distance bandpass (ADR-121). Adult-at-rest norm: 12-20 BPM. Below 12 = bradypnea, above 20 = tachypnea."> + 🫁 πŸ“Άβ€” BPMΒ· + | + πŸ“‘β€” BPMΒ· + Π½ΠΎΡ€ΠΌΠ° 12–20 - πŸ’“ β€” BPM - Π½ΠΎΡ€ΠΌΠ° 60–100 - Β· + title="Heart rate, two sources: πŸ“Ά = WiFi-CSI bandpass 0.8-2.0 Hz (ADR-021). πŸ“‘ = HLK-LD2402 mmWave (cm precision and 6 Hz cadence put heartbeat below the noise floor β€” value shown for transparency, expect low confidence). Adult-at-rest norm: 60-100 BPM."> + πŸ’“ πŸ“Άβ€” BPMΒ· + | + πŸ“‘β€” BPMΒ· + Π½ΠΎΡ€ΠΌΠ° 60–100