Hello, as a side project I'm trying to build my own hardware dashboard to display speed, rpms, laps and other useful information with Raspberry Pi and some digital displays. I am currently working on a Python script (I decided that this would be the fastest way) that reads telemetry data via UDP. When processing the packets, I tried to base my work on the information contained in the “SharedMemory.h” file, but it had nothing to do with the order of the received data. I have already managed to read the speed, but I am having trouble detecting where the rest of the data is. Code: # speed in m/s speed = struct.unpack_from("<f", data, 0x078)[0] Can anyone help me identify where the individual data starts? Or the best idea will be to switch to c++
The shared memory struct and the UDP packet formats are completely different, UDP is far more complicated as there are different payloads that can be sent with different frequencies. Your best bet – if you want to continue with UDP – would probably be to find an existing implementation to modify. Look for any for Project CARS 2, as I believe the UDP format is either substantially or entirely the same. Alternatively documentation for the Project CARS 2 UDP packets. Sadly the Slightly Mad Studios / Project CARS websites that had example code to download are long since gone.
@CorvusCorax thanks for pointing me in the right direction. I managed to find a few things, the two most important being a repository with Python code and old documentation on what's included in the UDP package. My problem was reading everything as floats if someone is interested: https://github.com/jamesremuscat/pcars/ [HowTo] Companion App - UDP Streaming