From 1b47ce124d51899d4800640a4719388aea822463 Mon Sep 17 00:00:00 2001 From: nicoboy Date: Sun, 21 Jun 2026 17:26:37 +0200 Subject: [PATCH] fix: drainer pymavlink dans le thread principal sans run_in_executor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit run_in_executor + blocking=False retournait None dans un thread séparé sans rien peupler dans mav.messages. Drain direct dans la boucle asyncio avec while recv_match() pour vider tout le buffer à chaque tick de 50ms. Co-Authored-By: Claude Sonnet 4.6 --- wireclaw_core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wireclaw_core.py b/wireclaw_core.py index 37aea78..240ae56 100644 --- a/wireclaw_core.py +++ b/wireclaw_core.py @@ -84,9 +84,9 @@ async def monitor_armed(drone): async def drain_pymavlink(): """Draine pymavlink en boucle pour peupler mav.messages (dernier msg par type).""" - loop = asyncio.get_running_loop() while True: - await loop.run_in_executor(None, lambda: mav.recv_match(blocking=False)) + while mav.recv_match(blocking=False) is not None: + pass await asyncio.sleep(0.05) async def monitor_telemetry(drone):