refactor(01-06): split core/mavlink.py into components/mavlink_io

- Extract MAVLinkBridge + 3 private helpers to pymavlink_bridge.py (455 LOC)
- Extract MockMAVConnection to mock_mavlink.py (30 LOC)
- Replace core/mavlink.py with shim re-exporting all names including
  _confidence_to_fix_type, _eskf_to_gps_input, _unix_to_gps_time
- Update components/mavlink_io/__init__.py with full public surface
- 216 tests pass (regression floor maintained)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Yuzviak
2026-05-11 08:49:51 +03:00
parent 4c65770702
commit f965ac74f9
4 changed files with 529 additions and 479 deletions
@@ -0,0 +1,30 @@
"""No-op MAVLink connection used in dev/CI (pymavlink absent).
Extracted from gps_denied/core/mavlink.py (Plan 01-06).
The legacy import path (gps_denied.core.mavlink) re-exports this class.
"""
from __future__ import annotations
class MockMAVConnection:
"""No-op MAVLink connection used when pymavlink is not installed."""
def __init__(self):
self._sent: list[dict] = []
self._rx_messages: list = []
def mav(self):
return self
def gps_input_send(self, *args, **kwargs) -> None: # noqa: D102
self._sent.append({"type": "GPS_INPUT", "args": args, "kwargs": kwargs})
def named_value_float_send(self, *args, **kwargs) -> None: # noqa: D102
self._sent.append({"type": "NAMED_VALUE_FLOAT", "args": args, "kwargs": kwargs})
def recv_match(self, type=None, blocking=False, timeout=0.1): # noqa: D102
return None
def close(self) -> None:
pass