# himanshu819/path_planning_kf architecture

> Architecture diagram of the GitHub repository himanshu819/path_planning_kf, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/himanshu819/path_planning_kf
- Repository: https://github.com/himanshu819/path_planning_kf

## Overview

##### Project type and purpose
- This is a C++ simulation application for advanced Kalman filtering and sensor-fusion.

##### File structure
- Top-level:
- CMakeLists.txt, .gitignore – build configuration
- data/ – (possibly sensor/beacon reference data)
- src/ – all C++ source and headers
- src/ modules:
- main.cpp – application entry point, orchestrates initialization, input loop, shutdown
- simulation.* – generates the true vehicle trajectory under different motion profiles
- sensors.* – simulates sensor outputs (GPS, gyro, LiDAR), calls beacons.* for landmarks
- beacons.* – beacon/landmark definitions used by LiDAR
- kalmanfilter.* – single polymorphic entry point for whichever filter is plugged in
- kalmanfilter_{lkf,ekf,ukf}*.cpp – student & answer reference implementations
- .* – renders the simulation and filter estimates via SDL2/SDL_ttf
- utils.* – common math, helper functions, configuration flags

##### README for additional insights
- Describes build dependencies (Eigen3, SDL2, SDL2_ttf)
- Details usage: compile via CMake, run executable and press keys 1–9,0 to switch sensor/motion profiles

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Application Core Modules
    subgraph "Application Core"
        Main["Main Application\n(src/main.cpp)"]:::blue
        SimEng["Simulation Engine"]:::blue
        Sensors["Sensor Models"]:::blue
        FilterInterface["Kalman Filter Module\nInterface"]:::blue
        Display["Display (SDL2)"]:::blue
    end

    %% Filter Variants (Plugin Strategy)
    subgraph "Filter Variants"
        EKF["EKF Variant"]:::blue
        UKF["UKF Variant"]:::blue
        LKF["LKF Variant"]:::blue
    end

    %% Support Modules
    subgraph "Support"
        Utils["Utils / Config"]:::yellow
        Data["Synthetic Reference Data"]:::green
    end

    %% External Libraries
    subgraph "External Libraries"
        Eigen["Eigen3"]:::gray
        SDL["SDL2 / SDL2_ttf"]:::gray
    end

    %% Build Configuration
    subgraph "Build"
        CMake["CMakeLists.txt"]:::gray
        GitIgnore[".gitignore"]:::gray
        README["README.md"]:::gray
        BINARY["AKFSF-Simulation\n(binary)"]:::gray
    end

    %% Data Flow Pipeline
    Main -->|load config| Utils
    Main -->|init display| Display
    Main -->|start loop| SimEng
    SimEng -->|"TrueState"| Sensors
    Sensors -->|"Measurements"| FilterInterface
    FilterInterface -->|"Estimate"| Display
    Display -->|next step| SimEng

    %% Plugin Connections
    EKF -->|implements| FilterInterface
    UKF -->|implements| FilterInterface
    LKF -->|implements| FilterInterface

    %% Dependencies on Support and External
    SimEng --> Utils
    Sensors --> Utils
    FilterInterface --> Utils
    Display --> Utils

    SimEng --> Eigen
    FilterInterface --> Eigen
    Display --> SDL

    %% Build Process
    CMake -->|configure| BINARY
    GitIgnore --> BINARY
    README --> BINARY

    %% Click Events
    click SimEng "https://github.com/himanshu819/path_planning_kf/blob/main/src/simulation.cpp"
    click SimEng "https://github.com/himanshu819/path_planning_kf/blob/main/src/simulation.h"
    click Sensors "https://github.com/himanshu819/path_planning_kf/blob/main/src/sensors.cpp"
    click Sensors "https://github.com/himanshu819/path_planning_kf/blob/main/src/sensors.h"
    click Beacons "https://github.com/himanshu819/path_planning_kf/blob/main/src/beacons.cpp"
    click Beacons "https://github.com/himanshu819/path_planning_kf/blob/main/src/beacons.h"
    click FilterInterface "https://github.com/himanshu819/path_planning_kf/blob/main/src/kalmanfilter.cpp"
    click FilterInterface "https://github.com/himanshu819/path_planning_kf/blob/main/src/kalmanfilter.h"
    click EKF "https://github.com/himanshu819/path_planning_kf/blob/main/src/kalmanfilter_ekf.cpp"
    click UKF "https://github.com/himanshu819/path_planning_kf/blob/main/src/kalmanfilter_ukf.cpp"
    click Display "https://github.com/himanshu819/path_planning_kf/blob/main/src/display.cpp"
    click Display "https://github.com/himanshu819/path_planning_kf/blob/main/src/display.h"
    click Utils "https://github.com/himanshu819/path_planning_kf/blob/main/src/utils.cpp"
    click Utils "https://github.com/himanshu819/path_planning_kf/blob/main/src/utils.h"
    click Main "https://github.com/himanshu819/path_planning_kf/blob/main/src/main.cpp"
    click Car "https://github.com/himanshu819/path_planning_kf/blob/main/src/car.h"
    click Data "https://github.com/himanshu819/path_planning_kf/tree/main/data/"
    click CMake "https://github.com/himanshu819/path_planning_kf/blob/main/CMakeLists.txt"
    click GitIgnore "https://github.com/himanshu819/path_planning_kf/blob/main/.gitignore"
    click README "https://github.com/himanshu819/path_planning_kf/blob/main/README.md"

    %% Styles
    classDef blue fill:#ADD8E6,stroke:#000;
    classDef green fill:#98FB98,stroke:#000;
    classDef gray fill:#D3D3D3,stroke:#000;
    classDef yellow fill:#FFFF99,stroke:#000;
```
