# cs10101/f1_25_telemetry architecture

> Architecture diagram of the GitHub repository cs10101/f1_25_telemetry, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cs10101/f1_25_telemetry
- Repository: https://github.com/cs10101/f1_25_telemetry

## Overview

This is an F1 25 telemetry listener and session-analysis toolkit. The main workflow receives game UDP packets, parses selected packet types into live lap/car displays and a shared state, and can write session CSV data for later analysis. A separate listener reports packet IDs and sizes. Analysis scripts cover track maps, speed, lap deltas, DRS, multi-lap timing, and tyre degradation; several of those files are empty in the supplied excerpt, so their wiring is not inferred.

Main entry points: [`live_telemetry.py`](https://github.com/cs10101/f1_25_telemetry/blob/main/live_telemetry.py) (Live listener), [`telemetry/recorder.py`](https://github.com/cs10101/f1_25_telemetry/blob/main/telemetry/recorder.py) (Session recorder), [`analysis/plot_track.py`](https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/plot_track.py) (Track plots), [`analysis/plot_speed.py`](https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/plot_speed.py) (Speed comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Telemetry Ingest"]
  node_live_app["Live listener<br/>[live_telemetry.py]"]
  node_packet_parser["Packet parser<br/>[live_telemetry.py]"]
  node_packet_monitor["Packet monitor<br/>[udp_listner.py]"]
end

subgraph group_live["Live Session"]
  node_state["Telemetry state<br/>[state.py]"]
  node_dashboard["Pit wall dashboard<br/>[live_telemetry.py]"]
  node_recorder["Session recorder<br/>[recorder.py]"]
  node_csv_store[("Session CSV")]
end

subgraph group_analysis["Session Analysis"]
  node_track_plot["Track plots<br/>[plot_track.py]"]
  node_speed_plot["Speed comparison<br/>[plot_speed.py]"]
  node_lap_delta["Fastest lap delta"]
  node_drs_analysis["DRS usage<br/>[plot_DRS_usage.py]"]
  node_multi_lap["Multi-lap timing"]
  node_tyre_analysis["Tyre degradation"]
  node_track_speed["Speed-colored track"]
end

node_game(("F1 25 game"))

node_game -->|"sends UDP"| node_live_app
node_game -->|"sends UDP"| node_packet_monitor
node_live_app -->|"dispatches packets"| node_packet_parser
node_packet_parser -->|"updates"| node_state
node_packet_parser -->|"refreshes"| node_dashboard
node_live_app -->|"starts recording"| node_recorder
node_recorder -->|"writes rows"| node_csv_store
node_track_plot -->|"reads samples"| node_csv_store
node_speed_plot -->|"reads samples"| node_csv_store
node_lap_delta -->|"analyzes laps"| node_csv_store
node_drs_analysis -->|"analyzes DRS"| node_csv_store
node_multi_lap -->|"analyzes laps"| node_csv_store
node_tyre_analysis -->|"analyzes tyres"| node_csv_store
node_track_speed -->|"reads samples"| node_csv_store

click node_live_app "https://github.com/cs10101/f1_25_telemetry/blob/main/live_telemetry.py"
click node_packet_parser "https://github.com/cs10101/f1_25_telemetry/blob/main/live_telemetry.py"
click node_packet_monitor "https://github.com/cs10101/f1_25_telemetry/blob/main/udp_listner.py"
click node_state "https://github.com/cs10101/f1_25_telemetry/blob/main/telemetry/state.py"
click node_dashboard "https://github.com/cs10101/f1_25_telemetry/blob/main/live_telemetry.py"
click node_recorder "https://github.com/cs10101/f1_25_telemetry/blob/main/telemetry/recorder.py"
click node_track_plot "https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/plot_track.py"
click node_speed_plot "https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/plot_speed.py"
click node_lap_delta "https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/delta_to_fastest_lap.py"
click node_drs_analysis "https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/plot_DRS_usage.py"
click node_multi_lap "https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/time_over_multi_laps.py"
click node_tyre_analysis "https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/tyre_deg_over_time.py"
click node_track_speed "https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/coloured_track_by_speed.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_live_app,node_packet_parser,node_packet_monitor toneBlue
class node_state,node_dashboard,node_recorder,node_csv_store toneAmber
class node_track_plot,node_speed_plot,node_lap_delta,node_drs_analysis,node_multi_lap,node_tyre_analysis,node_track_speed toneMint
class node_game toneIndigo
```

## Components

### Telemetry Ingest

- [Live listener](https://github.com/cs10101/f1_25_telemetry/blob/main/live_telemetry.py): `live_telemetry.py`
- [Packet parser](https://github.com/cs10101/f1_25_telemetry/blob/main/live_telemetry.py): `live_telemetry.py`
- [Packet monitor](https://github.com/cs10101/f1_25_telemetry/blob/main/udp_listner.py): `udp_listner.py`

### Live Session

- [Telemetry state](https://github.com/cs10101/f1_25_telemetry/blob/main/telemetry/state.py): `telemetry/state.py`
- [Pit wall dashboard](https://github.com/cs10101/f1_25_telemetry/blob/main/live_telemetry.py): `live_telemetry.py`
- [Session recorder](https://github.com/cs10101/f1_25_telemetry/blob/main/telemetry/recorder.py): `telemetry/recorder.py`
- **Session CSV**

### Session Analysis

- [Track plots](https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/plot_track.py): `analysis/plot_track.py`
- [Speed comparison](https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/plot_speed.py): `analysis/plot_speed.py`
- [Fastest lap delta](https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/delta_to_fastest_lap.py): `analysis/delta_to_fastest_lap.py`
- [DRS usage](https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/plot_DRS_usage.py): `analysis/plot_DRS_usage.py`
- [Multi-lap timing](https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/time_over_multi_laps.py): `analysis/time_over_multi_laps.py`
- [Tyre degradation](https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/tyre_deg_over_time.py): `analysis/tyre_deg_over_time.py`
- [Speed-colored track](https://github.com/cs10101/f1_25_telemetry/blob/main/analysis/coloured_track_by_speed.py): `analysis/coloured_track_by_speed.py`

### Other components

- **F1 25 game**

## Connections

- F1 25 game → Live listener: sends UDP
- F1 25 game → Packet monitor: sends UDP
- Live listener → Packet parser: dispatches packets
- Packet parser → Telemetry state: updates
- Packet parser → Pit wall dashboard: refreshes
- Live listener → Session recorder: starts recording
- Session recorder → Session CSV: writes rows
- Track plots → Session CSV: reads samples
- Speed comparison → Session CSV: reads samples
- Fastest lap delta → Session CSV: analyzes laps
- DRS usage → Session CSV: analyzes DRS
- Multi-lap timing → Session CSV: analyzes laps
- Tyre degradation → Session CSV: analyzes tyres
- Speed-colored track → Session CSV: reads samples
