[AZ-219] [AZ-228] Generalize VIO component layout

Keep VIO package and native bridge paths backend-neutral so BASALT remains an implementation choice rather than a component boundary.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-03 12:20:41 +03:00
parent 79997e39ac
commit 72a9df6b57
34 changed files with 123 additions and 114 deletions
+3 -2
View File
@@ -3,8 +3,9 @@
Scaffold for the Jetson-hosted GPS-denied localization runtime, replay harness, and Scaffold for the Jetson-hosted GPS-denied localization runtime, replay harness, and
deployment evidence paths. deployment evidence paths.
The project uses a Python `src/` layout for orchestration code, with native bridge The project uses a Python `src/` layout for orchestration code. Native bridge
directories reserved for BASALT, feature matching, and TensorRT integrations. placeholders live inside the owning component folders rather than in a shared
native tree.
Generated mission data, FDR payloads, cache payloads, and raw frame dumps are kept Generated mission data, FDR payloads, cache payloads, and raw frame dumps are kept
out of git unless they are explicitly curated test fixtures. out of git unless they are explicitly curated test fixtures.
+3 -3
View File
@@ -23,7 +23,7 @@ The system is a trigger-based hybrid estimator. Normal flight uses camera ingest
| # | Component | Purpose | Dependencies | Epic | | # | Component | Purpose | Dependencies | Epic |
|---|-----------|---------|--------------|------| |---|-----------|---------|--------------|------|
| 01 | Camera Ingest And Calibration | Ingest frames, validate calibration, detect total occlusion before VIO | Bootstrap, shared geometry/time, config/errors | AZ-209 | | 01 | Camera Ingest And Calibration | Ingest frames, validate calibration, detect total occlusion before VIO | Bootstrap, shared geometry/time, config/errors | AZ-209 |
| 02 | BASALT VIO Adapter | Wrap BASALT relative VIO and emit replaceable state DTOs | Camera, MAVLink telemetry, shared helpers | AZ-213 | | 02 | VIO Adapter | Wrap the selected relative VIO backend and emit replaceable state DTOs | Camera, MAVLink telemetry, shared helpers | AZ-213 |
| 03 | Safety And Anchor Wrapper | Own localization state, covariance, anchors, blackout/failsafe, output semantics | Camera, MAVLink, VIO, anchor verification | AZ-216 | | 03 | Safety And Anchor Wrapper | Own localization state, covariance, anchors, blackout/failsafe, output semantics | Camera, MAVLink, VIO, anchor verification | AZ-216 |
| 04 | Satellite Service | Sync Satellite Service cache/upload packages and retrieve local VPR candidates from cache descriptors and FAISS | Camera, Tile Manager, shared helpers | AZ-214 | | 04 | Satellite Service | Sync Satellite Service cache/upload packages and retrieve local VPR candidates from cache descriptors and FAISS | Camera, Tile Manager, shared helpers | AZ-214 |
| 05 | Anchor Verification | Verify retrieved candidates with learned matching and RANSAC | Satellite Service, camera, Tile Manager | AZ-215 | | 05 | Anchor Verification | Verify retrieved candidates with learned matching and RANSAC | Satellite Service, camera, Tile Manager | AZ-215 |
@@ -72,7 +72,7 @@ See `risk_mitigations.md` for the full register.
| Component | Integration | Performance | Security | Acceptance | AC Coverage | | Component | Integration | Performance | Security | Acceptance | AC Coverage |
|-----------|-------------|-------------|----------|------------|-------------| |-----------|-------------|-------------|----------|------------|-------------|
| Camera Ingest And Calibration | 3 | 1 | 1 | 2 | 7 ACs | | Camera Ingest And Calibration | 3 | 1 | 1 | 2 | 7 ACs |
| BASALT VIO Adapter | 4 | 1 | 1 | 1 | 8 ACs | | VIO Adapter | 4 | 1 | 1 | 1 | 8 ACs |
| Safety And Anchor Wrapper | 7 | 1 | 1 | 3 | 15 ACs | | Safety And Anchor Wrapper | 7 | 1 | 1 | 3 | 15 ACs |
| Satellite Service | 4 | 2 | 1 | 1 | 10 ACs | | Satellite Service | 4 | 2 | 1 | 1 | 10 ACs |
| Anchor Verification | 2 | 1 | 2 | 1 | 9 ACs | | Anchor Verification | 2 | 1 | 2 | 1 | 9 ACs |
@@ -95,7 +95,7 @@ See `risk_mitigations.md` for the full register.
| 5 | AZ-210: MAVLink And GCS Integration | Component 07 | M / 5-8 pts | AZ-206, AZ-208 | | 5 | AZ-210: MAVLink And GCS Integration | Component 07 | M / 5-8 pts | AZ-206, AZ-208 |
| 6 | AZ-211: Tile Manager | Component 06 | L / 8-13 pts | AZ-206, AZ-207, AZ-208 | | 6 | AZ-211: Tile Manager | Component 06 | L / 8-13 pts | AZ-206, AZ-207, AZ-208 |
| 7 | AZ-212: FDR And Observability | Component 08 | M-L / 5-8 pts | AZ-206, AZ-208 | | 7 | AZ-212: FDR And Observability | Component 08 | M-L / 5-8 pts | AZ-206, AZ-208 |
| 8 | AZ-213: BASALT VIO Adapter | Component 02 | L / 8-13 pts | AZ-209, AZ-210 | | 8 | AZ-213: VIO Adapter | Component 02 | L / 8-13 pts | AZ-209, AZ-210 |
| 9 | AZ-214: Satellite Service | Component 04 | L / 8-13 pts | AZ-209, AZ-211 | | 9 | AZ-214: Satellite Service | Component 04 | L / 8-13 pts | AZ-209, AZ-211 |
| 10 | AZ-215: Anchor Verification | Component 05 | L / 8-13 pts | AZ-214, AZ-209, AZ-211 | | 10 | AZ-215: Anchor Verification | Component 05 | L / 8-13 pts | AZ-214, AZ-209, AZ-211 |
| 11 | AZ-216: Safety And Anchor Wrapper | Component 03 | XL / 13-21 pts | AZ-209, AZ-210, AZ-213, AZ-215 | | 11 | AZ-216: Safety And Anchor Wrapper | Component 03 | XL / 13-21 pts | AZ-209, AZ-210, AZ-213, AZ-215 |
+5 -5
View File
@@ -7,7 +7,7 @@ Build a Jetson-hosted onboard localization pipeline for fixed-wing GPS-denied fl
### Components / Responsibilities ### Components / Responsibilities
- Camera ingest/calibration: load frames, apply intrinsics/extrinsics, validate image quality. - Camera ingest/calibration: load frames, apply intrinsics/extrinsics, validate image quality.
- BASALT VIO adapter: produce relative camera+IMU motion from synchronized nav frames and FC IMU. - VIO adapter: produce relative camera+IMU motion from synchronized nav frames and FC IMU.
- Safety/anchor wrapper: own covariance calibration, source labels, degraded modes, anchor fusion, and `GPS_INPUT`. - Safety/anchor wrapper: own covariance calibration, source labels, degraded modes, anchor fusion, and `GPS_INPUT`.
- Satellite Service: sync mission cache packages before flight, upload generated-tile packages after flight, and serve local VPR candidate retrieval from the offline cache. - Satellite Service: sync mission cache packages before flight, upload generated-tile packages after flight, and serve local VPR candidate retrieval from the offline cache.
- Anchor verification: run local matching/RANSAC and reject unsafe anchors. - Anchor verification: run local matching/RANSAC and reject unsafe anchors.
@@ -97,7 +97,7 @@ Build a Jetson-hosted onboard localization pipeline for fixed-wing GPS-denied fl
|--------|-------------|--------------------| |--------|-------------|--------------------|
| FrameRecord | Navigation-camera frame metadata, total-occlusion status, and processing status | Camera ingest/calibration | | FrameRecord | Navigation-camera frame metadata, total-occlusion status, and processing status | Camera ingest/calibration |
| TelemetrySample | FC IMU, attitude, airspeed, altitude, GPS health | MAVLink/GCS integration | | TelemetrySample | FC IMU, attitude, airspeed, altitude, GPS health | MAVLink/GCS integration |
| VioState | BASALT-relative pose/velocity/bias output and quality metadata | BASALT VIO adapter | | VioState | Backend-relative pose/velocity/bias output and quality metadata | VIO adapter |
| PositionEstimate | WGS84 estimate, covariance, source label, fix type, anchor age | Safety/anchor wrapper | | PositionEstimate | WGS84 estimate, covariance, source label, fix type, anchor age | Safety/anchor wrapper |
| VprChunk | Retrieval unit over cache imagery and descriptors | Satellite Service | | VprChunk | Retrieval unit over cache imagery and descriptors | Satellite Service |
| AnchorCandidate | Retrieved tile/chunk with local-match and RANSAC evidence | Anchor verification | | AnchorCandidate | Retrieved tile/chunk with local-match and RANSAC evidence | Anchor verification |
@@ -117,9 +117,9 @@ Build a Jetson-hosted onboard localization pipeline for fixed-wing GPS-denied fl
| From | To | Protocol | Pattern | Notes | | From | To | Protocol | Pattern | Notes |
|------|----|----------|---------|-------| |------|----|----------|---------|-------|
| Camera ingest/calibration | BASALT VIO adapter | In-process queue or shared frame bus | Streaming | Timestamp discipline is critical | | Camera ingest/calibration | VIO adapter | In-process queue or shared frame bus | Streaming | Timestamp discipline is critical |
| MAVLink telemetry | BASALT VIO adapter | In-process telemetry buffer | Streaming | IMU/attitude/altitude sync | | MAVLink telemetry | VIO adapter | In-process telemetry buffer | Streaming | IMU/attitude/altitude sync |
| BASALT VIO adapter | Safety/anchor wrapper | Typed state messages | Streaming | Wrapper calibrates confidence | | VIO adapter | Safety/anchor wrapper | Typed state messages | Streaming | Wrapper calibrates confidence |
| Safety/anchor wrapper | Satellite Service | Command | Triggered local request | Uses only preloaded cache/index data during flight | | Safety/anchor wrapper | Satellite Service | Command | Triggered local request | Uses only preloaded cache/index data during flight |
| Satellite Service | Anchor verification | Candidate list | Request-response | Dynamic top-K | | Satellite Service | Anchor verification | Candidate list | Request-response | Dynamic top-K |
| Anchor verification | Safety/anchor wrapper | Anchor decision | Request-response | Includes MRE/inliers/provenance | | Anchor verification | Safety/anchor wrapper | Anchor decision | Request-response | Includes MRE/inliers/provenance |
@@ -23,7 +23,7 @@ Shared timestamp validation and alignment utilities for frame, IMU, telemetry, F
| Component | Usage | | Component | Usage |
|-----------|-------| |-----------|-------|
| Camera ingest/calibration | Frame ordering and timestamp metadata | | Camera ingest/calibration | Frame ordering and timestamp metadata |
| BASALT VIO adapter | IMU/frame synchronization | | VIO adapter | IMU/frame synchronization |
| MAVLink/GCS integration | Telemetry timestamp normalization | | MAVLink/GCS integration | Telemetry timestamp normalization |
| FDR/observability | Segment ordering | | FDR/observability | Segment ordering |
| Validation harness | Fixture validation | | Validation harness | Fixture validation |
@@ -8,7 +8,7 @@
**Upstream dependencies**: Navigation camera, camera calibration files. **Upstream dependencies**: Navigation camera, camera calibration files.
**Downstream consumers**: BASALT VIO adapter, Satellite Service, anchor verification, Tile Manager, FDR. **Downstream consumers**: VIO adapter, Satellite Service, anchor verification, Tile Manager, FDR.
## 2. Internal Interfaces ## 2. Internal Interfaces
@@ -100,7 +100,7 @@ ImageQualityReport:
**Can be implemented in parallel with**: Tile Manager, MAVLink/GCS integration. **Can be implemented in parallel with**: Tile Manager, MAVLink/GCS integration.
**Blocks**: BASALT VIO adapter, anchor verification, generated tile lifecycle. **Blocks**: VIO adapter, anchor verification, generated tile lifecycle.
## 8. Logging Strategy ## 8. Logging Strategy
@@ -110,7 +110,7 @@
| Step | Action | Expected Result | | Step | Action | Expected Result |
|------|--------|-----------------| |------|--------|-----------------|
| 1 | Feed a calibrated normal frame | Occlusion status is `clear` | | 1 | Feed a calibrated normal frame | Occlusion status is `clear` |
| 2 | Process quality gate | Frame is emitted to BASALT adapter | | 2 | Process quality gate | Frame is emitted to VIO adapter |
--- ---
@@ -1,8 +1,8 @@
# BASALT VIO Adapter # VIO Adapter
## 1. High-Level Overview ## 1. High-Level Overview
**Purpose**: Wrap BASALT as a replaceable relative VIO component that consumes calibrated frames and FC IMU data, then emits relative pose/velocity/bias state and tracking quality. **Purpose**: Wrap the selected relative VIO backend as a replaceable component that consumes calibrated frames and FC IMU data, then emits relative pose/velocity/bias state and tracking quality.
**Architectural Pattern**: Adapter / anti-corruption layer. **Architectural Pattern**: Adapter / anti-corruption layer.
@@ -48,14 +48,14 @@ No persistent production data ownership. Reads calibration/config at startup and
## 4. Implementation Details ## 4. Implementation Details
**State Management**: Owns BASALT runtime state and resets only through explicit wrapper command. **State Management**: Owns selected VIO backend runtime state and resets only through explicit wrapper command.
**Key Dependencies**: **Key Dependencies**:
| Library | Purpose | | Library | Purpose |
|---------|---------| |---------|---------|
| BASALT | Relative visual-inertial odometry | | BASALT | Current selected relative visual-inertial odometry backend |
| Eigen/Sophus or BASALT native math stack | Pose and transform representation | | Eigen/Sophus or backend-native math stack | Pose and transform representation |
**Error Handling Strategy**: **Error Handling Strategy**:
- Tracking loss is surfaced to the safety/anchor wrapper, not hidden. - Tracking loss is surfaced to the safety/anchor wrapper, not hidden.
@@ -66,7 +66,7 @@ No persistent production data ownership. Reads calibration/config at startup and
**Known limitations**: **Known limitations**:
- BASALT has no special fixed-wing nadir mode; validation must prove fit under low-parallax/planar terrain. - BASALT has no special fixed-wing nadir mode; validation must prove fit under low-parallax/planar terrain.
- BASALT covariance/confidence output is not the product authority; wrapper calibration is required. - Backend covariance/confidence output is not the product authority; wrapper calibration is required.
**Performance bottlenecks**: **Performance bottlenecks**:
- Native VIO runtime and image resolution can exceed Jetson budget if not tuned. - Native VIO runtime and image resolution can exceed Jetson budget if not tuned.
@@ -83,7 +83,7 @@ No persistent production data ownership. Reads calibration/config at startup and
| Log Level | When | Example | | Log Level | When | Example |
|-----------|------|---------| |-----------|------|---------|
| ERROR | BASALT initialization fails | `basalt_init_failed reason=...` | | ERROR | VIO backend initialization fails | `vio_init_failed reason=...` |
| WARN | Tracking quality drops | `vio_tracking_degraded quality=...` | | WARN | Tracking quality drops | `vio_tracking_degraded quality=...` |
| INFO | VIO reset/reinitialized | `vio_reset cause=...` | | INFO | VIO reset/reinitialized | `vio_reset cause=...` |
@@ -1,4 +1,4 @@
# Test Specification — BASALT VIO Adapter # Test Specification — VIO Adapter
## Acceptance Criteria Traceability ## Acceptance Criteria Traceability
@@ -17,7 +17,7 @@
### IT-01: Public Dataset VIO Replay ### IT-01: Public Dataset VIO Replay
**Summary**: Verify BASALT adapter produces relative motion for synchronized camera/IMU replay. **Summary**: Verify the VIO adapter produces relative motion for synchronized camera/IMU replay.
**Traces to**: AC-2.1a, AC-2.2 **Traces to**: AC-2.1a, AC-2.2
@@ -53,7 +53,7 @@
**Traces to**: AC-3.1 **Traces to**: AC-3.1
**Input data**: Replay segment with synthetic ±20° tilt and up to 350 m apparent outlier. **Input data**: Replay segment with synthetic +/-20 degree tilt and up to 350 m apparent outlier.
**Expected result**: Adapter either tracks with quality metadata or emits `TrackingLost`; it never hides a failure as high-quality VIO. **Expected result**: Adapter either tracks with quality metadata or emits `TrackingLost`; it never hides a failure as high-quality VIO.
@@ -67,7 +67,7 @@
**Traces to**: AC-3.2, AC-3.4 **Traces to**: AC-3.2, AC-3.4
**Input data**: <5% overlap sequence with heading change <70°. **Input data**: <5% overlap sequence with heading change <70 degrees.
**Expected result**: Adapter emits low tracking quality or `TrackingLost` within the loss window, allowing relocalization trigger. **Expected result**: Adapter emits low tracking quality or `TrackingLost` within the loss window, allowing relocalization trigger.
@@ -75,7 +75,7 @@
## Performance Tests ## Performance Tests
### PT-01: BASALT Adapter Runtime Budget ### PT-01: VIO Adapter Runtime Budget
**Summary**: Verify VIO processing does not consume the full <400 ms system p95 budget. **Summary**: Verify VIO processing does not consume the full <400 ms system p95 budget.
@@ -6,7 +6,7 @@
**Architectural Pattern**: Stateful coordinator / safety facade. **Architectural Pattern**: Stateful coordinator / safety facade.
**Upstream dependencies**: BASALT VIO adapter, anchor verification, MAVLink telemetry, camera quality reports. **Upstream dependencies**: VIO adapter, anchor verification, MAVLink telemetry, camera quality reports.
**Downstream consumers**: MAVLink/GCS integration, FDR, Tile Manager, separate e2e test suite. **Downstream consumers**: MAVLink/GCS integration, FDR, Tile Manager, separate e2e test suite.
@@ -76,7 +76,7 @@ AnchorDecision:
**Must be implemented after**: Satellite Service candidate DTOs, Tile Manager tile access. **Must be implemented after**: Satellite Service candidate DTOs, Tile Manager tile access.
**Can be implemented in parallel with**: BASALT VIO adapter. **Can be implemented in parallel with**: VIO adapter.
**Blocks**: accepted satellite-anchor path. **Blocks**: accepted satellite-anchor path.
@@ -8,7 +8,7 @@
**Upstream dependencies**: ArduPilot Plane FC, safety/anchor wrapper. **Upstream dependencies**: ArduPilot Plane FC, safety/anchor wrapper.
**Downstream consumers**: BASALT VIO adapter, safety/anchor wrapper, QGC, FDR. **Downstream consumers**: VIO adapter, safety/anchor wrapper, QGC, FDR.
## 2. Internal Interfaces ## 2. Internal Interfaces
+1 -1
View File
@@ -12,7 +12,7 @@ This model defines system-level runtime, cache, telemetry, and validation data.
| CameraCalibration | Intrinsics, distortion, lens, fixed extrinsics, capture settings | Versioned calibration file | Camera ingest/calibration | | CameraCalibration | Intrinsics, distortion, lens, fixed extrinsics, capture settings | Versioned calibration file | Camera ingest/calibration |
| FrameRecord | Per-frame metadata, timestamp, total-occlusion/blackout state, image quality, processing status | PostgreSQL/FDR event; replay fixture | Camera ingest/calibration | | FrameRecord | Per-frame metadata, timestamp, total-occlusion/blackout state, image quality, processing status | PostgreSQL/FDR event; replay fixture | Camera ingest/calibration |
| TelemetrySample | FC IMU, attitude, altitude, airspeed, GPS health | MAVLink stream; FDR event | MAVLink/GCS integration | | TelemetrySample | FC IMU, attitude, altitude, airspeed, GPS health | MAVLink stream; FDR event | MAVLink/GCS integration |
| VioState | BASALT relative state, velocity, bias, tracking quality | Internal DTO; FDR event | BASALT VIO adapter | | VioState | Backend-relative state, velocity, bias, tracking quality | Internal DTO; FDR event | VIO adapter |
| PositionEstimate | WGS84 output, covariance, source label, anchor age, fix type | MAVLink DTO; FDR event | Safety/anchor wrapper | | PositionEstimate | WGS84 output, covariance, source label, anchor age, fix type | MAVLink DTO; FDR event | Safety/anchor wrapper |
| VprChunk | Retrieval footprint and descriptor metadata | PostgreSQL/PostGIS manifest + descriptor files | Satellite Service | | VprChunk | Retrieval footprint and descriptor metadata | PostgreSQL/PostGIS manifest + descriptor files | Satellite Service |
| AnchorCandidate | Top-K retrieval result and local verification metrics | Internal DTO; FDR event | Anchor verification | | AnchorCandidate | Top-K retrieval result and local verification metrics | Internal DTO; FDR event | Anchor verification |
@@ -3,7 +3,7 @@
```mermaid ```mermaid
flowchart LR flowchart LR
camera[01 Camera Ingest And Calibration] camera[01 Camera Ingest And Calibration]
vio[02 BASALT VIO Adapter] vio[02 VIO Adapter]
wrapper[03 Safety And Anchor Wrapper] wrapper[03 Safety And Anchor Wrapper]
retrieval[04 Satellite Service] retrieval[04 Satellite Service]
verify[05 Anchor Verification] verify[05 Anchor Verification]
@@ -7,7 +7,7 @@ flowchart TD
occlusion -->|Yes| imuOnly[03 IMU-only dead_reckoned propagation] occlusion -->|Yes| imuOnly[03 IMU-only dead_reckoned propagation]
occlusion -->|No| frameOk{Frame usable for VIO?} occlusion -->|No| frameOk{Frame usable for VIO?}
frameOk -->|No| degrade[03 Safety wrapper degraded mode] frameOk -->|No| degrade[03 Safety wrapper degraded mode]
frameOk -->|Yes| vio[02 BASALT VIO adapter] frameOk -->|Yes| vio[02 VIO adapter]
telemetry[07 MAVLink telemetry] --> vio telemetry[07 MAVLink telemetry] --> vio
vio --> healthy{VIO healthy?} vio --> healthy{VIO healthy?}
healthy -->|Yes| wrap[03 Covariance calibration + source label] healthy -->|Yes| wrap[03 Covariance calibration + source label]
+4 -4
View File
@@ -17,7 +17,7 @@
| 5 | AZ-210 | MAVLink And GCS Integration | component | AZ-206, AZ-208 | M / 5-8 pts | | 5 | AZ-210 | MAVLink And GCS Integration | component | AZ-206, AZ-208 | M / 5-8 pts |
| 6 | AZ-211 | Tile Manager | component | AZ-206, AZ-207, AZ-208 | L / 8-13 pts | | 6 | AZ-211 | Tile Manager | component | AZ-206, AZ-207, AZ-208 | L / 8-13 pts |
| 7 | AZ-212 | FDR And Observability | component | AZ-206, AZ-208 | M-L / 5-8 pts | | 7 | AZ-212 | FDR And Observability | component | AZ-206, AZ-208 | M-L / 5-8 pts |
| 8 | AZ-213 | BASALT VIO Adapter | component | AZ-206, AZ-207, AZ-208, AZ-209, AZ-210 | L / 8-13 pts | | 8 | AZ-213 | VIO Adapter | component | AZ-206, AZ-207, AZ-208, AZ-209, AZ-210 | L / 8-13 pts |
| 9 | AZ-214 | Satellite Service | component | AZ-206, AZ-207, AZ-208, AZ-209, AZ-211 | L / 8-13 pts | | 9 | AZ-214 | Satellite Service | component | AZ-206, AZ-207, AZ-208, AZ-209, AZ-211 | L / 8-13 pts |
| 10 | AZ-215 | Anchor Verification | component | AZ-206, AZ-207, AZ-208, AZ-209, AZ-211, AZ-214 | L / 8-13 pts | | 10 | AZ-215 | Anchor Verification | component | AZ-206, AZ-207, AZ-208, AZ-209, AZ-211, AZ-214 | L / 8-13 pts |
| 11 | AZ-216 | Safety And Anchor Wrapper | component | AZ-206, AZ-207, AZ-208, AZ-209, AZ-210, AZ-213, AZ-215 | XL / 13-21 pts | | 11 | AZ-216 | Safety And Anchor Wrapper | component | AZ-206, AZ-207, AZ-208, AZ-209, AZ-210, AZ-213, AZ-215 | XL / 13-21 pts |
@@ -33,7 +33,7 @@
| `common-helpers/02_helper_time_sync.md` | AZ-207 | | `common-helpers/02_helper_time_sync.md` | AZ-207 |
| Runtime config, error contracts, health checks | AZ-208 | | Runtime config, error contracts, health checks | AZ-208 |
| `components/01_camera_ingest_calibration/` | AZ-209 | | `components/01_camera_ingest_calibration/` | AZ-209 |
| `components/02_basalt_vio_adapter/` | AZ-213 | | `components/02_vio_adapter/` | AZ-213 |
| `components/03_safety_anchor_wrapper/` | AZ-216 | | `components/03_safety_anchor_wrapper/` | AZ-216 |
| `components/04_satellite_retrieval/` | AZ-214 | | `components/04_satellite_retrieval/` | AZ-214 |
| `components/05_anchor_verification/` | AZ-215 | | `components/05_anchor_verification/` | AZ-215 |
@@ -54,7 +54,7 @@ flowchart TD
mavlink[AZ-210 MAVLink And GCS] mavlink[AZ-210 MAVLink And GCS]
cache[AZ-211 Tile Manager] cache[AZ-211 Tile Manager]
fdr[AZ-212 FDR And Observability] fdr[AZ-212 FDR And Observability]
vio[AZ-213 BASALT VIO Adapter] vio[AZ-213 VIO Adapter]
retrieval[AZ-214 Satellite Service] retrieval[AZ-214 Satellite Service]
anchor[AZ-215 Anchor Verification] anchor[AZ-215 Anchor Verification]
safety[AZ-216 Safety And Anchor Wrapper] safety[AZ-216 Safety And Anchor Wrapper]
@@ -124,7 +124,7 @@ flowchart TD
- AZ-210 — MAVLink And GCS Integration - AZ-210 — MAVLink And GCS Integration
- AZ-211 — Tile Manager - AZ-211 — Tile Manager
- AZ-212 — FDR And Observability - AZ-212 — FDR And Observability
- AZ-213 — BASALT VIO Adapter - AZ-213 — VIO Adapter
- AZ-214 — Satellite Service - AZ-214 — Satellite Service
- AZ-215 — Anchor Verification - AZ-215 — Anchor Verification
- AZ-216 — Safety And Anchor Wrapper - AZ-216 — Safety And Anchor Wrapper
+22 -25
View File
@@ -9,7 +9,7 @@
1. Each product component owns one top-level directory under `src/`. 1. Each product component owns one top-level directory under `src/`.
2. Shared contracts and cross-cutting helpers live under `src/shared/`. 2. Shared contracts and cross-cutting helpers live under `src/shared/`.
3. Native hot-path or third-party bridge code lives under `src/native/` and is owned by the component that wraps it. 3. Native hot-path or third-party bridge code lives inside the owning component folder under `native/`.
4. Public API surface per component is limited to `__init__.py`, `types.py`, and `interfaces.py` unless a component entry lists another public file. 4. Public API surface per component is limited to `__init__.py`, `types.py`, and `interfaces.py` unless a component entry lists another public file.
5. Tests live under `tests/` by test type and component; implementation tasks must not place tests inside the component tree unless a later test task explicitly changes this layout. 5. Tests live under `tests/` by test type and component; implementation tasks must not place tests inside the component tree unless a later test task explicitly changes this layout.
@@ -29,25 +29,24 @@
- `src/camera_ingest_calibration/_*.py` - `src/camera_ingest_calibration/_*.py`
- **Owns (exclusive write during implementation)**: `src/camera_ingest_calibration/**` - **Owns (exclusive write during implementation)**: `src/camera_ingest_calibration/**`
- **Imports from**: shared/contracts, shared/geo_geometry, shared/time_sync, shared/config, shared/errors, shared/telemetry - **Imports from**: shared/contracts, shared/geo_geometry, shared/time_sync, shared/config, shared/errors, shared/telemetry
- **Consumed by**: BASALT VIO Adapter, Satellite Service, Anchor Verification, Tile Manager, FDR And Observability - **Consumed by**: VIO Adapter, Satellite Service, Anchor Verification, Tile Manager, FDR And Observability
### Component: BASALT VIO Adapter ### Component: VIO Adapter
- **Epic**: AZ-213 - **Epic**: AZ-213
- **Directory**: `src/basalt_vio_adapter/` - **Directory**: `src/vio_adapter/`
- **Native Directory**: `src/native/basalt_bridge/` - **Native Directory**: `src/vio_adapter/native/`
- **Technologies**: Python adapter, C++ native bridge, BASALT, Eigen/Sophus or BASALT math stack, OpenCV 4.x, shared time-sync contracts - **Technologies**: Python adapter, C++ native bridge, BASALT as current backend, Eigen/Sophus or backend-native math stack, OpenCV 4.x, shared time-sync contracts
- **Public API**: - **Public API**:
- `src/basalt_vio_adapter/__init__.py` - `src/vio_adapter/__init__.py`
- `src/basalt_vio_adapter/types.py` - `src/vio_adapter/types.py`
- `src/basalt_vio_adapter/interfaces.py` - `src/vio_adapter/interfaces.py`
- **Internal (do NOT import from other components)**: - **Internal (do NOT import from other components)**:
- `src/basalt_vio_adapter/internal/*` - `src/vio_adapter/internal/*`
- `src/basalt_vio_adapter/_*.py` - `src/vio_adapter/_*.py`
- `src/native/basalt_bridge/**` - `src/vio_adapter/native/**`
- **Owns (exclusive write during implementation)**: - **Owns (exclusive write during implementation)**:
- `src/basalt_vio_adapter/**` - `src/vio_adapter/**`
- `src/native/basalt_bridge/**`
- **Imports from**: Camera Ingest And Calibration, MAVLink And GCS Integration, shared/contracts, shared/geo_geometry, shared/time_sync, shared/config, shared/errors, shared/telemetry - **Imports from**: Camera Ingest And Calibration, MAVLink And GCS Integration, shared/contracts, shared/geo_geometry, shared/time_sync, shared/config, shared/errors, shared/telemetry
- **Consumed by**: Safety And Anchor Wrapper, FDR And Observability - **Consumed by**: Safety And Anchor Wrapper, FDR And Observability
@@ -64,14 +63,14 @@
- `src/safety_anchor_wrapper/internal/*` - `src/safety_anchor_wrapper/internal/*`
- `src/safety_anchor_wrapper/_*.py` - `src/safety_anchor_wrapper/_*.py`
- **Owns (exclusive write during implementation)**: `src/safety_anchor_wrapper/**` - **Owns (exclusive write during implementation)**: `src/safety_anchor_wrapper/**`
- **Imports from**: BASALT VIO Adapter, Anchor Verification, MAVLink And GCS Integration, Camera Ingest And Calibration, shared/contracts, shared/geo_geometry, shared/time_sync, shared/config, shared/errors, shared/telemetry - **Imports from**: VIO Adapter, Anchor Verification, MAVLink And GCS Integration, Camera Ingest And Calibration, shared/contracts, shared/geo_geometry, shared/time_sync, shared/config, shared/errors, shared/telemetry
- **Consumed by**: MAVLink And GCS Integration, Tile Manager, FDR And Observability - **Consumed by**: MAVLink And GCS Integration, Tile Manager, FDR And Observability
### Component: Satellite Service ### Component: Satellite Service
- **Epic**: AZ-214 - **Epic**: AZ-214
- **Directory**: `src/satellite_service/` - **Directory**: `src/satellite_service/`
- **Native Directory**: `src/native/tensor_rt/` - **Native Directory**: `src/satellite_service/native/`
- **Technologies**: Python service adapter, DINOv2-VLAD descriptors, ONNX/TensorRT candidate path, CPU FAISS, offline package sync client - **Technologies**: Python service adapter, DINOv2-VLAD descriptors, ONNX/TensorRT candidate path, CPU FAISS, offline package sync client
- **Public API**: - **Public API**:
- `src/satellite_service/__init__.py` - `src/satellite_service/__init__.py`
@@ -80,10 +79,9 @@
- **Internal (do NOT import from other components)**: - **Internal (do NOT import from other components)**:
- `src/satellite_service/internal/*` - `src/satellite_service/internal/*`
- `src/satellite_service/_*.py` - `src/satellite_service/_*.py`
- `src/native/tensor_rt/**` - `src/satellite_service/native/**`
- **Owns (exclusive write during implementation)**: - **Owns (exclusive write during implementation)**:
- `src/satellite_service/**` - `src/satellite_service/**`
- `src/native/tensor_rt/**`
- **Imports from**: Camera Ingest And Calibration, Tile Manager, Safety And Anchor Wrapper, shared/contracts, shared/geo_geometry, shared/time_sync, shared/config, shared/errors, shared/telemetry - **Imports from**: Camera Ingest And Calibration, Tile Manager, Safety And Anchor Wrapper, shared/contracts, shared/geo_geometry, shared/time_sync, shared/config, shared/errors, shared/telemetry
- **Consumed by**: Anchor Verification, FDR And Observability - **Consumed by**: Anchor Verification, FDR And Observability
- **Network invariant**: external Satellite Service sync is allowed only pre-flight or post-flight; no mid-flight satellite-provider or suite-service calls. - **Network invariant**: external Satellite Service sync is allowed only pre-flight or post-flight; no mid-flight satellite-provider or suite-service calls.
@@ -92,7 +90,7 @@
- **Epic**: AZ-215 - **Epic**: AZ-215
- **Directory**: `src/anchor_verification/` - **Directory**: `src/anchor_verification/`
- **Native Directory**: `src/native/feature_matching/` - **Native Directory**: `src/anchor_verification/native/`
- **Technologies**: Python validation pipeline, ALIKED/DISK + LightGlue, OpenCV RANSAC/USAC, SIFT/ORB baseline, native feature-matching bridge - **Technologies**: Python validation pipeline, ALIKED/DISK + LightGlue, OpenCV RANSAC/USAC, SIFT/ORB baseline, native feature-matching bridge
- **Public API**: - **Public API**:
- `src/anchor_verification/__init__.py` - `src/anchor_verification/__init__.py`
@@ -101,10 +99,9 @@
- **Internal (do NOT import from other components)**: - **Internal (do NOT import from other components)**:
- `src/anchor_verification/internal/*` - `src/anchor_verification/internal/*`
- `src/anchor_verification/_*.py` - `src/anchor_verification/_*.py`
- `src/native/feature_matching/**` - `src/anchor_verification/native/**`
- **Owns (exclusive write during implementation)**: - **Owns (exclusive write during implementation)**:
- `src/anchor_verification/**` - `src/anchor_verification/**`
- `src/native/feature_matching/**`
- **Imports from**: Satellite Service, Camera Ingest And Calibration, Tile Manager, shared/contracts, shared/geo_geometry, shared/time_sync, shared/config, shared/errors, shared/telemetry - **Imports from**: Satellite Service, Camera Ingest And Calibration, Tile Manager, shared/contracts, shared/geo_geometry, shared/time_sync, shared/config, shared/errors, shared/telemetry
- **Consumed by**: Safety And Anchor Wrapper, FDR And Observability - **Consumed by**: Safety And Anchor Wrapper, FDR And Observability
@@ -141,7 +138,7 @@
- `src/mavlink_gcs_integration/_*.py` - `src/mavlink_gcs_integration/_*.py`
- **Owns (exclusive write during implementation)**: `src/mavlink_gcs_integration/**` - **Owns (exclusive write during implementation)**: `src/mavlink_gcs_integration/**`
- **Imports from**: Safety And Anchor Wrapper, shared/contracts, shared/time_sync, shared/config, shared/errors, shared/telemetry - **Imports from**: Safety And Anchor Wrapper, shared/contracts, shared/time_sync, shared/config, shared/errors, shared/telemetry
- **Consumed by**: BASALT VIO Adapter, Safety And Anchor Wrapper, FDR And Observability - **Consumed by**: VIO Adapter, Safety And Anchor Wrapper, FDR And Observability
### Component: FDR And Observability ### Component: FDR And Observability
@@ -189,7 +186,7 @@
- **Technologies**: Python timestamp utilities, monotonic-clock validation, MAVLink/camera timestamp normalization, replay ordering checks - **Technologies**: Python timestamp utilities, monotonic-clock validation, MAVLink/camera timestamp normalization, replay ordering checks
- **Purpose**: Monotonic timestamp checks, frame-to-IMU alignment, clock-domain metadata, replay ordering, and gap/jitter metrics. - **Purpose**: Monotonic timestamp checks, frame-to-IMU alignment, clock-domain metadata, replay ordering, and gap/jitter metrics.
- **Owned by**: time-sync task under AZ-207. - **Owned by**: time-sync task under AZ-207.
- **Consumed by**: Camera Ingest And Calibration, BASALT VIO Adapter, MAVLink And GCS Integration, FDR And Observability. - **Consumed by**: Camera Ingest And Calibration, VIO Adapter, MAVLink And GCS Integration, FDR And Observability.
### shared/config ### shared/config
@@ -225,7 +222,7 @@ Read top-to-bottom; an upper layer may import from a lower layer but never the r
| Layer | Components | May import from | | Layer | Components | May import from |
|-------|------------|-----------------| |-------|------------|-----------------|
| 4. Runtime Output / Coordination | Safety And Anchor Wrapper, MAVLink And GCS Integration, FDR And Observability | 1, 2, 3 public interfaces | | 4. Runtime Output / Coordination | Safety And Anchor Wrapper, MAVLink And GCS Integration, FDR And Observability | 1, 2, 3 public interfaces |
| 3. Perception / Satellite Anchor | BASALT VIO Adapter, Satellite Service, Anchor Verification | 1, 2 public interfaces | | 3. Perception / Satellite Anchor | VIO Adapter, Satellite Service, Anchor Verification | 1, 2 public interfaces |
| 2. Data Ingest / Persistence | Camera Ingest And Calibration, Tile Manager | 1 | | 2. Data Ingest / Persistence | Camera Ingest And Calibration, Tile Manager | 1 |
| 1. Shared / Foundation | shared/contracts, shared/geo_geometry, shared/time_sync, shared/config, shared/errors, shared/telemetry | none | | 1. Shared / Foundation | shared/contracts, shared/geo_geometry, shared/time_sync, shared/config, shared/errors, shared/telemetry | none |
@@ -242,5 +239,5 @@ The e2e replay/SITL/Jetson validation suite is not a product component and must
- Every runtime component under `_docs/02_document/components/` has a mapping entry. - Every runtime component under `_docs/02_document/components/` has a mapping entry.
- Cross-cutting epics AZ-206, AZ-207, and AZ-208 have shared ownership entries. - Cross-cutting epics AZ-206, AZ-207, and AZ-208 have shared ownership entries.
- Layering covers all components and keeps shared code at the bottom. - Layering covers all components and keeps shared code at the bottom.
- Component-owned paths do not overlap, except explicitly assigned native directories. - Component-owned paths do not overlap; native bridge paths live inside the component that owns them.
- Paths follow the project `src/` layout already confirmed by `AZ-219_initial_structure`. - Paths follow the project `src/` layout already confirmed by `AZ-219_initial_structure`.
+6 -6
View File
@@ -35,7 +35,7 @@
| ID | Risk | Category | Probability | Impact | Score | Mitigation | Owner | Status | | ID | Risk | Category | Probability | Impact | Score | Mitigation | Owner | Status |
|----|------|----------|-------------|--------|-------|------------|-------|--------| |----|------|----------|-------------|--------|-------|------------|-------|--------|
| R01 | ADTi 20MP 20L V1 public specs conflict with planning assumptions for resolution, FPS, lens, interface, and temperature | Technical / External | Medium | High | High | Pin manufacturer datasheet and exact lens/interface before implementation; make camera calibration/spec task a bootstrap blocker | Camera ingest/calibration | Mitigated by gate | | R01 | ADTi 20MP 20L V1 public specs conflict with planning assumptions for resolution, FPS, lens, interface, and temperature | Technical / External | Medium | High | High | Pin manufacturer datasheet and exact lens/interface before implementation; make camera calibration/spec task a bootstrap blocker | Camera ingest/calibration | Mitigated by gate |
| R02 | BASALT may underperform or lose tracking on nadir fixed-wing low-parallax terrain | Technical | Medium | High | High | Public replay with MUN-FRL/ALTO/Kagaru/EPFL where applicable, representative target replay, OpenVINS reference comparison, Kimera backup path | BASALT VIO adapter | Mitigated by validation | | R02 | BASALT may underperform or lose tracking on nadir fixed-wing low-parallax terrain | Technical | Medium | High | High | Public replay with MUN-FRL/ALTO/Kagaru/EPFL where applicable, representative target replay, OpenVINS reference comparison, Kimera backup path | VIO adapter | Mitigated by validation |
| R03 | BASALT confidence/covariance may under-report real error | Safety | Medium | High | High | Wrapper owns covariance calibration; compare against ground truth, satellite residuals, and OpenVINS reference; never emit optimistic `horiz_accuracy` | Safety/anchor wrapper | Mitigated by wrapper design | | R03 | BASALT confidence/covariance may under-report real error | Safety | Medium | High | High | Wrapper owns covariance calibration; compare against ground truth, satellite residuals, and OpenVINS reference; never emit optimistic `horiz_accuracy` | Safety/anchor wrapper | Mitigated by wrapper design |
| R04 | Total occlusion detector may false-negative and feed unusable frames into VIO | Safety / Technical | Medium | High | High | Conservative pre-VIO occlusion gate, FDR status, tests for total blackout, and fallback to IMU-only `dead_reckoned` mode | Camera ingest/calibration | Mitigated by spec/test | | R04 | Total occlusion detector may false-negative and feed unusable frames into VIO | Safety / Technical | Medium | High | High | Conservative pre-VIO occlusion gate, FDR status, tests for total blackout, and fallback to IMU-only `dead_reckoned` mode | Camera ingest/calibration | Mitigated by spec/test |
| R05 | IMU-only blackout propagation could be trusted too long | Safety | Medium | High | High | Monotonic covariance growth, `dead_reckoned` label, `fix_type=0`/`horiz_accuracy=999.0` when >30 s or covariance >500 m | Safety/anchor wrapper | Mitigated by AC gate | | R05 | IMU-only blackout propagation could be trusted too long | Safety | Medium | High | High | Monotonic covariance growth, `dead_reckoned` label, `fix_type=0`/`horiz_accuracy=999.0` when >30 s or covariance >500 m | Safety/anchor wrapper | Mitigated by AC gate |
@@ -55,7 +55,7 @@
**Trigger conditions**: Manufacturer documentation or hardware testing contradicts assumed FPS, interface, temperature, or lens characteristics. **Trigger conditions**: Manufacturer documentation or hardware testing contradicts assumed FPS, interface, temperature, or lens characteristics.
**Affected components**: Camera ingest/calibration, BASALT VIO adapter, separate e2e test suite, deployment procedures. **Affected components**: Camera ingest/calibration, VIO adapter, separate e2e test suite, deployment procedures.
**Mitigation strategy**: **Mitigation strategy**:
1. Make camera specification verification a bootstrap task. 1. Make camera specification verification a bootstrap task.
@@ -76,7 +76,7 @@
**Trigger conditions**: Public or representative replay shows high drift, frequent tracking loss, or poor initialization. **Trigger conditions**: Public or representative replay shows high drift, frequent tracking loss, or poor initialization.
**Affected components**: BASALT VIO adapter, safety/anchor wrapper, separate e2e test suite. **Affected components**: VIO adapter, safety/anchor wrapper, separate e2e test suite.
**Mitigation strategy**: **Mitigation strategy**:
1. Run MUN-FRL first for synchronized nadir camera + IMU + ground truth. 1. Run MUN-FRL first for synchronized nadir camera + IMU + ground truth.
@@ -87,7 +87,7 @@
**Residual risk after mitigation**: Medium. **Residual risk after mitigation**: Medium.
**Documents updated**: `architecture.md`, `components/02_basalt_vio_adapter/description.md`, `tests/test-data.md`. **Documents updated**: `architecture.md`, `components/02_vio_adapter/description.md`, `tests/test-data.md`.
--- ---
@@ -118,7 +118,7 @@
**Trigger conditions**: Lens cover, cloud/whiteout, decode failure, underexposure/overexposure, or textureless frame reaches VIO as usable. **Trigger conditions**: Lens cover, cloud/whiteout, decode failure, underexposure/overexposure, or textureless frame reaches VIO as usable.
**Affected components**: Camera ingest/calibration, safety/anchor wrapper, BASALT VIO adapter. **Affected components**: Camera ingest/calibration, safety/anchor wrapper, VIO adapter.
**Mitigation strategy**: **Mitigation strategy**:
1. Camera ingest exposes `OcclusionReport` and sets `usable_for_vio=false` for total occlusion/blackout. 1. Camera ingest exposes `OcclusionReport` and sets `usable_for_vio=false` for total occlusion/blackout.
@@ -223,7 +223,7 @@
**Trigger conditions**: MUN-FRL/ALTO/Kagaru/EPFL slices are unavailable, unrepresentative, or license-incompatible for acceptance. **Trigger conditions**: MUN-FRL/ALTO/Kagaru/EPFL slices are unavailable, unrepresentative, or license-incompatible for acceptance.
**Affected components**: Validation harness, BASALT VIO adapter, anchor verification. **Affected components**: Validation harness, VIO adapter, anchor verification.
**Mitigation strategy**: **Mitigation strategy**:
1. Use public datasets for de-risking only. 1. Use public datasets for de-risking only.
+9 -9
View File
@@ -5,7 +5,7 @@
| # | Flow Name | Trigger | Primary Components | Criticality | | # | Flow Name | Trigger | Primary Components | Criticality |
|---|-----------|---------|--------------------|-------------| |---|-----------|---------|--------------------|-------------|
| F1 | Pre-flight cache preparation | Operator sync before mission | Satellite Service, Tile Manager | High | | F1 | Pre-flight cache preparation | Operator sync before mission | Satellite Service, Tile Manager | High |
| F2 | Normal frame processing | Navigation frame + FC telemetry | Camera ingest, BASALT VIO adapter, safety/anchor wrapper, MAVLink, FDR | High | | F2 | Normal frame processing | Navigation frame + FC telemetry | Camera ingest, VIO adapter, safety/anchor wrapper, MAVLink, FDR | High |
| F3 | Satellite relocalization | Cold start, VO failure, sharp turn, covariance growth, stale anchor | Satellite Service, anchor verification, safety/anchor wrapper | High | | F3 | Satellite relocalization | Cold start, VO failure, sharp turn, covariance growth, stale anchor | Satellite Service, anchor verification, safety/anchor wrapper | High |
| F4 | Visual blackout / spoofing degraded mode | Image-quality failure and GPS health failure | Camera ingest, MAVLink telemetry, safety/anchor wrapper, QGC, FDR | Critical | | F4 | Visual blackout / spoofing degraded mode | Image-quality failure and GPS health failure | Camera ingest, MAVLink telemetry, safety/anchor wrapper, QGC, FDR | Critical |
| F5 | Generated tile lifecycle | High-confidence pose + usable frame | Camera ingest, safety/anchor wrapper, Tile Manager, FDR | Medium | | F5 | Generated tile lifecycle | High-confidence pose + usable frame | Camera ingest, safety/anchor wrapper, Tile Manager, FDR | Medium |
@@ -82,12 +82,12 @@ sequenceDiagram
### Description ### Description
During normal flight, the system processes each navigation frame and FC telemetry sample. The camera component first checks for total occlusion/blackout. Usable frames go to BASALT VIO; total-occlusion frames bypass VIO and send the wrapper into IMU-only degraded propagation. During normal flight, the system processes each navigation frame and FC telemetry sample. The camera component first checks for total occlusion/blackout. Usable frames go to the VIO adapter; total-occlusion frames bypass VIO and send the wrapper into IMU-only degraded propagation.
### Preconditions ### Preconditions
- Camera calibration/extrinsics are loaded. - Camera calibration/extrinsics are loaded.
- BASALT and wrapper are initialized. - VIO adapter and wrapper are initialized.
- FC telemetry stream is healthy. - FC telemetry stream is healthy.
### Sequence Diagram ### Sequence Diagram
@@ -115,9 +115,9 @@ sequenceDiagram
| Step | From | To | Data | Format | | Step | From | To | Data | Format |
|------|------|----|------|--------| |------|------|----|------|--------|
| 1 | Camera ingest | BASALT adapter or safety wrapper | Frame metadata, image, occlusion status | Frame DTO / DegradationSignal | | 1 | Camera ingest | VIO adapter or safety wrapper | Frame metadata, image, occlusion status | Frame DTO / DegradationSignal |
| 2 | FC telemetry | BASALT adapter | IMU/attitude/altitude | MAVLink-derived telemetry DTO | | 2 | FC telemetry | VIO adapter | IMU/attitude/altitude | MAVLink-derived telemetry DTO |
| 3 | BASALT adapter | Safety wrapper | Relative VIO state | VioState DTO | | 3 | VIO adapter | Safety wrapper | Relative VIO state | VioState DTO |
| 4 | Safety wrapper | MAVLink output | WGS84 estimate | `GPS_INPUT` | | 4 | Safety wrapper | MAVLink output | WGS84 estimate | `GPS_INPUT` |
| 5 | Safety wrapper | FDR | Inputs/outputs/audit | FDR segment event | | 5 | Safety wrapper | FDR | Inputs/outputs/audit | FDR segment event |
@@ -125,9 +125,9 @@ sequenceDiagram
| Error | Where | Detection | Recovery | | Error | Where | Detection | Recovery |
|-------|-------|-----------|----------| |-------|-------|-----------|----------|
| Total occlusion / blackout | Camera ingest | Occlusion status, exposure/texture/decode checks | Bypass BASALT, enter IMU-only `dead_reckoned` propagation | | Total occlusion / blackout | Camera ingest | Occlusion status, exposure/texture/decode checks | Bypass VIO, enter IMU-only `dead_reckoned` propagation |
| Frame unreadable | Camera ingest | Decode/quality failure | Mark visual signal degraded and bypass BASALT for that frame | | Frame unreadable | Camera ingest | Decode/quality failure | Mark visual signal degraded and bypass VIO for that frame |
| VIO quality low | BASALT adapter | Tracking/completion metrics | Trigger relocalization or dead reckoning | | VIO quality low | VIO adapter | Tracking/completion metrics | Trigger relocalization or dead reckoning |
| Covariance grows | Safety wrapper | Covariance threshold | Degrade fix type/source label | | Covariance grows | Safety wrapper | Covariance threshold | Degrade fix type/source label |
### Performance Expectations ### Performance Expectations
+1 -1
View File
@@ -16,7 +16,7 @@
| AZ-225 | tile_manager_cache_manifest | 5 | AZ-220, AZ-221, AZ-222 | AZ-211 | | AZ-225 | tile_manager_cache_manifest | 5 | AZ-220, AZ-221, AZ-222 | AZ-211 |
| AZ-226 | generated_tile_orthorectification | 5 | AZ-223, AZ-225 | AZ-211 | | AZ-226 | generated_tile_orthorectification | 5 | AZ-223, AZ-225 | AZ-211 |
| AZ-227 | fdr_event_recorder | 5 | AZ-220, AZ-222 | AZ-212 | | AZ-227 | fdr_event_recorder | 5 | AZ-220, AZ-222 | AZ-212 |
| AZ-228 | basalt_vio_adapter | 5 | AZ-221, AZ-222, AZ-223, AZ-224 | AZ-213 | | AZ-228 | vio_adapter | 5 | AZ-221, AZ-222, AZ-223, AZ-224 | AZ-213 |
| AZ-229 | satellite_service_sync | 3 | AZ-222, AZ-225, AZ-226 | AZ-214 | | AZ-229 | satellite_service_sync | 3 | AZ-222, AZ-225, AZ-226 | AZ-214 |
| AZ-230 | satellite_service_vpr_retrieval | 5 | AZ-223, AZ-225, AZ-229 | AZ-214 | | AZ-230 | satellite_service_vpr_retrieval | 5 | AZ-223, AZ-225, AZ-229 | AZ-214 |
| AZ-231 | anchor_verification_matching | 5 | AZ-223, AZ-225, AZ-230 | AZ-215 | | AZ-231 | anchor_verification_matching | 5 | AZ-223, AZ-225, AZ-230 | AZ-215 |
@@ -16,10 +16,13 @@ project-root/
├── src/ ├── src/
│ ├── __init__.py │ ├── __init__.py
│ ├── camera_ingest_calibration/ │ ├── camera_ingest_calibration/
│ ├── basalt_vio_adapter/ │ ├── vio_adapter/
│ │ └── native/
│ ├── safety_anchor_wrapper/ │ ├── safety_anchor_wrapper/
│ ├── satellite_service/ │ ├── satellite_service/
│ │ └── native/
│ ├── anchor_verification/ │ ├── anchor_verification/
│ │ └── native/
│ ├── tile_manager/ │ ├── tile_manager/
│ ├── mavlink_gcs_integration/ │ ├── mavlink_gcs_integration/
│ ├── fdr_observability/ │ ├── fdr_observability/
@@ -30,10 +33,6 @@ project-root/
│ │ ├── config/ │ │ ├── config/
│ │ ├── errors/ │ │ ├── errors/
│ │ └── telemetry/ │ │ └── telemetry/
│ └── native/
│ ├── basalt_bridge/
│ ├── feature_matching/
│ └── tensor_rt/
├── migrations/ ├── migrations/
│ ├── postgresql/ │ ├── postgresql/
│ └── seed/ │ └── seed/
@@ -74,7 +73,7 @@ project-root/
### Layout Rationale ### Layout Rationale
The runtime is organized directly under `src/` because this repository already represents the GPS-denied onboard system. Component directories live at the source root, with native bridges isolated under `src/native/` for BASALT, feature matching, and TensorRT-sensitive paths. Shared contracts, geometry, time-sync, configuration, error envelopes, and telemetry DTOs are centralized so component tasks consume a single public interface instead of duplicating cross-cutting logic. The runtime is organized directly under `src/` because this repository already represents the GPS-denied onboard system. Component directories live at the source root, and native bridges stay inside the component folder that owns the backend or hot path. Shared contracts, geometry, time-sync, configuration, error envelopes, and telemetry DTOs are centralized so component tasks consume a single public interface instead of duplicating cross-cutting logic.
The scaffold separates runtime source, migrations, tests, deployment assets, configuration, and mutable data. Production runs on Jetson hardware, while Docker/compose is used for replay, SITL, and deterministic CI environments. The scaffold separates runtime source, migrations, tests, deployment assets, configuration, and mutable data. Production runs on Jetson hardware, while Docker/compose is used for replay, SITL, and deterministic CI environments.
@@ -98,8 +97,8 @@ The scaffold separates runtime source, migrations, tests, deployment assets, con
| Component | Interface | Methods | Exposed To | | Component | Interface | Methods | Exposed To |
|-----------|-----------|---------|------------| |-----------|-----------|---------|------------|
| Camera ingest/calibration | `FrameProvider` | `next_frame`, `detect_occlusion`, `classify_quality` | BASALT VIO, Satellite Service, anchor verification, Tile Manager | | Camera ingest/calibration | `FrameProvider` | `next_frame`, `detect_occlusion`, `classify_quality` | VIO Adapter, Satellite Service, anchor verification, Tile Manager |
| BASALT VIO adapter | `VioAdapter` | `initialize`, `process`, `health` | Safety wrapper, e2e tests | | VIO adapter | `VioAdapter` | `initialize`, `process`, `health` | Safety wrapper, e2e tests |
| Safety/anchor wrapper | `LocalizationStateMachine` | `update_vio`, `consider_anchor`, `degrade`, `propagate_imu_only`, `tile_write_eligibility` | MAVLink/GCS, Tile Manager, FDR, e2e tests | | Safety/anchor wrapper | `LocalizationStateMachine` | `update_vio`, `consider_anchor`, `degrade`, `propagate_imu_only`, `tile_write_eligibility` | MAVLink/GCS, Tile Manager, FDR, e2e tests |
| Satellite Service | `SatelliteService` | `import_mission_cache`, `load_index`, `retrieve`, `upload_generated_tiles` | Safety wrapper, anchor verification, Tile Manager | | Satellite Service | `SatelliteService` | `import_mission_cache`, `load_index`, `retrieve`, `upload_generated_tiles` | Safety wrapper, anchor verification, Tile Manager |
| Anchor verification | `AnchorVerifier` | `verify`, `benchmark_matcher` | Safety wrapper, FDR | | Anchor verification | `AnchorVerifier` | `verify`, `benchmark_matcher` | Safety wrapper, FDR |
@@ -174,7 +173,7 @@ tests/
├── unit/ ├── unit/
│ ├── shared/ │ ├── shared/
│ ├── camera_ingest_calibration/ │ ├── camera_ingest_calibration/
│ ├── basalt_vio_adapter/ │ ├── vio_adapter/
│ ├── safety_anchor_wrapper/ │ ├── safety_anchor_wrapper/
│ ├── satellite_service/ │ ├── satellite_service/
│ ├── anchor_verification/ │ ├── anchor_verification/
@@ -245,7 +244,7 @@ Each deployable service exposes `/health/live`, `/health/ready`, and `/metrics`
| 5 | MAVLink/GCS integration | Supplies FC telemetry DTOs and validates `GPS_INPUT` output contract early | | 5 | MAVLink/GCS integration | Supplies FC telemetry DTOs and validates `GPS_INPUT` output contract early |
| 6 | Tile Manager | Owns PostGIS cache manifest, sidecars, COG access, freshness gates, and generated-tile orthorectification | | 6 | Tile Manager | Owns PostGIS cache manifest, sidecars, COG access, freshness gates, and generated-tile orthorectification |
| 7 | FDR/observability | Provides audit path for all components and validation reports | | 7 | FDR/observability | Provides audit path for all components and validation reports |
| 8 | BASALT VIO adapter | Depends on frame and telemetry contracts, blocks wrapper integration | | 8 | VIO adapter | Depends on frame and telemetry contracts, blocks wrapper integration |
| 9 | Satellite Service | Depends on tile schema and frame DTOs, feeds anchor verification, and handles pre-flight/post-flight package sync | | 9 | Satellite Service | Depends on tile schema and frame DTOs, feeds anchor verification, and handles pre-flight/post-flight package sync |
| 10 | Anchor verification | Depends on retrieval candidates and cache tile access | | 10 | Anchor verification | Depends on retrieval candidates and cache tile access |
| 11 | Safety/anchor wrapper | Consumes VIO, anchor, camera degradation, MAVLink, and FDR contracts | | 11 | Safety/anchor wrapper | Consumes VIO, anchor, camera degradation, MAVLink, and FDR contracts |
@@ -1,21 +1,21 @@
# BASALT VIO Adapter # VIO Adapter
**Task**: AZ-228_basalt_vio_adapter **Task**: AZ-228_vio_adapter
**Name**: BASALT VIO Adapter **Name**: VIO Adapter
**Description**: Wrap BASALT as a replaceable relative VIO component with health and error behavior. **Description**: Wrap the selected relative VIO backend as a replaceable component with health and error behavior.
**Complexity**: 5 points **Complexity**: 5 points
**Dependencies**: AZ-221_shared_geometry_time_sync, AZ-222_runtime_config_errors_telemetry, AZ-223_camera_ingest_calibration, AZ-224_mavlink_gcs_gateway **Dependencies**: AZ-221_shared_geometry_time_sync, AZ-222_runtime_config_errors_telemetry, AZ-223_camera_ingest_calibration, AZ-224_mavlink_gcs_gateway
**Component**: BASALT VIO Adapter **Component**: VIO Adapter
**Tracker**: AZ-228 **Tracker**: AZ-228
**Epic**: AZ-213 **Epic**: AZ-213
## Problem ## Problem
The safety wrapper needs relative VIO state from calibrated frames and FC IMU without inheriting BASALT-specific internals. The safety wrapper needs relative VIO state from calibrated frames and FC IMU without inheriting backend-specific internals.
## Outcome ## Outcome
- BASALT initialization, processing, and health behavior are exposed through a replaceable adapter. - Backend initialization, processing, and health behavior are exposed through a replaceable adapter.
- Tracking loss and timestamp mismatch are explicit. - Tracking loss and timestamp mismatch are explicit.
- The adapter never emits WGS84 coordinates or safety decisions. - The adapter never emits WGS84 coordinates or safety decisions.
@@ -61,7 +61,7 @@ Then the adapter reports current VIO readiness and degradation state.
- Adapter processing must be profiled against Jetson latency/memory limits. - Adapter processing must be profiled against Jetson latency/memory limits.
**Reliability** **Reliability**
- BASALT failures are surfaced, not hidden. - Backend failures are surfaced, not hidden.
## Unit Tests ## Unit Tests
@@ -79,11 +79,12 @@ Then the adapter reports current VIO readiness and degradation state.
## Constraints ## Constraints
- BASALT is not the safety authority. - BASALT remains the current selected backend, but package and folder names must stay backend-neutral.
- The VIO adapter is not the safety authority.
- GPL VIO dependencies remain reference-only unless explicitly approved. - GPL VIO dependencies remain reference-only unless explicitly approved.
## Risks & Mitigation ## Risks & Mitigation
**Risk 1: Nadir fixed-wing fit** **Risk 1: Nadir fixed-wing fit**
- *Risk*: BASALT underperforms on low-parallax terrain. - *Risk*: The selected VIO backend underperforms on low-parallax terrain.
- *Mitigation*: Representative replay and reference comparisons gate acceptance. - *Mitigation*: Representative replay and reference comparisons gate acceptance.
@@ -4,7 +4,7 @@
**Name**: Safety Anchor State Machine **Name**: Safety Anchor State Machine
**Description**: Own authoritative localization state, confidence, anchor fusion, degraded modes, tile-write eligibility, and MAVLink output semantics. **Description**: Own authoritative localization state, confidence, anchor fusion, degraded modes, tile-write eligibility, and MAVLink output semantics.
**Complexity**: 5 points **Complexity**: 5 points
**Dependencies**: AZ-223_camera_ingest_calibration, AZ-224_mavlink_gcs_gateway, AZ-227_fdr_event_recorder, AZ-228_basalt_vio_adapter, AZ-231_anchor_verification_matching **Dependencies**: AZ-223_camera_ingest_calibration, AZ-224_mavlink_gcs_gateway, AZ-227_fdr_event_recorder, AZ-228_vio_adapter, AZ-231_anchor_verification_matching
**Component**: Safety And Anchor Wrapper **Component**: Safety And Anchor Wrapper
**Tracker**: AZ-232 **Tracker**: AZ-232
**Epic**: AZ-216 **Epic**: AZ-216
@@ -29,7 +29,7 @@ The product needs one safety authority that converts VIO, telemetry, camera qual
- Tile-write eligibility decisions. - Tile-write eligibility decisions.
### Excluded ### Excluded
- BASALT internals. - VIO backend internals.
- MAVLink transport implementation. - MAVLink transport implementation.
- Generated tile writing. - Generated tile writing.
@@ -87,7 +87,7 @@ Then only sufficiently trusted poses are eligible for generated tile writes.
## Constraints ## Constraints
- BASALT is not the safety authority. - The VIO backend is not the safety authority.
- The wrapper does not call Tile Manager directly during anchor acceptance; freshness/provenance arrives through anchor evidence. - The wrapper does not call Tile Manager directly during anchor acceptance; freshness/provenance arrives through anchor evidence.
## Risks & Mitigation ## Risks & Mitigation
+3
View File
@@ -0,0 +1,3 @@
# Anchor Verification Native Bridge
Reserved for native feature extraction, matching, and RANSAC acceleration code owned by `anchor_verification`.
-1
View File
@@ -1 +0,0 @@
"""BASALT VIO adapter component."""
-3
View File
@@ -1,3 +0,0 @@
# BASALT Bridge
Reserved for native BASALT integration code wrapped by `basalt_vio_adapter`.
-3
View File
@@ -1,3 +0,0 @@
# Feature Matching Bridge
Reserved for native feature extraction, matching, and RANSAC acceleration code.
-3
View File
@@ -1,3 +0,0 @@
# TensorRT Bridge
Reserved for Jetson/TensorRT descriptor inference integrations.
+3
View File
@@ -0,0 +1,3 @@
# Satellite Service Native Bridge
Reserved for ONNX/TensorRT descriptor inference integrations owned by `satellite_service`.
+1
View File
@@ -0,0 +1 @@
"""Replaceable VIO adapter component."""
@@ -1,4 +1,4 @@
"""Public BASALT VIO adapter interfaces.""" """Public VIO adapter interfaces."""
from typing import Any, Protocol from typing import Any, Protocol
+3
View File
@@ -0,0 +1,3 @@
# VIO Native Bridge
Reserved for native VIO backend integration code owned by `vio_adapter`.
@@ -1,4 +1,4 @@
"""Public BASALT VIO type aliases.""" """Public VIO type aliases."""
from typing import Any from typing import Any
+13 -2
View File
@@ -3,7 +3,7 @@ from pathlib import Path
COMPONENT_PACKAGES = [ COMPONENT_PACKAGES = [
"camera_ingest_calibration", "camera_ingest_calibration",
"basalt_vio_adapter", "vio_adapter",
"safety_anchor_wrapper", "safety_anchor_wrapper",
"satellite_service", "satellite_service",
"anchor_verification", "anchor_verification",
@@ -28,13 +28,16 @@ REQUIRED_PATHS = [
"tests/unit/test_scaffold.py", "tests/unit/test_scaffold.py",
"tests/unit/shared/.gitkeep", "tests/unit/shared/.gitkeep",
"tests/unit/camera_ingest_calibration/.gitkeep", "tests/unit/camera_ingest_calibration/.gitkeep",
"tests/unit/basalt_vio_adapter/.gitkeep", "tests/unit/vio_adapter/.gitkeep",
"tests/unit/safety_anchor_wrapper/.gitkeep", "tests/unit/safety_anchor_wrapper/.gitkeep",
"tests/unit/satellite_service/.gitkeep", "tests/unit/satellite_service/.gitkeep",
"tests/unit/anchor_verification/.gitkeep", "tests/unit/anchor_verification/.gitkeep",
"tests/unit/tile_manager/.gitkeep", "tests/unit/tile_manager/.gitkeep",
"tests/unit/mavlink_gcs_integration/.gitkeep", "tests/unit/mavlink_gcs_integration/.gitkeep",
"tests/unit/fdr_observability/.gitkeep", "tests/unit/fdr_observability/.gitkeep",
"src/vio_adapter/native/README.md",
"src/satellite_service/native/README.md",
"src/anchor_verification/native/README.md",
"tests/integration/contracts/.gitkeep", "tests/integration/contracts/.gitkeep",
"tests/blackbox/still_image_geolocation/.gitkeep", "tests/blackbox/still_image_geolocation/.gitkeep",
"tests/fixtures/project_60_images/.gitkeep", "tests/fixtures/project_60_images/.gitkeep",
@@ -98,6 +101,14 @@ def test_scaffold_paths_cover_runtime_test_and_evidence_layout() -> None:
assert missing == [] assert missing == []
def test_native_bridge_placeholders_are_component_owned() -> None:
# Act
shared_native_path_exists = Path("src/native").exists()
# Assert
assert shared_native_path_exists is False
def test_ignore_rules_exclude_runtime_payloads_and_secrets() -> None: def test_ignore_rules_exclude_runtime_payloads_and_secrets() -> None:
# Arrange # Arrange
required_patterns = [ required_patterns = [