mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-06-22 01:01:12 +00:00
Revise acceptance criteria and restrictions documentation to clarify recent updates and specifications. Key changes include enhanced definitions for position accuracy, image processing quality, and operational parameters, as well as updates to camera specifications and validation requirements. This revision aims to improve clarity and ensure alignment with project goals.
This commit is contained in:
@@ -0,0 +1,130 @@
|
||||
# Solution
|
||||
|
||||
## Product Solution Description
|
||||
|
||||
Build an onboard GPS-denied localization service that runs on the Jetson companion computer, uses the fixed downward navigation camera and flight-controller inertial telemetry, and emits ArduPilot `GPS_INPUT` estimates with calibrated covariance and source labels.
|
||||
|
||||
The production architecture is a trigger-based hybrid estimator:
|
||||
|
||||
```text
|
||||
Nav camera + FC telemetry
|
||||
|
|
||||
v
|
||||
Image quality + calibration + orthorectification
|
||||
|
|
||||
+--> Hot path: OpenCV geometry + BASALT VIO --> safety/anchor wrapper --> GPS_INPUT + QGC + FDR
|
||||
|
|
||||
+--> Reference path: OpenVINS replay benchmark for VIO drift/covariance tests; Kimera backup replay
|
||||
|
|
||||
+--> Trigger path: DINOv2-VLAD query --> CPU FAISS top-K --> ALIKED/DISK+LightGlue --> OpenCV RANSAC --> safety/anchor wrapper
|
||||
|
|
||||
+--> Tile path: new COG tile + quality/provenance sidecar --> manifest update --> post-flight Satellite Service sync
|
||||
```
|
||||
|
||||
Heavy retrieval and local matching are not steady-state per-frame dependencies. They run on cold start, VO failure, sharp turns, disconnected segments, covariance growth, stale-anchor age, or operator-assisted relocalization.
|
||||
|
||||
## Architecture
|
||||
|
||||
### Camera Ingest, Calibration, And Geometry
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Fit |
|
||||
|----------|-------|--------------------|-----|
|
||||
| OpenCV geometry utility layer | OpenCV 4.x | Calibration, undistortion, homography, RANSAC/USAC, MRE measurement | Selected. Mature, permissive, exact utility fit; not a full estimator. |
|
||||
|
||||
### VO / IMU Propagation And Estimator
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Fit |
|
||||
|----------|-------|--------------------|-----|
|
||||
| BASALT + safety/anchor wrapper | BASALT, OpenCV, custom wrapper | BASALT consumes calibrated nav-camera frames + FC IMU; wrapper fuses satellite anchors, calibrates uncertainty, emits source labels and `GPS_INPUT` fields | Selected. Best production VIO candidate found: permissive license, strong benchmark evidence, avoids custom VIO from scratch. |
|
||||
| OpenVINS | OpenVINS | Monocular camera + IMU EKF/MSCKF reference runs with covariance extraction | Reference only. Strong VIO and covariance baseline, but GPLv3 and generic VIO ownership make it unsuitable as default shipped dependency. |
|
||||
| Kimera-VIO | Kimera-VIO | Mono/stereo camera + IMU VIO/SLAM backup replay | Backup candidate. BSD-friendly but heavier/stereo-oriented; mono-inertial path has documented caveats. |
|
||||
| ORB-SLAM3 | ORB-SLAM3 | Monocular-inertial SLAM | Rejected for production. GPLv3 and heavier SLAM/map lifecycle. |
|
||||
|
||||
BASALT does not replace the project-owned safety logic. The wrapper remains responsible for satellite anchor acceptance, confidence calibration, source labels, blackout/spoofing modes, tile-write eligibility, and MAVLink `GPS_INPUT` semantics.
|
||||
|
||||
### Satellite Retrieval And Anchor Verification
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Fit |
|
||||
|----------|-------|--------------------|-----|
|
||||
| DINOv2-VLAD + CPU FAISS + ALIKED/DISK+LightGlue | DINOv2/AnyLoc-style descriptors, FAISS CPU, LightGlue, OpenCV RANSAC | Offline VPR chunk descriptors; conditional query descriptor; CPU FAISS top-K; learned local match on bounded candidates; TensorRT only after fidelity check | Selected with runtime/fidelity gates. |
|
||||
| SuperPoint+LightGlue | SuperPoint, LightGlue | Same matcher with SuperPoint features | License-gated benchmark/fallback only. |
|
||||
| Classical SIFT/ORB | OpenCV | Handcrafted features + homography | Regression/fallback baseline. |
|
||||
|
||||
The VPR index is built over ground-footprint-sized chunks with overlap and a multi-scale descriptor set. VPR is invoked only on relocalization triggers or covariance/anchor-age growth; normal flight uses BASALT VIO plus wrapper propagation.
|
||||
|
||||
### Cache And Tile Lifecycle
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Fit |
|
||||
|----------|-------|--------------------|-----|
|
||||
| COG tile objects + PostgreSQL/PostGIS manifest + signed JSON sidecars | GDAL COG, PostgreSQL/PostGIS, signed JSON sidecars, FAISS index files | Service tiles and generated tiles are write-new COG objects; active version selected by PostGIS-backed manifest | Selected. Fits geospatial raster access, provenance, spatial/freshness queries, and write-new tile lifecycle. |
|
||||
| PMTiles | PMTiles | Read-only archive snapshot | Rejected for live cache because in-flight tile generation needs mutable write-new objects. |
|
||||
|
||||
Service-source tiles and generated tiles carry CRS, capture date, source, m/px, freshness, quality score, sidecar hashes, and descriptor references. Stale tiles are rejected or down-confidence weighted.
|
||||
|
||||
### MAVLink Integration
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Fit |
|
||||
|----------|-------|--------------------|-----|
|
||||
| MAVSDK telemetry + pymavlink `GPS_INPUT` | MAVSDK, pymavlink | MAVSDK subscriptions; pymavlink emits `GPS_INPUT`; v1 emits GPS_INPUT only; Plane SITL validates `GPS1_TYPE=14`, velocity source params, ignore flags, fix types, accuracy fields | Selected. Exact output control with good telemetry ergonomics. |
|
||||
|
||||
The system emits per-frame estimates locally and downsampled status to QGroundControl. `GPS_INPUT.horiz_accuracy` must not under-report the calibrated 95% covariance semi-major axis.
|
||||
|
||||
### Security And Safety Controls
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Fit |
|
||||
|----------|-------|--------------------|-----|
|
||||
| Consistency-gated anchor acceptance | Safety/anchor wrapper, cache manifest verification | Anchor accepted only if freshness, provenance, RANSAC, covariance, Mahalanobis, and temporal consistency pass | Selected. Prevents confident false fixes. |
|
||||
| FDR audit trail | PostgreSQL event index + CBOR payload segments + hashes | Logs estimates, inputs, emitted GPS_INPUT, health, tile writes, anchor decisions | Selected. Supports incident analysis, indexed queries, and cache-poisoning audits. |
|
||||
|
||||
## Runtime Modes
|
||||
|
||||
| Mode | Trigger | Behavior | `GPS_INPUT` / Telemetry |
|
||||
|------|---------|----------|--------------------------|
|
||||
| `satellite_anchored` | VPR + local match passes all gates | Wrapper absolute update; tile write eligible only if sigma gate passes | 3D fix, `horiz_accuracy` >= 95% covariance semi-major axis |
|
||||
| `vo_extrapolated` | BASALT VIO healthy and anchor age/covariance within bounds | BASALT VIO + wrapper propagation; covariance grows | 3D/2D depending covariance threshold |
|
||||
| `dead_reckoned` | visual blackout or no accepted anchor | IMU-only propagation, monotonic covariance growth | degraded fix type; QGC `VISUAL_BLACKOUT_IMU_ONLY` |
|
||||
| failsafe/no-fix | covariance >500 m or blackout >30 s | stop pretending position is valid | `fix_type=0`, `horiz_accuracy=999.0`, QGC `VISUAL_BLACKOUT_FAILSAFE` |
|
||||
|
||||
## Testing Strategy
|
||||
|
||||
### Integration / Functional Tests
|
||||
|
||||
- BASALT replay: assert AC-2.1a and AC-2.2 VO MRE on overlapping frame pairs, completion rate, latency, and wrapper-calibrated covariance.
|
||||
- OpenVINS reference replay: compare VIO drift, failure cases, and covariance against BASALT + wrapper.
|
||||
- Kimera-VIO backup replay: keep a second permissive candidate benchmark in case BASALT fails project replay/runtime gates.
|
||||
- Satellite anchor replay: assert AC-1.1/1.2, AC-2.2 cross-domain MRE, freshness rejection, and source labels.
|
||||
- DINOv2 descriptor fidelity: compare PyTorch/ONNX/TensorRT embeddings and retrieval rankings before accepting optimized engines.
|
||||
- FAISS CPU index tests: top-K recall, query latency, index size, save/load behavior on Jetson ARM64.
|
||||
- LightGlue extractor matrix: ALIKED vs DISK vs SIFT/ORB vs SuperPoint benchmark; SuperPoint excluded from production unless legal approves.
|
||||
- COG cache lifecycle: write-new generated tile, update manifest, verify active version and rollback.
|
||||
- `GPS_INPUT` SITL: validate fix type, `horiz_accuracy`, velocity fields, ignore flags, `EK3_SRC1_*` parameters, QGC behavior.
|
||||
- Security gates: stale tile, mismatched tile hash, low inlier ratio, impossible velocity jump, and spoofed GPS during blackout.
|
||||
|
||||
### Non-Functional Tests
|
||||
|
||||
- Jetson latency and memory: <400 ms p95, <8 GB shared memory, no 25 W thermal throttle.
|
||||
- Cache budget: 400 km² imagery + manifests + descriptors fits budget or reports explicit split budget.
|
||||
- FDR 8-hour load: <=64 GB, rollover logged, no silent payload loss.
|
||||
- Monte Carlo false-position and cache-poisoning tests for AC-NEW-4 and AC-NEW-7.
|
||||
- Cold boot: first valid `GPS_INPUT` <30 s p95 across 50 runs.
|
||||
|
||||
## References
|
||||
|
||||
Detailed source registry: `_docs/00_research/01_source_registry.md`.
|
||||
|
||||
Key sources:
|
||||
- BASALT repository: https://github.com/VladyslavUsenko/basalt
|
||||
- HybVIO benchmark paper: https://arxiv.org/pdf/2106.11857
|
||||
- OpenVINS docs: https://docs.openvins.com/index.html
|
||||
- OpenVINS ATE/RTE comparison: https://github.com/rpng/open_vins/issues/402
|
||||
- Kimera mono-inertial caveat: https://github.com/MIT-SPARK/Kimera-VIO/issues/254
|
||||
- AnyLoc paper: https://arxiv.org/html/2308.00688
|
||||
- Aerial VPR survey: https://arxiv.org/abs/2406.00885
|
||||
- ALIKED-LightGlue-ONNX: https://github.com/ikeboo/ALIKED-LightGlue-ONNX
|
||||
- DINOv2 TensorRT issue: https://github.com/NVIDIA/TensorRT/issues/4348
|
||||
|
||||
## Related Artifacts
|
||||
|
||||
- Tech stack evaluation: `_docs/01_solution/tech_stack.md`
|
||||
- Component fit matrix: `_docs/00_research/06_component_fit_matrix.md`
|
||||
- Fact cards: `_docs/00_research/02_fact_cards.md`
|
||||
@@ -0,0 +1,149 @@
|
||||
# Solution Draft
|
||||
|
||||
## Product Solution Description
|
||||
|
||||
Build an onboard GPS-denied localization service that runs on the companion Jetson, consumes the fixed nadir navigation camera plus flight-controller IMU/attitude/altitude, and emits ArduPilot-compatible `GPS_INPUT` estimates with honest covariance.
|
||||
|
||||
The solution is a hybrid estimator:
|
||||
|
||||
```text
|
||||
Nav camera + FC telemetry
|
||||
|
|
||||
v
|
||||
Image quality + calibration + orthorectification
|
||||
|
|
||||
+--> Steady state: VO/IMU propagation --> ESKF --> GPS_INPUT + QGC + FDR
|
||||
|
|
||||
+--> Re-anchor triggers: VPR top-K --> local match/RANSAC --> ESKF anchor update
|
||||
|
|
||||
+--> Tile generation: ortho tile + quality sidecar --> local cache --> post-flight Satellite Service upload
|
||||
```
|
||||
|
||||
The steady-state path is intentionally lightweight. Heavy global retrieval and cross-domain local matching run only on cold start, VO failure, sharp turns, disconnected segments, covariance growth, or stale-anchor age.
|
||||
|
||||
## Existing / Competitor Solutions Analysis
|
||||
|
||||
Recent fixed-wing GPS-denied research supports the same high-level mechanism: monocular visual odometry alone accumulates scale/drift error, while satellite-image comparison can periodically correct it. Aerial VPR surveys also show why the implementation cannot be naive: weather, season, scale mismatch, repetitive fields, tile overlap, and re-ranking runtime all matter.
|
||||
|
||||
The selected design borrows the proven structure but rejects an all-in-one SLAM dependency as the product core. OpenVINS and ORB-SLAM3 are useful benchmark/reference implementations, but their GPL-family licensing and broader SLAM lifecycle do not fit a default production dependency for this project.
|
||||
|
||||
## Architecture
|
||||
|
||||
### Component: Camera Ingest, Calibration, And Geometry
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Advantages | Limitations | Requirements | Security | Cost | API Capability Evidence | Fit |
|
||||
|----------|-------|--------------------|------------|-------------|--------------|----------|------|-------------------------|-----|
|
||||
| OpenCV geometry utility layer | OpenCV 4.x | Camera calibration, undistortion, RANSAC homography, reprojection-error measurement | Mature, local, fast, exact API fit | Not a full estimator | Calibration target, fixed intrinsics/extrinsics, lens/FOV selection | Local-only, no network | Low | MVE: `_docs/00_research/02_fact_cards.md`; Source #5 | Selected |
|
||||
|
||||
**Exact-fit evidence**:
|
||||
- Project constraints checked: fixed nadir camera, calibration, homography, MRE gates.
|
||||
- Disqualifiers: none.
|
||||
- Restrictions × AC matrix: `_docs/00_research/06_component_fit_matrix.md`.
|
||||
|
||||
### Component: VO / IMU Propagation And Estimator
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Advantages | Limitations | Requirements | Security | Cost | API Capability Evidence | Fit |
|
||||
|----------|-------|--------------------|------------|-------------|--------------|----------|------|-------------------------|-----|
|
||||
| Custom VO/IMU ESKF | OpenCV + custom estimator | Frame-to-frame homography/features + FC IMU/attitude/altitude fused in a custom ESKF with source modes | Owns covariance, source labels, degraded modes, ArduPilot output semantics | More implementation work than adopting VIO library | Synchronized frames/IMU, calibration, replay tests | No third-party cloud; deterministic local logs | Medium | Facts #1, #4, #5, #16 | Selected |
|
||||
| OpenVINS reference | OpenVINS | Monocular camera + IMU EKF/MSCKF reference runs | Strong VIO reference and evaluation tools | GPL-3 production dependency risk | Dataset/replay adapter | Local only | Low for benchmark | Source #3 | Reference only |
|
||||
| ORB-SLAM3 alternative | ORB-SLAM3 | Monocular-inertial SLAM | Mature SLAM benchmark | GPLv3, heavier map lifecycle, initialization complexity | Calibration, vocabulary, runtime tuning | Local only | Medium | Source #4 | Rejected for production |
|
||||
|
||||
**Exact-fit evidence**:
|
||||
- Project constraints checked: one camera + IMU, frame-by-frame output, covariance labels, blackout/spoofing modes.
|
||||
- Runtime quality gate: validate drift and covariance on EuRoC-style and representative fixed-wing replay.
|
||||
|
||||
### Component: Satellite Retrieval And Local Anchor
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Advantages | Limitations | Requirements | Security | Cost | API Capability Evidence | Fit |
|
||||
|----------|-------|--------------------|------------|-------------|--------------|----------|------|-------------------------|-----|
|
||||
| DINOv2-VLAD + FAISS + LightGlue | DINOv2/AnyLoc-style descriptors, FAISS, DISK/ALIKED+LightGlue, OpenCV RANSAC | Offline precomputed VPR chunk descriptors; conditional query descriptor; top-K FAISS; local matching on candidates | Matches AC-8.6; scalable top-K; local geometry verifies anchors | Needs Jetson profiling and model-size pruning | Fresh satellite cache, descriptors, dynamic K, RANSAC gates | Cache is local; no in-flight provider calls | Medium-high | MVE blocks in `02_fact_cards.md`; Sources #6-#9 | Selected with runtime gate |
|
||||
| SuperPoint + LightGlue | SuperPoint, LightGlue | Same local matching with SuperPoint features | Strong technical baseline | SuperPoint license is restrictive | Legal review | Local only | Medium | Source #6 | Needs user decision |
|
||||
| Classical SIFT/ORB-only | OpenCV | Handcrafted features and homography | Simple fallback, low compute | Poor cross-domain robustness | Feature-rich scenes | Local only | Low | Source #5 | Fallback / regression baseline |
|
||||
|
||||
**Exact-fit evidence**:
|
||||
- Project constraints checked: offline cache, top-K dynamic retrieval, cross-domain local match, <400 ms hot-path constraint.
|
||||
- Runtime gate: heavy VPR/re-ranking is trigger-based, not per-frame.
|
||||
|
||||
### Component: Satellite Cache And Tile Write-Back
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Advantages | Limitations | Requirements | Security | Cost | API Capability Evidence | Fit |
|
||||
|----------|-------|--------------------|------------|-------------|--------------|----------|------|-------------------------|-----|
|
||||
| COG + PostgreSQL/PostGIS manifest + descriptor sidecars | GDAL COG, PostgreSQL/PostGIS manifest, FAISS sidecars | Service tiles and generated candidate tiles stored as tiled compressed GeoTIFFs with CRS/date/source/meter-per-pixel metadata | Geospatial standard, supports write-new-tile workflow, descriptor accounting | Needs careful 10 GB budget | STAC-like manifest, freshness gates, descriptor pruning | Local signed manifests recommended | Medium | Source #18 | Selected |
|
||||
| PMTiles archive | PMTiles | Single-file read archive | Efficient map reads | Read-only; cannot update in place | Archive rebuild for updates | Local file integrity | Low | Source #17 | Rejected for live mutable cache |
|
||||
|
||||
**Exact-fit evidence**:
|
||||
- Project constraints checked: offline-only, no raw photo storage, mid-flight generated tiles, Satellite Service ingest metadata.
|
||||
- External dependency: Satellite Service owns the promotion/voting layer for trusted basemap updates.
|
||||
|
||||
### Component: MAVLink Integration And Telemetry
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Advantages | Limitations | Requirements | Security | Cost | API Capability Evidence | Fit |
|
||||
|----------|-------|--------------------|------------|-------------|--------------|----------|------|-------------------------|-----|
|
||||
| MAVSDK telemetry + pymavlink output | MAVSDK, pymavlink | MAVSDK subscribes to telemetry; pymavlink emits `GPS_INPUT` to ArduPilot with `GPS1_TYPE=14` | Exact `GPS_INPUT` field control while keeping high-level telemetry APIs | Plane-specific failsafe/spoof triggers need SITL proof | ArduPilot Plane params, QGC status, FDR tlog | Validate MAVLink source and message rate | Medium | Sources #10-#12 | Selected |
|
||||
|
||||
**Exact-fit evidence**:
|
||||
- Project constraints checked: ArduPilot only, v1 `GPS_INPUT` only, WGS84 output, covariance to `horiz_accuracy`.
|
||||
- Validation gate: Plane SITL with production parameters.
|
||||
|
||||
### Component: Flight Data Recorder
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Advantages | Limitations | Requirements | Security | Cost | API Capability Evidence | Fit |
|
||||
|----------|-------|--------------------|------------|-------------|--------------|----------|------|-------------------------|-----|
|
||||
| Segmented FDR | PostgreSQL event index + binary/CBOR payloads with Parquet export post-flight | Fixed-size segment files for per-frame estimates, IMU, MAVLink, health, emitted GPS_INPUT, generated-tile metadata | Replayable, bounded, no raw frame retention | Exact format selected during implementation | Rollover policy, monotonic timestamps | Integrity hash per segment recommended | Medium | AC-NEW-3 | Selected pattern |
|
||||
|
||||
## Runtime Modes
|
||||
|
||||
| Mode | Trigger | Behavior | Output Label |
|
||||
|------|---------|----------|--------------|
|
||||
| Satellite anchored | VPR + local match passes freshness, RANSAC, covariance, and Mahalanobis gates | ESKF absolute update, low covariance, tile generation eligible if sigma gate passes | `satellite_anchored` |
|
||||
| VO extrapolated | Last anchor fresh enough, VO healthy, normal overlap | VO/IMU propagation, covariance grows with anchor age | `vo_extrapolated` |
|
||||
| Dead reckoned | Visual blackout, VO failure without anchor, spoofing while no visual signal | IMU-only propagation, monotonic covariance growth, degraded fix type thresholds | `dead_reckoned` |
|
||||
| Failsafe / no fix | Blackout >30 s or covariance >500 m | `GPS_INPUT.fix_type=0`, `horiz_accuracy=999.0`, QGC status | `dead_reckoned` with failsafe status |
|
||||
|
||||
## Testing Strategy
|
||||
|
||||
### Integration / Functional Tests
|
||||
|
||||
- Replay normal overlapping frames and assert AC-2.1a VO registration rate and AC-2.2 VO MRE.
|
||||
- Replay satellite-anchor cases and assert AC-1.1/1.2, AC-2.2 cross-domain MRE, freshness gates, and source labels.
|
||||
- Inject stale tiles and assert no `satellite_anchored` output.
|
||||
- Inject sharp turns and disconnected segments and assert VPR relocalization.
|
||||
- Run ArduPilot Plane SITL with `GPS1_TYPE=14` and assert valid `GPS_INPUT` fields, fix type degradation, and QGC statuses.
|
||||
- Inject visual blackout + spoofed GPS and assert spoofed GPS is ignored, covariance grows, and thresholds match AC-NEW-8.
|
||||
- Request AI-camera object coordinates and assert level-flight projection plus maneuver error bound.
|
||||
|
||||
### Non-Functional Tests
|
||||
|
||||
- Jetson Orin Nano Super profiling: <400 ms p95, <8 GB shared memory, 25 W no-throttle hot-soak.
|
||||
- Cache build test for 400 km²: imagery + manifests + descriptors fit within budget or fail with explicit budget report.
|
||||
- 8-hour FDR load test: <=64 GB, rollover logged, no silent data loss.
|
||||
- Monte Carlo false-anchor and over-confidence tests for AC-NEW-4 and AC-NEW-7.
|
||||
- Cold boot 50x: first valid `GPS_INPUT` <30 s p95.
|
||||
|
||||
## References
|
||||
|
||||
Detailed source registry: `_docs/00_research/01_source_registry.md`.
|
||||
|
||||
Key sources:
|
||||
- Fixed-wing satellite-aided VO: https://www.mdpi.com/2076-3417/14/16/7420
|
||||
- Aerial VPR survey: https://arxiv.org/abs/2406.00885
|
||||
- OpenVINS docs: https://docs.openvins.com/
|
||||
- ORB-SLAM3 README: https://raw.githubusercontent.com/UZ-SLAMLab/ORB_SLAM3/master/README.md
|
||||
- LightGlue README: https://raw.githubusercontent.com/cvg/LightGlue/main/README.md
|
||||
- FAISS docs: https://faiss.ai/index.html
|
||||
- ArduPilot GPSInput: https://ardupilot.org/mavproxy/docs/modules/GPSInput.html
|
||||
- MAVLink GPS_INPUT: https://mavlink.io/en/messages/common.html#GPS_INPUT
|
||||
- Jetson Orin Nano Super: https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-orin/nano-super-developer-kit/
|
||||
- PMTiles: https://docs.protomaps.com/pmtiles/
|
||||
- GDAL COG: https://gdal.org/en/stable/drivers/raster/cog.html
|
||||
|
||||
## Related Artifacts
|
||||
|
||||
- AC assessment: `_docs/00_research/00_ac_assessment.md`
|
||||
- Question decomposition: `_docs/00_research/00_question_decomposition.md`
|
||||
- Source registry: `_docs/00_research/01_source_registry.md`
|
||||
- Fact cards: `_docs/00_research/02_fact_cards.md`
|
||||
- Comparison framework: `_docs/00_research/03_comparison_framework.md`
|
||||
- Reasoning chain: `_docs/00_research/04_reasoning_chain.md`
|
||||
- Validation log: `_docs/00_research/05_validation_log.md`
|
||||
- Component fit matrix: `_docs/00_research/06_component_fit_matrix.md`
|
||||
@@ -0,0 +1,125 @@
|
||||
# Solution Draft
|
||||
|
||||
## Assessment Findings
|
||||
|
||||
| Old Component Solution | Weak Point (functional/security/performance) | New Solution |
|
||||
|------------------------|----------------------------------------------|-------------|
|
||||
| DINOv2-VLAD with possible TensorRT optimization | TensorRT conversion may produce limited speedup and can alter embedding distances on Jetson-class deployments. | Keep DINOv2-VLAD, but require descriptor-fidelity tests against PyTorch/ONNX before TensorRT descriptors are accepted. |
|
||||
| FAISS CPU/GPU optional | FAISS GPU is not a safe default on Jetson ARM64/aarch64 packaging. | Pin FAISS as CPU-first on Jetson; use PQ/IVF and top-K caps before considering custom GPU builds. |
|
||||
| LightGlue local matcher | SuperPoint path has license risk and community confusion. | Keep DISK/ALIKED+LightGlue as production default; SuperPoint remains license-gated benchmark/fallback only. |
|
||||
| COG cache | "COG cache" could be misread as mutable in-place raster updates. | Use write-new COG tile objects plus manifest versioning and sidecars; never mutate COGs in place. |
|
||||
| `GPS_INPUT` output | ArduPilot velocity ignore flags have reported EKF3 pitfalls. | SITL must validate velocity source parameters, ignore flags, and whether zero velocity is ever fused accidentally. |
|
||||
| Visual/satellite anchoring | Draft did not emphasize adversarial/cache integrity enough. | Add signed cache manifests, tile provenance, freshness gates, anchor consistency checks, and FDR audit trail. |
|
||||
|
||||
## Product Solution Description
|
||||
|
||||
Build an onboard GPS-denied localization service that runs on the Jetson companion computer, uses the fixed downward navigation camera and flight-controller inertial telemetry, and emits ArduPilot `GPS_INPUT` estimates with calibrated covariance and source labels.
|
||||
|
||||
The production architecture is a trigger-based hybrid estimator:
|
||||
|
||||
```text
|
||||
Nav camera + FC telemetry
|
||||
|
|
||||
v
|
||||
Image quality + calibration + orthorectification
|
||||
|
|
||||
+--> Hot path: VO/IMU propagation --> custom ESKF --> GPS_INPUT + QGC + FDR
|
||||
|
|
||||
+--> Trigger path: DINOv2-VLAD query --> CPU FAISS top-K --> DISK/ALIKED+LightGlue --> RANSAC --> ESKF anchor
|
||||
|
|
||||
+--> Tile path: new COG tile + quality/provenance sidecar --> manifest update --> post-flight Satellite Service sync
|
||||
```
|
||||
|
||||
Heavy retrieval and local matching are not steady-state per-frame dependencies. They run on cold start, VO failure, sharp turns, disconnected segments, covariance growth, or stale-anchor age.
|
||||
|
||||
## Architecture
|
||||
|
||||
### Component: Camera Ingest, Calibration, And Geometry
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Advantages | Limitations | Requirements | Security | Performance | API Capability Evidence | Fit |
|
||||
|----------|-------|--------------------|------------|-------------|--------------|----------|-------------|-------------------------|-----|
|
||||
| OpenCV geometry utility layer | OpenCV 4.x | Calibration, undistortion, RANSAC homography, MRE measurement | Mature, exact fit, permissive | Not a full estimator | Checkerboard calibration, fixed extrinsics, lens/FOV selection | Local-only | Fast enough for hot-path utility use | MVE in `02_fact_cards.md`; Source #5 | Selected |
|
||||
|
||||
### Component: VO / IMU Propagation And Estimator
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Advantages | Limitations | Requirements | Security | Performance | API Capability Evidence | Fit |
|
||||
|----------|-------|--------------------|------------|-------------|--------------|----------|-------------|-------------------------|-----|
|
||||
| Custom VO/IMU ESKF | OpenCV + custom estimator | Nadir VO/homography + FC IMU/attitude/altitude fused in ESKF with mode labels | Owns covariance, source labels, blackout/spoofing behavior | More implementation effort | Synchronized frames/IMU, calibration, replay tests | No network dependency | Hot path is lightweight | Facts #1, #16 | Selected |
|
||||
| OpenVINS | OpenVINS | Monocular+IMU reference runs | Strong EKF/MSCKF reference | GPL-3 production risk | Replay adapter | Local only | Benchmark only | Source #3 | Reference only |
|
||||
| ORB-SLAM3 | ORB-SLAM3 | Monocular-inertial SLAM | Mature benchmark | GPLv3 and heavier SLAM lifecycle | Calibration/vocabulary/runtime tuning | Local only | Riskier on embedded | Source #4 | Rejected for production |
|
||||
|
||||
### Component: Satellite Retrieval And Anchor Verification
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Advantages | Limitations | Requirements | Security | Performance | API Capability Evidence | Fit |
|
||||
|----------|-------|--------------------|------------|-------------|--------------|----------|-------------|-------------------------|-----|
|
||||
| DINOv2-VLAD + CPU FAISS + DISK/ALIKED+LightGlue | DINOv2/AnyLoc-style descriptors, FAISS CPU, LightGlue, OpenCV RANSAC | Offline VPR chunk descriptors; conditional query descriptor; CPU FAISS top-K; local match on candidates; TensorRT only after fidelity check | Strong retrieval+geometry structure; avoids per-frame map search | Requires profiling and representative data | Descriptor cache, dynamic K, freshness, RANSAC, Mahalanobis gates | Signed manifests, provenance, stale-tile rejection | Trigger path only; top-K capped | MVE blocks in `02_fact_cards.md`; Sources #6-#9, #21-#25 | Selected with runtime/fidelity gates |
|
||||
| SuperPoint+LightGlue | SuperPoint, LightGlue | Same matcher with SuperPoint features | Strong technical baseline | SuperPoint license risk | Legal review | Local only | Benchmark only | Sources #6, #23 | Needs user decision |
|
||||
| Classical SIFT/ORB | OpenCV | Handcrafted features + homography | Simple and cheap | Weak cross-domain robustness | Feature-rich scenes | Local only | Fast | Source #5 | Regression baseline |
|
||||
|
||||
### Component: Cache And Tile Lifecycle
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Advantages | Limitations | Requirements | Security | Performance | API Capability Evidence | Fit |
|
||||
|----------|-------|--------------------|------------|-------------|--------------|----------|-------------|-------------------------|-----|
|
||||
| COG tile objects + manifest + sidecars | GDAL COG, manifest DB/JSON, FAISS index files | Service tiles and generated tiles are write-new COG objects; active version selected by manifest | Geospatial standard, supports provenance and quality metadata | Descriptor budget pressure | CRS/date/source/m/px/freshness, sidecar hashes | Signed manifests, tile provenance, hash verification | Efficient local reads | Source #18; Facts #21, #29 | Selected |
|
||||
| PMTiles | PMTiles | Read-only archive snapshot | Compact read package | Cannot update in place | Archive rebuild | Hash archive | Good for read-only export | Source #17 | Rejected for live cache |
|
||||
|
||||
### Component: MAVLink Integration
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Advantages | Limitations | Requirements | Security | Performance | API Capability Evidence | Fit |
|
||||
|----------|-------|--------------------|------------|-------------|--------------|----------|-------------|-------------------------|-----|
|
||||
| MAVSDK telemetry + pymavlink `GPS_INPUT` | MAVSDK, pymavlink | MAVSDK subscriptions; pymavlink emits `GPS_INPUT`; Plane SITL validates `GPS1_TYPE=14`, velocity source params, ignore flags, fix types, accuracy fields | Exact output control with good telemetry ergonomics | SITL required to prove Plane behavior | ArduPilot Plane params, QGC, tlog/FDR | Link/source validation, status audit | Light CPU load | Sources #10-#12, #24 | Selected |
|
||||
|
||||
### Component: Security And Safety Controls
|
||||
|
||||
| Solution | Tools | Pinned Mode/Config | Advantages | Limitations | Requirements | Security | Performance | API Capability Evidence | Fit |
|
||||
|----------|-------|--------------------|------------|-------------|--------------|----------|-------------|-------------------------|-----|
|
||||
| Consistency-gated anchor acceptance | Custom ESKF gates, cache manifest verification | Anchor accepted only if freshness, provenance, RANSAC, covariance, Mahalanobis, and temporal consistency pass | Prevents confident false fixes | Needs calibrated thresholds | Representative replay and Monte Carlo | Rejects stale/poisoned/low-confidence anchors | Lightweight after candidate generation | Facts #16, #17, #28 | Selected |
|
||||
| FDR audit trail | Segmented logs + hashes | Logs estimates, inputs, emitted GPS_INPUT, health, tile writes, anchor decisions | Supports incident analysis and cache-poisoning audits | Schema work | 64 GB rollover | Tamper-evident hashes recommended | Sequential writes | AC-NEW-3 | Selected |
|
||||
|
||||
## Runtime Modes
|
||||
|
||||
| Mode | Trigger | Behavior | `GPS_INPUT` / Telemetry |
|
||||
|------|---------|----------|--------------------------|
|
||||
| `satellite_anchored` | VPR + local match passes all gates | ESKF absolute update; tile write eligible only if sigma gate passes | 3D fix, `horiz_accuracy` >= 95% covariance semi-major axis |
|
||||
| `vo_extrapolated` | VO healthy and anchor age/covariance within bounds | VO/IMU propagation; covariance grows | 3D/2D depending covariance threshold |
|
||||
| `dead_reckoned` | visual blackout or no accepted anchor | IMU-only propagation, monotonic covariance growth | degraded fix type; QGC `VISUAL_BLACKOUT_IMU_ONLY` |
|
||||
| failsafe/no-fix | covariance >500 m or blackout >30 s | stop pretending position is valid | `fix_type=0`, `horiz_accuracy=999.0`, QGC `VISUAL_BLACKOUT_FAILSAFE` |
|
||||
|
||||
## Testing Strategy
|
||||
|
||||
### Integration / Functional Tests
|
||||
|
||||
- VO replay: assert AC-2.1a and AC-2.2 VO MRE on overlapping frame pairs.
|
||||
- Satellite anchor replay: assert AC-1.1/1.2, AC-2.2 cross-domain MRE, freshness rejection, and source labels.
|
||||
- DINOv2 descriptor fidelity: compare PyTorch/ONNX/TensorRT embeddings and retrieval rankings before accepting optimized engines.
|
||||
- FAISS CPU index tests: top-K recall, query latency, index size, save/load behavior on Jetson ARM64.
|
||||
- LightGlue extractor matrix: DISK vs ALIKED vs SuperPoint benchmark; SuperPoint output excluded from production unless license approved.
|
||||
- COG cache lifecycle: write-new generated tile, update manifest, verify active version and rollback.
|
||||
- `GPS_INPUT` SITL: validate fix type, `horiz_accuracy`, velocity fields, ignore flags, `EK3_SRC1_*` parameters, QGC behavior.
|
||||
- Security gates: stale tile, mismatched tile hash, low inlier ratio, impossible velocity jump, and spoofed GPS during blackout.
|
||||
|
||||
### Non-Functional Tests
|
||||
|
||||
- Jetson latency and memory: <400 ms p95, <8 GB shared memory, no 25 W thermal throttle.
|
||||
- Cache budget: 400 km² imagery + manifests + descriptors fits budget or reports explicit split budget.
|
||||
- FDR 8-hour load: <=64 GB, rollover logged, no silent payload loss.
|
||||
- Monte Carlo false-position and cache-poisoning tests for AC-NEW-4 and AC-NEW-7.
|
||||
- Cold boot: first valid `GPS_INPUT` <30 s p95 across 50 runs.
|
||||
|
||||
## References
|
||||
|
||||
Detailed source registry: `_docs/00_research/01_source_registry.md`.
|
||||
|
||||
Key added Mode B sources:
|
||||
- DINOv2 TensorRT issue: https://github.com/NVIDIA/TensorRT/issues/4348
|
||||
- DINOv2 Jetson forum issue: https://forums.developer.nvidia.com/t/dinov2-tensorrt-model-performance-issue/312251
|
||||
- LightGlue license discussion: https://github.com/cvg/LightGlue/issues/120
|
||||
- ArduPilot GPS_INPUT velocity issue: https://github.com/ArduPilot/ardupilot/issues/19633
|
||||
- FAISS install docs: https://github.com/facebookresearch/faiss/blob/main/INSTALL.md
|
||||
- Orthophoto visual geolocalization: https://ar5iv.labs.arxiv.org/html/2103.14381
|
||||
|
||||
## Related Artifacts
|
||||
|
||||
- Tech stack evaluation: `_docs/01_solution/tech_stack.md`
|
||||
- Component fit matrix: `_docs/00_research/06_component_fit_matrix.md`
|
||||
- Fact cards: `_docs/00_research/02_fact_cards.md`
|
||||
@@ -0,0 +1,59 @@
|
||||
# Tech Stack Evaluation
|
||||
|
||||
## Requirements Analysis
|
||||
|
||||
| Area | Requirement |
|
||||
|------|-------------|
|
||||
| Runtime | Jetson Orin Nano Super, Ubuntu/JetPack, CUDA/TensorRT available, 8 GB shared memory, 25 W thermal envelope. |
|
||||
| Language | Python is acceptable for orchestration/prototyping; C++/TensorRT paths likely needed for hot vision loops. |
|
||||
| Vision | Calibration, undistortion, homography, VPR descriptors, local matching, RANSAC verification. |
|
||||
| Estimation | BASALT VIO for relative camera+IMU propagation, wrapped by project-owned safety/anchor estimator logic for covariance calibration, source labels, blackout/spoofing modes, and MAVLink output mapping. |
|
||||
| Storage | Offline satellite cache, descriptor index, FDR with no raw frame retention. |
|
||||
| Autopilot | ArduPilot Plane, `GPS_INPUT` through pymavlink, MAVSDK for telemetry. |
|
||||
|
||||
## Technology Evaluation
|
||||
|
||||
| Layer | Selected | Alternatives Considered | Rationale | Risk |
|
||||
|-------|----------|-------------------------|-----------|------|
|
||||
| OS / GPU stack | JetPack Ubuntu + CUDA + TensorRT | Plain Ubuntu without JetPack | Required for Jetson acceleration and profiling. | Thermal/performance tuning. |
|
||||
| Calibration / geometry | OpenCV 4.x | Custom NumPy-only geometry | Mature APIs for calibration, undistortion, homography, RANSAC. | Version pin and calibration quality. |
|
||||
| VO / estimator | BASALT + project-owned safety/anchor wrapper | OpenVINS, Kimera-VIO, custom OpenCV/ESKF, ORB-SLAM3, VINS-Fusion | BASALT is the selected production VIO candidate; wrapper owns source labels, covariance gates, degraded modes, satellite-anchor acceptance, and MAVLink semantics. | BASALT confidence/covariance must be calibrated; nadir fixed-wing replay required. |
|
||||
| VPR descriptors | DINOv2-VLAD / AnyLoc-style, model-size profiled, TensorRT only after fidelity check | MixVPR, SALAD, NetVLAD, classical BoW | Strong retrieval evidence; good offline descriptor model. | Memory/latency and embedding drift if optimized incorrectly. |
|
||||
| Vector search | FAISS CPU-first on Jetson ARM64 | HNSWLIB, PostgreSQL/pgvector metadata-assisted search, brute-force NumPy, custom FAISS GPU build | Mature top-K search, save/load, PQ compression; PostgreSQL stores spatial/mission metadata around descriptor files. | CPU query latency must be profiled; GPU FAISS is not default on aarch64. |
|
||||
| Local matching | DISK/ALIKED + LightGlue | SuperPoint+LightGlue, SIFT/ORB, LoFTR | Exact match outputs; Apache/BSD-friendly path; adaptive speed knobs. | Jetson profiling needed. |
|
||||
| Raster cache | COG + PostgreSQL/PostGIS manifest + signed JSON sidecars | PMTiles, MBTiles, loose tile folders | COG fits geospatial raster and write-new-tile workflow; PostGIS supports spatial/freshness queries. | 10 GB budget pressure and local DB availability. |
|
||||
| MAVLink | MAVSDK telemetry + pymavlink `GPS_INPUT` | MAVSDK-only, MAVProxy bridge | MAVSDK does telemetry well; `GPS_INPUT` needs raw field control. | Plane SITL validation. |
|
||||
| FDR | PostgreSQL event index + CBOR/binary payload segments with optional Parquet export | Raw images, plain CSV | Queryable event metadata, bounded payload segments, no raw frame retention. | Schema and local DB availability. |
|
||||
| Testing | ArduPilot Plane SITL + AerialVL/VPAir + EuRoC + representative flight replay | Public datasets only | No public dataset covers all ACs. | Representative data collection required. |
|
||||
|
||||
## Tech Stack Summary
|
||||
|
||||
- **Primary implementation**: Python for orchestration, test harness, cache tooling, and MAVLink integration; C++/TensorRT for hot-path vision if profiling requires it.
|
||||
- **Vision utilities**: OpenCV 4.x.
|
||||
- **Estimator**: BASALT VIO plus project-owned safety/anchor wrapper and mode machine.
|
||||
- **Global retrieval**: DINOv2-VLAD style descriptors with CPU-first FAISS top-K search.
|
||||
- **Local matching**: DISK/ALIKED + LightGlue; SuperPoint only after license review.
|
||||
- **Cache**: COG imagery, PostgreSQL/PostGIS manifest metadata, signed JSON sidecars, FAISS index files.
|
||||
- **Autopilot**: MAVSDK subscriptions plus pymavlink `GPS_INPUT`.
|
||||
- **Validation**: public datasets for component de-risking, Plane SITL for integration, representative flight/replay data for acceptance.
|
||||
|
||||
## Risk Assessment
|
||||
|
||||
| Risk | Impact | Mitigation |
|
||||
|------|--------|------------|
|
||||
| VPR/local matching exceeds Jetson latency | AC-4.1 failure | Conditional VPR, top-K caps, downsampled descriptors, CPU FAISS profiling, TensorRT only after embedding-fidelity checks. |
|
||||
| Descriptor cache exceeds 10 GB | AC-8.3/storage failure | PQ/compression, multi-scale budget report, split descriptor budget if needed. |
|
||||
| GPL library accidentally becomes production dependency | Licensing issue | Keep OpenVINS/ORB-SLAM3 as reference only unless legal approves; BASALT is the production VIO candidate. |
|
||||
| BASALT covariance under-reports real error | False-position safety budget failure | Calibrate wrapper covariance against OpenVINS covariance, ground truth replay, and satellite anchor residuals. |
|
||||
| Plane failsafe differs from Copter docs | Safety behavior mismatch | Production-parameter ArduPilot Plane SITL gate. |
|
||||
| `GPS_INPUT` velocity ignore flags behave unexpectedly | EKF drift or false velocity fusion | SITL tests for velocity fields, ignore flags, and `EK3_SRC1_*` source parameters. |
|
||||
| Public datasets fail to represent Ukrainian agricultural terrain | False confidence | Require representative synchronized flight/replay data before AC signoff. |
|
||||
| Thermal throttling | Latency regression | Hot-soak test and throttle logging per AC-NEW-5. |
|
||||
|
||||
## Learning / Implementation Requirements
|
||||
|
||||
- Jetson profiling with CUDA/TensorRT and memory instrumentation.
|
||||
- ArduPilot Plane SITL, `GPS_INPUT`, GPS spoof/failsafe parameters.
|
||||
- Geospatial raster formats: COG, CRS, tile matrices, m/px metadata, manifests.
|
||||
- BASALT integration, covariance calibration, and Mahalanobis rejection in the safety/anchor wrapper.
|
||||
- Aerial VPR benchmark methodology and georeference recall.
|
||||
Reference in New Issue
Block a user