Making an ESP32-based quadcopter from scratch
Python arduinoautopilotcontrol-theorydroneesp32flight-controlflight-controllermavlinkquadcopterquadcopter-firmwareuav
Add timeout parameter for pyflix constructor
Oleg Kalacheva77f21353845
diff --git a/tools/pyflix/flix.py b/tools/pyflix/flix.pyindex b03bbcf..c9b3b1d 100644--- a/tools/pyflix/flix.py+++ b/tools/pyflix/flix.py@@ -44,7 +44,7 @@ class Flix:_print_buffer: str = ''_modes = ['RAW', 'ACRO', 'STAB', 'AUTO']- def __init__(self, system_id: int=1, wait_connection: bool=True, device=os.getenv('FLIX_DEVICE')):+ def __init__(self, system_id: int=1, wait_connection: bool=True, timeout: Optional[float]=None, device=os.getenv('FLIX_DEVICE')):if not (0 <= system_id < 256):raise ValueError('system_id must be in range [0, 255]')self._setup_mavlink()@@ -74,7 +74,7 @@ class Flix:self._heartbeat_thread = Thread(target=self._send_heartbeat, daemon=True)self._heartbeat_thread.start()if wait_connection:- self.wait('mavlink.HEARTBEAT')+ self.wait('mavlink.HEARTBEAT', timeout=timeout)time.sleep(0.6) # give some time to receive initial statedef _init_state(self):