# shazraz/extended-kalman-filter architecture

> Architecture diagram of the GitHub repository shazraz/extended-kalman-filter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shazraz/extended-kalman-filter
- Repository: https://github.com/shazraz/extended-kalman-filter

## Overview

This is a C++ extended Kalman filter that consumes simulator telemetry containing LIDAR or RADAR measurements and returns state estimates and RMSE values. The runtime path is simulator message handling and decoding, measurement packaging, FusionEKF initialization/prediction/sensor-specific updates, then estimate and error reporting. Eigen supplies the matrix operations; the included Eigen eigensolver files are separate library capabilities, not shown as part of the filter’s runtime. The map follows the README and shown call sites; unsampled Eigen internals are not expanded.

Main entry points: [`src/main.cpp`](https://github.com/shazraz/extended-kalman-filter/blob/master/src/main.cpp) (Telemetry handler), [`src/FusionEKF.cpp`](https://github.com/shazraz/extended-kalman-filter/blob/master/src/FusionEKF.cpp) (Sensor fusion), [`src/Eigen`](https://github.com/shazraz/extended-kalman-filter/tree/master/src/Eigen) (Dense matrix operations), [`src/kalman_filter.cpp`](https://github.com/shazraz/extended-kalman-filter/blob/master/src/kalman_filter.cpp) (Kalman updates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Simulator interface"]
  node_main["Telemetry handler<br/>[main.cpp]"]
  node_json["JSON parser<br/>[json.hpp]"]
  node_measurement["Measurement package"]
end

subgraph group_filter["Filtering"]
  node_fusion["Sensor fusion<br/>[FusionEKF.cpp]"]
  node_kalman["Kalman updates<br/>[kalman_filter.cpp]"]
  node_tools_jacobian["Radar Jacobian<br/>[tools.cpp]"]
end

subgraph group_metrics["Estimation metrics"]
  node_tools_rmse["RMSE calculator<br/>[tools.cpp]"]
end

subgraph group_linear["Linear algebra"]
  node_eigen_dense["Dense matrix operations"]
  node_selfadjoint["Self-adjoint solver"]
  node_tridiag["Tridiagonalization"]
end

node_simulator(("Simulator"))

node_simulator -->|"sends telemetry"| node_main
node_main -->|"parses messages"| node_json
node_main -->|"builds measurement"| node_measurement
node_main -->|"processes measurement"| node_fusion
node_fusion -->|"predicts and updates"| node_kalman
node_fusion -->|"calculates Jacobian"| node_tools_jacobian
node_main -->|"calculates RMSE"| node_tools_rmse
node_main -->|"sends estimates"| node_simulator
node_kalman -->|"uses matrices"| node_eigen_dense
node_tools_jacobian -->|"uses matrices"| node_eigen_dense
node_tools_rmse -->|"uses vectors"| node_eigen_dense
node_selfadjoint -->|"includes"| node_tridiag

click node_main "https://github.com/shazraz/extended-kalman-filter/blob/master/src/main.cpp"
click node_json "https://github.com/shazraz/extended-kalman-filter/blob/master/src/json.hpp"
click node_measurement "https://github.com/shazraz/extended-kalman-filter/blob/master/src/measurement_package.h"
click node_fusion "https://github.com/shazraz/extended-kalman-filter/blob/master/src/FusionEKF.cpp"
click node_kalman "https://github.com/shazraz/extended-kalman-filter/blob/master/src/kalman_filter.cpp"
click node_tools_jacobian "https://github.com/shazraz/extended-kalman-filter/blob/master/src/tools.cpp"
click node_tools_rmse "https://github.com/shazraz/extended-kalman-filter/blob/master/src/tools.cpp"
click node_eigen_dense "https://github.com/shazraz/extended-kalman-filter/tree/master/src/Eigen"
click node_selfadjoint "https://github.com/shazraz/extended-kalman-filter/blob/master/src/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h"
click node_tridiag "https://github.com/shazraz/extended-kalman-filter/blob/master/src/Eigen/src/Eigenvalues/Tridiagonalization.h"

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_main,node_json,node_measurement toneBlue
class node_fusion,node_kalman,node_tools_jacobian toneAmber
class node_tools_rmse toneMint
class node_eigen_dense,node_selfadjoint,node_tridiag toneRose
class node_simulator toneIndigo
```

## Components

### Simulator interface

- [Telemetry handler](https://github.com/shazraz/extended-kalman-filter/blob/master/src/main.cpp): `src/main.cpp`
- [JSON parser](https://github.com/shazraz/extended-kalman-filter/blob/master/src/json.hpp): `src/json.hpp`
- [Measurement package](https://github.com/shazraz/extended-kalman-filter/blob/master/src/measurement_package.h): `src/measurement_package.h`

### Filtering

- [Sensor fusion](https://github.com/shazraz/extended-kalman-filter/blob/master/src/FusionEKF.cpp): `src/FusionEKF.cpp`
- [Kalman updates](https://github.com/shazraz/extended-kalman-filter/blob/master/src/kalman_filter.cpp): `src/kalman_filter.cpp`
- [Radar Jacobian](https://github.com/shazraz/extended-kalman-filter/blob/master/src/tools.cpp): `src/tools.cpp`

### Estimation metrics

- [RMSE calculator](https://github.com/shazraz/extended-kalman-filter/blob/master/src/tools.cpp): `src/tools.cpp`

### Linear algebra

- [Dense matrix operations](https://github.com/shazraz/extended-kalman-filter/tree/master/src/Eigen): `src/Eigen`
- [Self-adjoint solver](https://github.com/shazraz/extended-kalman-filter/blob/master/src/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h): `src/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h`
- [Tridiagonalization](https://github.com/shazraz/extended-kalman-filter/blob/master/src/Eigen/src/Eigenvalues/Tridiagonalization.h): `src/Eigen/src/Eigenvalues/Tridiagonalization.h`

### Other components

- **Simulator**

## Connections

- Simulator → Telemetry handler: sends telemetry
- Telemetry handler → JSON parser: parses messages (evidence: `src/main.cpp`)
- Telemetry handler → Measurement package: builds measurement (evidence: `src/main.cpp`)
- Telemetry handler → Sensor fusion: processes measurement (evidence: `src/main.cpp`)
- Sensor fusion → Kalman updates: predicts and updates (evidence: `src/FusionEKF.cpp`)
- Sensor fusion → Radar Jacobian: calculates Jacobian (evidence: `src/FusionEKF.cpp`)
- Telemetry handler → RMSE calculator: calculates RMSE (evidence: `src/main.cpp`)
- Telemetry handler → Simulator: sends estimates (evidence: `src/main.cpp`)
- Kalman updates → Dense matrix operations: uses matrices
- Radar Jacobian → Dense matrix operations: uses matrices
- RMSE calculator → Dense matrix operations: uses vectors
- Self-adjoint solver → Tridiagonalization: includes (evidence: `src/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h`)
