# jayykernel/intelligent-dead-reckoning-system architecture

> Architecture diagram of the GitHub repository jayykernel/intelligent-dead-reckoning-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jayykernel/intelligent-dead-reckoning-system
- Repository: https://github.com/jayykernel/intelligent-dead-reckoning-system

## Overview

IDR combines sensor data preparation and offline model training with GNSS/INS dead reckoning. The principal runtime workflow calibrates IMU measurements, propagates navigation state, and applies fusion aids such as vehicle constraints, AI speed correction, and outage prediction; map matching is an additional trajectory-correction capability. The shared engine also has an edge-oriented FOG path, while the README identifies an Android app deliverable whose runtime source is not present in this tree. Benchmark coverage is included as a product capability. Some links reflect README statements or source-index references rather than fully sampled call sites.

Main entry points: [`engine/fusion/fusion_engine.py`](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/fusion/fusion_engine.py) (GNSS INS fusion), [`edge/edge_engine.py`](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/edge/edge_engine.py) (Edge fusion engine), [`eval/run_full_benchmark.py`](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/eval/run_full_benchmark.py) (Benchmark evaluation), [`training/data_loader.py`](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/training/data_loader.py) (Session loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data_models["Data and Models"]
  node_data_loader["Session loader<br/>[data_loader.py]"]
  node_dataset_splits["Dataset splits<br/>[dataset_splits.py]"]
  node_training["Model training"]
end

subgraph group_navigation["Navigation Engine"]
  node_calibration["IMU calibration<br/>[calibrator.py]"]
  node_online_mag["Online mag calibration<br/>[online_mag_cal.py]"]
  node_fusion_engine["GNSS INS fusion<br/>[fusion_engine.py]"]
  node_ekf["Error-state EKF<br/>[ekf.py]"]
  node_strapdown["Strapdown INS<br/>[strapdown.py]"]
  node_constraints["NHC and ZUPT<br/>[constrained_ins.py]"]
  node_lean_ekf["Lean estimator<br/>[lean_ekf.py]"]
  node_vehicle_classifier["Vehicle classifier"]
  node_speed_filter["AI speed filter<br/>[speed_filter.py]"]
  node_ai_corrector["AI correction<br/>[ai_corrector.py]"]
  node_mag_gate["Magnetometer gate<br/>[mag_gate.py]"]
end

subgraph group_map_outage["Map and Outage"]
  node_outage["Outage prediction"]
  node_road_network["Road network<br/>[road_network.py]"]
  node_map_matcher["HMM map matcher<br/>[hmm_matcher.py]"]
end

subgraph group_platform_eval["Platforms and Evaluation"]
  node_edge_engine["Edge fusion engine<br/>[edge_engine.py]"]
  node_android_app["Android app"]
  node_benchmark["Benchmark evaluation"]
end

node_user(("System operator"))

node_user -->|"loads sessions"| node_data_loader
node_data_loader -->|"checks isolation"| node_dataset_splits
node_training -->|"uses data"| node_data_loader
node_training -->|"uses splits"| node_dataset_splits
node_user -.->|"runs navigation"| node_fusion_engine
node_fusion_engine -->|"uses calibration"| node_calibration
node_fusion_engine -->|"uses calibration"| node_online_mag
node_fusion_engine -->|"updates filter"| node_ekf
node_fusion_engine -->|"uses mechanization"| node_strapdown
node_fusion_engine -->|"applies constraints"| node_constraints
node_fusion_engine -->|"uses lean state"| node_lean_ekf
node_fusion_engine -->|"classifies vehicle"| node_vehicle_classifier
node_fusion_engine -->|"applies correction"| node_ai_corrector
node_ai_corrector -->|"uses speed model"| node_speed_filter
node_fusion_engine -->|"gates magnetometer"| node_mag_gate
node_fusion_engine -->|"predicts outage"| node_outage
node_map_matcher -->|"queries roads"| node_road_network
node_benchmark -->|"loads sessions"| node_data_loader
node_benchmark -->|"evaluates fusion"| node_fusion_engine
node_benchmark -->|"evaluates edge"| node_edge_engine
node_benchmark -->|"evaluates matching"| node_map_matcher
node_edge_engine -->|"uses calibration"| node_calibration
node_edge_engine -->|"uses filter"| node_ekf
node_edge_engine -->|"applies constraints"| node_constraints
node_edge_engine -->|"uses lean state"| node_lean_ekf
node_edge_engine -->|"uses mechanization"| node_strapdown
node_android_app -.->|"consumes shared engine"| node_fusion_engine

click node_data_loader "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/training/data_loader.py"
click node_dataset_splits "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/training/dataset_splits.py"
click node_training "https://github.com/jayykernel/intelligent-dead-reckoning-system/tree/main/training"
click node_calibration "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/calibration/calibrator.py"
click node_online_mag "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/calibration/online_mag_cal.py"
click node_fusion_engine "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/fusion/fusion_engine.py"
click node_ekf "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/fusion/ekf.py"
click node_strapdown "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/strapdown.py"
click node_constraints "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/nhc_zupt/constrained_ins.py"
click node_lean_ekf "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/nhc_zupt/lean_ekf.py"
click node_vehicle_classifier "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/ai_filters/vehicle_classifier.py"
click node_speed_filter "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/ai_filters/speed_filter.py"
click node_ai_corrector "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/fusion/ai_corrector.py"
click node_mag_gate "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/fusion/mag_gate.py"
click node_outage "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/outage_prediction/outage_predictor.py"
click node_road_network "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/map_matching/road_network.py"
click node_map_matcher "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/map_matching/hmm_matcher.py"
click node_edge_engine "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/edge/edge_engine.py"
click node_android_app "https://github.com/jayykernel/intelligent-dead-reckoning-system/tree/main/mobile"
click node_benchmark "https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/eval/run_full_benchmark.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_data_loader,node_dataset_splits,node_training toneBlue
class node_calibration,node_online_mag,node_fusion_engine,node_ekf,node_strapdown,node_constraints,node_lean_ekf,node_vehicle_classifier,node_speed_filter,node_ai_corrector,node_mag_gate toneAmber
class node_outage,node_road_network,node_map_matcher toneMint
class node_edge_engine,node_android_app,node_benchmark toneRose
class node_user toneIndigo
```

## Components

### Data and Models

- [Session loader](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/training/data_loader.py): `training/data_loader.py`
- [Dataset splits](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/training/dataset_splits.py): `training/dataset_splits.py`
- [Model training](https://github.com/jayykernel/intelligent-dead-reckoning-system/tree/main/training): `training`

### Navigation Engine

- [IMU calibration](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/calibration/calibrator.py): `engine/calibration/calibrator.py`
- [Online mag calibration](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/calibration/online_mag_cal.py): `engine/calibration/online_mag_cal.py`
- [GNSS INS fusion](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/fusion/fusion_engine.py): `engine/fusion/fusion_engine.py`
- [Error-state EKF](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/fusion/ekf.py): `engine/fusion/ekf.py`
- [Strapdown INS](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/strapdown.py): `engine/strapdown.py`
- [NHC and ZUPT](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/nhc_zupt/constrained_ins.py): `engine/nhc_zupt/constrained_ins.py`
- [Lean estimator](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/nhc_zupt/lean_ekf.py): `engine/nhc_zupt/lean_ekf.py`
- [Vehicle classifier](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/ai_filters/vehicle_classifier.py): `engine/ai_filters/vehicle_classifier.py`
- [AI speed filter](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/ai_filters/speed_filter.py): `engine/ai_filters/speed_filter.py`
- [AI correction](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/fusion/ai_corrector.py): `engine/fusion/ai_corrector.py`
- [Magnetometer gate](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/fusion/mag_gate.py): `engine/fusion/mag_gate.py`

### Map and Outage

- [Outage prediction](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/outage_prediction/outage_predictor.py): `engine/outage_prediction/outage_predictor.py`
- [Road network](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/map_matching/road_network.py): `engine/map_matching/road_network.py`
- [HMM map matcher](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/engine/map_matching/hmm_matcher.py): `engine/map_matching/hmm_matcher.py`

### Platforms and Evaluation

- [Edge fusion engine](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/edge/edge_engine.py): `edge/edge_engine.py`
- [Android app](https://github.com/jayykernel/intelligent-dead-reckoning-system/tree/main/mobile): `mobile`
- [Benchmark evaluation](https://github.com/jayykernel/intelligent-dead-reckoning-system/blob/main/eval/run_full_benchmark.py): `eval/run_full_benchmark.py`

### Other components

- **System operator**

## Connections

- System operator → Session loader: loads sessions (evidence: `training/data_loader.py`)
- Session loader → Dataset splits: checks isolation (evidence: `training/data_loader.py`)
- Model training → Session loader: uses data (evidence: `training/generate_preprocessed_data.py`)
- Model training → Dataset splits: uses splits (evidence: `training/train_speed_filter.py`)
- System operator → GNSS INS fusion: runs navigation
- GNSS INS fusion → IMU calibration: uses calibration (evidence: `engine/fusion/fusion_engine.py`)
- GNSS INS fusion → Online mag calibration: uses calibration (evidence: `engine/fusion/fusion_engine.py`)
- GNSS INS fusion → Error-state EKF: updates filter (evidence: `engine/fusion/fusion_engine.py`)
- GNSS INS fusion → Strapdown INS: uses mechanization (evidence: `engine/fusion/fusion_engine.py`)
- GNSS INS fusion → NHC and ZUPT: applies constraints (evidence: `engine/fusion/fusion_engine.py`)
- GNSS INS fusion → Lean estimator: uses lean state (evidence: `engine/fusion/fusion_engine.py`)
- GNSS INS fusion → Vehicle classifier: classifies vehicle (evidence: `engine/fusion/fusion_engine.py`)
- GNSS INS fusion → AI correction: applies correction (evidence: `engine/fusion/fusion_engine.py`)
- AI correction → AI speed filter: uses speed model (evidence: `engine/fusion/ai_corrector.py`)
- GNSS INS fusion → Magnetometer gate: gates magnetometer (evidence: `engine/fusion/fusion_engine.py`)
- GNSS INS fusion → Outage prediction: predicts outage (evidence: `engine/fusion/fusion_engine.py`)
- HMM map matcher → Road network: queries roads (evidence: `engine/map_matching/hmm_matcher.py`)
- Benchmark evaluation → Session loader: loads sessions (evidence: `eval/run_full_benchmark.py`)
- Benchmark evaluation → GNSS INS fusion: evaluates fusion (evidence: `eval/run_full_benchmark.py`)
- Benchmark evaluation → Edge fusion engine: evaluates edge (evidence: `eval/run_full_benchmark.py`)
- Benchmark evaluation → HMM map matcher: evaluates matching (evidence: `eval/run_full_benchmark.py`)
- Edge fusion engine → IMU calibration: uses calibration (evidence: `edge/edge_engine.py`)
- Edge fusion engine → Error-state EKF: uses filter (evidence: `edge/edge_engine.py`)
- Edge fusion engine → NHC and ZUPT: applies constraints (evidence: `edge/edge_engine.py`)
- Edge fusion engine → Lean estimator: uses lean state (evidence: `edge/edge_engine.py`)
- Edge fusion engine → Strapdown INS: uses mechanization (evidence: `edge/edge_engine.py`)
- Android app → GNSS INS fusion: consumes shared engine (evidence: `README.md`)
