fix(sensing-server): person count hysteresis to stop flickering#295
Merged
fix(sensing-server): person count hysteresis to stop flickering#295
Conversation
The person-count heuristic was causing widespread flickering (#237, #249, #280, #292) because: 1. Threshold 0.50 for 2-persons was too low — multipath reflections in small rooms easily exceeded it 2. No actual hysteresis despite the comment claiming asymmetric thresholds 3. EMA smoothing (α=0.15) was too responsive to transient spikes Changes: - Raise up-thresholds: 1→2 persons at 0.65 (was 0.50), 2→3 at 0.85 (was 0.80) - Add true hysteresis with asymmetric down-thresholds: 2→1 at 0.45, 3→2 at 0.70 - Track prev_person_count in SensingState for state-aware transitions - Increase EMA smoothing to α=0.10 (~2s time constant at 20 Hz) - Update all 4 call sites (ESP32, Windows WiFi, multi-BSSID, simulated) Fixes #292, #280, #237 Co-Authored-By: claude-flow <ruv@ruv.net>
This was referenced Mar 24, 2026
Open
Help Ruvnet! Detection Window showing the same thing regardless of position and people in room.
#249
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
prev_person_countstate tracking — prevents oscillation at boundariesFixes #292 #280 #237
What was wrong
The
score_to_person_countfunction had no state — despite comments claiming "asymmetric thresholds," it was just flat threshold checks. With the 0.50 threshold for 2 persons, multipath reflections in rooms <10 m² routinely exceeded this, causing the person count to flicker between 1 and 2+. This was the #1 reported issue across multiple users with different hardware setups.Test plan
cargo check -p wifi-densepose-sensing-server --no-default-features— compiles clean🤖 Generated with claude-flow