feat(phases 2-7): implement full GPS-denied navigation pipeline

Phase 2 — Visual Odometry:
  - ORBVisualOdometry (dev/CI), CuVSLAMVisualOdometry (Jetson)
  - TRTInferenceEngine (TensorRT FP16, conditional import)
  - create_vo_backend() factory

Phase 3 — Satellite Matching + GPR:
  - SatelliteDataManager: local z/x/y tiles, ESKF ±3σ tile selection
  - GSD normalization (SAT-03), RANSAC inlier-ratio confidence (SAT-04)
  - GlobalPlaceRecognition: Faiss index + numpy fallback

Phase 4 — MAVLink I/O:
  - MAVLinkBridge: GPS_INPUT 15+ fields, IMU callback, 1Hz telemetry
  - 3-consecutive-failure reloc request
  - MockMAVConnection for CI

Phase 5 — Pipeline Wiring:
  - ESKF wired into process_frame: VO update → satellite update
  - CoordinateTransformer + SatelliteDataManager via DI
  - MAVLink state push per frame (PIPE-07)
  - Real pixel_to_gps via ray-ground projection (PIPE-06)
  - GTSAM ISAM2 update when available (PIPE-03)

Phase 6 — Docker + CI:
  - Multi-stage Dockerfile (python:3.11-slim)
  - docker-compose.yml (dev), docker-compose.sitl.yml (ArduPilot SITL)
  - GitHub Actions: ci.yml (lint+pytest+docker smoke), sitl.yml (nightly)
  - tests/test_sitl_integration.py (8 tests, skip without SITL)

Phase 7 — Accuracy Validation:
  - AccuracyBenchmark + SyntheticTrajectory
  - AC-PERF-1: 80% within 50m 
  - AC-PERF-2: 60% within 20m 
  - AC-PERF-3: p95 latency < 400ms 
  - AC-PERF-4: VO drift 1km < 100m  (actual ~11m)
  - scripts/benchmark_accuracy.py CLI

Tests: 195 passed / 8 skipped

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Yuzviak
2026-04-02 17:00:41 +03:00
parent a15bef5c01
commit 094895b21b
40 changed files with 4572 additions and 497 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ from typing import List, Optional
from pydantic import BaseModel
from gps_denied.schemas.flight import GPSPoint
from gps_denied.schemas import GPSPoint
class ChunkStatus(str, Enum):
+1 -1
View File
@@ -5,7 +5,7 @@ from typing import Optional
import numpy as np
from pydantic import BaseModel
from gps_denied.schemas.flight import GPSPoint
from gps_denied.schemas import GPSPoint
from gps_denied.schemas.satellite import TileBounds
+57
View File
@@ -0,0 +1,57 @@
"""MAVLink I/O schemas (Component — Phase 4)."""
from typing import Optional
from pydantic import BaseModel
class GPSInputMessage(BaseModel):
"""Full field set for MAVLink GPS_INPUT (#233).
All numeric fields follow MAVLink units convention:
lat/lon in degE7, alt in metres MSL, velocity in m/s.
"""
time_usec: int # µs since Unix epoch
gps_id: int = 0
ignore_flags: int = 0 # GPS_INPUT_IGNORE_FLAGS bitmask (0 = use all)
time_week_ms: int # GPS ms-of-week
time_week: int # GPS week number
fix_type: int # 0=no fix, 2=2D, 3=3D
lat: int # degE7
lon: int # degE7
alt: float # metres MSL
hdop: float
vdop: float
vn: float # m/s North
ve: float # m/s East
vd: float # m/s Down
speed_accuracy: float # m/s
horiz_accuracy: float # m
vert_accuracy: float # m
satellites_visible: int = 0
class IMUMessage(BaseModel):
"""IMU data decoded from MAVLink ATTITUDE / RAW_IMU."""
accel_x: float # m/s² body-frame X
accel_y: float # m/s² body-frame Y
accel_z: float # m/s² body-frame Z
gyro_x: float # rad/s body-frame X
gyro_y: float # rad/s body-frame Y
gyro_z: float # rad/s body-frame Z
timestamp_us: int # µs
class TelemetryMessage(BaseModel):
"""1-Hz telemetry payload sent as NAMED_VALUE_FLOAT messages."""
confidence_score: float # 0.01.0
drift_estimate_m: float # estimated position drift in metres
fix_type: int # current fix_type being sent
frames_since_sat: int # frames since last satellite correction
class RelocalizationRequest(BaseModel):
"""Sent when 3 consecutive frames have no position estimate (MAV-04)."""
last_lat: Optional[float] = None # last known WGS84 lat
last_lon: Optional[float] = None # last known WGS84 lon
uncertainty_m: float = 500.0 # position uncertainty radius
consecutive_failures: int = 3
+1 -1
View File
@@ -5,7 +5,7 @@ from typing import Optional
import numpy as np
from pydantic import BaseModel
from gps_denied.schemas.flight import GPSPoint
from gps_denied.schemas import GPSPoint
class AlignmentResult(BaseModel):