Skip to content

armgit / flix

Public Imported from GitHub
0

Making an ESP32-based quadcopter from scratch

Drop messages from another systems in pyflix We shouldn't pass messages where system id != our system id. This change may be useful when there are many drones in one network.

Oleg Kalachev3631743a29a5
diff --git a/tools/pyflix/flix.py b/tools/pyflix/flix.py
index a12d25f..757ebfa 100644
--- a/tools/pyflix/flix.py
+++ b/tools/pyflix/flix.py
@@ -138,7 +138,7 @@ class Flix:
while True:
try:
msg: Optional[mavlink.MAVLink_message] = self.connection.recv_match(blocking=True)
- if msg is None:
+ if msg is None or msg.get_srcSystem() != self.system_id:
continue
self._connected()
msg_dict = msg.to_dict()