This project aims to use Apache Kafka in order to ingest Formula 1 telemetry data from the F1 202x game (by CodeMasters/EA Sports) running on Microsoft Xbox. It uses different products, projects and technologies:
The formula 1 telemetry library, used to decode the UDP packets, works with the F1 2020 game format. It's possible to have the project working with newer game editions by selecting the "2020" UDP packet format in the Telemetry settings on the game.
It is possible to select the season for teams, drivers and tracks by setting the F1_TELEMETRY_SEASON
environment variable when running the different applications.
By default, it uses 2020 season data. For more information see here.
Following an overall picture of how these technologies are used together. A couple of short introduction videos are available here and here.
You can also find some material from conference presentations:
In order to ingest the telemetry events into Apache Kafka, the Apache Camel project is used with:
EVENT
type raw UDP packets and forwarding them to a corresponding Apache Kafka topic;The Kafka Streams API based application shows an example of real-time analytics on the telemetry data. The application processes the average speed in the last 5 seconds.
It has a source node reading from the topic with drivers related messages, filtering the ones not containing valid telemetry data. Extract and group the driver's speed by corresponding driver's id using in a tumbling window of 5 seconds. Next, it sums speeds and counts them in order to process the corresponding average value. Finally, the sink node writes to the destination topic.
In order to provide the telemetry data to Grafana dashboards, InfluxDB is used as data source and the telemetry events are stored through Apache Camel with:
EVENT
type raw UDP packets for storing fastest lap and speedtrap events;Contains different components for ingesting and handling Formula 1 202x game (by CodeMasters/EA Sports) telemetry data through Apache Kafka.
Packet
(s);Packet
(s) of EVENT
type;Driver
messages as result of aggregating Packet
(s) in the same frame with telemetry data for all drivers;Driver
messages from Apache Kafka;Driver
(s), processing them in real time to get average speed in a 5 seconds window and writing to Apache Kafka to the f1-telemetry-streams-avg-speed topic;Driver
(s), processing them in real time to get the best overall times in the three track sectors and writing to Apache Kafka to the f1-telemetry-best-overall-sector topic;Driver
(s) from Apache Kafka;Driver
(s) and extracting some telemetry in JSON format;The Formula 1 2020 game UDP packets specification is here. The library used for decoding the packets is here.
You can find more information about building, deploying and running the solution in the documentation here
The telemetry dashboard shows information like speed, engine (rpm), throttle and brake.
The motion dashboard shows information about the car in motion like the G-force.
The car status dashboard shows information mostly related to the status of each car, for example wings damages and fuel in tank.
The events dashboard shows race events like max speed trap and fastest lap.
The driver dashboard allows to get data for a single driver, selecting one through the corresponding drop down list. It has a top bar with information about current lap, position, distance and lap times.
It also has some graphs showing specific driver data related to throttle/brake, engine/speed, gear/clutch, brakes and steering.
It also shows specific information about tyres like, for example, the compound, the age laps, wear, surface temperature and damage
The streams dashboard shows data about processed telemetry data through Kafka Streams application. The first one is about the average speed during the last 5 seconds.