[PR #223] [MERGED] Telemetry Streaming Service #229

Closed
opened 2026-05-07 00:19:19 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/223
Author: @IAmTomShaw
Created: 2/6/2026
Status: Merged
Merged: 2/7/2026
Merged by: @IAmTomShaw

Base: mainHead: telemetry-stream


📝 Commits (2)

  • b520a72 Telemetry Stream initial version
  • 1459a0a Implementing suggested improvements

📊 Changes

9 files changed (+671 additions, -8 deletions)

View changed files

📝 README.md (+2 -0)
📝 main.py (+12 -4)
resources/telemetry-logger.png (+0 -0)
📝 src/gui/race_selection.py (+3 -0)
src/gui/telemetry_stream_viewer.py (+278 -0)
📝 src/interfaces/race_replay.py (+90 -2)
📝 src/run_session.py (+22 -2)
src/services/stream.py (+178 -0)
telemetry.md (+86 -0)

📄 Description

This feature is the next step for getting us to the goal of building a pit wall style tool!!

Telemetry Streaming Service

This allows you to see the raw telemetry data being streamed from the replay process in real-time (not live during races, but real-time relative to the race replay), and is intended for developers who want to build custom tools and interfaces on top of the replay data.

telemetry-logger

How to check it out

Ensure you have the latest version of this PR with telemetry support and have already setup an environment with the required dependencies (see README.md for setup instructions).

  1. Start the F1 Race Replay and pass the --telemetry flag:

    python main.py --telemetry
    
  2. Select a race session from the GUI. The telemetry stream will start automatically when the replay begins.

  3. The demo window will show:

    • Raw telemetry stream: JSON data as it comes from the race replay
    • Summary tab: Session overview with message counts and current state
    • Drivers tab: Current driver positions, speeds, and lap information
    • Events tab: Track status changes and race events

Why this feature is huge!

The telemetry stream provides a powerful way to access all the rich data from the race replay enabling you to build custom interfaces on top of the replay data.

The goal of this project is to build a pit wall style tool to replay races and sessions. So being able to access telemetry data in other windows outside of the main replay window is a key to unlocking a lot of potential features and customizations.

We're no longer limited to fitting everything into the replay window - we can build custom dashboards, data analysis tools etc that can run alongside the replay and provide a much richer experience.

How to use this service

Implementing this service into you a new feature or insight is super easy!

You can use the TelemetryStreamClient to easily connect to the service.

Using the on_data_received() function you can receive the incoming telemetry into your window.

I've created the telemetry_stream_viewer.py window to demonstrate how this data is received so that you can visualise it much easier.

Telemetry Data Format

The stream provides this data structure:

{
  "frame": {
    "drivers": {
      "ALB": {
        "brake": 0.0,
        "dist": 4428.078064476834,
        "drs": 1,
        "gear": 7,
        "lap": 1,
        "position": 8,
        "rel_dist": 0.7588,
        "speed": 282.0,
        "throttle": 100.0,
        "tyre": 3.0,
        "x": 5303.823151332268,
        "y": 554.943926757651
      },
      ... other drivers
    },
    "lap": 1,
    "t": 84.88,
    "weather": {
      "air_temp": 18.34674710038636,
      "humidity": 80.46747100386358,
      "rain_state": "DRY",
      "track_temp": 24.19349420077272,
      "wind_direction": 201.09865351318817,
      "wind_speed": 1.1532528996136413
    }
  },
  "frame_index": 2122,
  "is_paused": true,
  "playback_speed": 64.0,
  "session_data": {
    "lap": 1,
    "leader": "VER",
    "time": "00:01:24",
    "total_laps": 52
  },
  "total_frames": 148011,
  "track_status": "2"
}

Technical Details

  • Protocol: TCP socket on localhost:9999
  • Format: JSON messages separated by newlines
  • Threading: Network handling runs in background thread
  • UI Framework: PySide6 (Qt for Python)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/IAmTomShaw/f1-race-replay/pull/223 **Author:** [@IAmTomShaw](https://github.com/IAmTomShaw) **Created:** 2/6/2026 **Status:** ✅ Merged **Merged:** 2/7/2026 **Merged by:** [@IAmTomShaw](https://github.com/IAmTomShaw) **Base:** `main` ← **Head:** `telemetry-stream` --- ### 📝 Commits (2) - [`b520a72`](https://github.com/IAmTomShaw/f1-race-replay/commit/b520a72df50287d258316a62b9b0f31ddb04dc61) Telemetry Stream initial version - [`1459a0a`](https://github.com/IAmTomShaw/f1-race-replay/commit/1459a0ab0d9bdad8f5b0ef84264c681e34f95600) Implementing suggested improvements ### 📊 Changes **9 files changed** (+671 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+2 -0) 📝 `main.py` (+12 -4) ➕ `resources/telemetry-logger.png` (+0 -0) 📝 `src/gui/race_selection.py` (+3 -0) ➕ `src/gui/telemetry_stream_viewer.py` (+278 -0) 📝 `src/interfaces/race_replay.py` (+90 -2) 📝 `src/run_session.py` (+22 -2) ➕ `src/services/stream.py` (+178 -0) ➕ `telemetry.md` (+86 -0) </details> ### 📄 Description This feature is the next step for getting us to the goal of building a pit wall style tool!! # Telemetry Streaming Service This allows you to see the raw telemetry data being streamed from the replay process in real-time (not live during races, but real-time relative to the race replay), and is intended for developers who want to build custom tools and interfaces on top of the replay data. <img width="1312" height="940" alt="telemetry-logger" src="https://github.com/user-attachments/assets/24033fc0-4e5a-4c4e-83f7-a40e74e89e28" /> ## How to check it out Ensure you have the latest version of this PR with telemetry support and have already setup an environment with the required dependencies (see `README.md` for setup instructions). 1. **Start the F1 Race Replay and pass the --telemetry flag:** ```bash python main.py --telemetry ``` 2. **Select a race session from the GUI.** The telemetry stream will start automatically when the replay begins. 3. **The demo window will show:** - **Raw telemetry stream**: JSON data as it comes from the race replay - **Summary tab**: Session overview with message counts and current state - **Drivers tab**: Current driver positions, speeds, and lap information - **Events tab**: Track status changes and race events ## Why this feature is huge! The telemetry stream provides a powerful way to access all the rich data from the race replay enabling you to build custom interfaces on top of the replay data. The goal of this project is to build a pit wall style tool to replay races and sessions. So being able to access telemetry data in other windows outside of the main replay window is a key to unlocking a lot of potential features and customizations. We're no longer limited to fitting everything into the replay window - we can build custom dashboards, data analysis tools etc that can run alongside the replay and provide a much richer experience. ## How to use this service Implementing this service into you a new feature or insight is super easy! You can use the `TelemetryStreamClient` to easily connect to the service. Using the `on_data_received()` function you can receive the incoming telemetry into your window. I've created the `telemetry_stream_viewer.py` window to demonstrate how this data is received so that you can visualise it much easier. ## Telemetry Data Format The stream provides this data structure: ```json { "frame": { "drivers": { "ALB": { "brake": 0.0, "dist": 4428.078064476834, "drs": 1, "gear": 7, "lap": 1, "position": 8, "rel_dist": 0.7588, "speed": 282.0, "throttle": 100.0, "tyre": 3.0, "x": 5303.823151332268, "y": 554.943926757651 }, ... other drivers }, "lap": 1, "t": 84.88, "weather": { "air_temp": 18.34674710038636, "humidity": 80.46747100386358, "rain_state": "DRY", "track_temp": 24.19349420077272, "wind_direction": 201.09865351318817, "wind_speed": 1.1532528996136413 } }, "frame_index": 2122, "is_paused": true, "playback_speed": 64.0, "session_data": { "lap": 1, "leader": "VER", "time": "00:01:24", "total_laps": 52 }, "total_frames": 148011, "track_status": "2" } ``` ## Technical Details - **Protocol**: TCP socket on `localhost:9999` - **Format**: JSON messages separated by newlines - **Threading**: Network handling runs in background thread - **UI Framework**: PySide6 (Qt for Python) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 00:19:19 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/f1-race-replay#229
No description provided.