From c39b811a3ca61018d54501fce00f247a386846dd Mon Sep 17 00:00:00 2001 From: Matthias Guillitte Date: Sun, 23 Aug 2026 11:05:04 +0200 Subject: [PATCH] Lower noise buffer for ultrasonic ranger --- orchestrateur/main.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/orchestrateur/main.py b/orchestrateur/main.py index 6cfaf8b..0a1e041 100644 --- a/orchestrateur/main.py +++ b/orchestrateur/main.py @@ -817,16 +817,16 @@ async def monitor_dish_height_task(): if dist is not None: # Hysteresis Thresholds: - # - Must be > 2.5 cm to detect dish insertion - # - Must be < 1.2 cm to detect dish removal - if dist > 2.5: + # - Must be > 1.2 cm to detect dish insertion + # - Must be < 0.8 cm to detect dish removal + if dist > 1.2: consecutive_present += 1 consecutive_absent = 0 - elif dist < 1.2: + elif dist < 0.8: consecutive_absent += 1 consecutive_present = 0 else: - # Dead-zone (1.2cm to 2.5cm) -> Noise buffer + # Dead-zone (1.2cm to 0.8cm) -> Noise buffer consecutive_present = 0 consecutive_absent = 0 @@ -848,7 +848,7 @@ async def monitor_dish_height_task(): ir_data_cache.pop(mw_id, None) ir_data_events.pop(mw_id, None) - await asyncio.sleep(0.3) + await asyncio.sleep(0.7) # --- BOOTSTRAP --- async def main():