public class F1TelemetryPacket extends Object
The packet F1 2011 puts out through this contains the following fields in order. All fields are float datatype
Field | Description |
Lap |
The number of laps since the session began. Restarting a Session in the game will set this back to 0. |
Time |
Time in seconds since this telemetry session began Restarting a Session in the game will set this back to 0. |
LapTime | Time in seconds since the lap began. F1 2012 has a capture/send rate of 60 telemetry packets per second. This is 0 for an 'out lap' |
LapDistance | The distance in meters since the lap began. This can be negative for 'out' laps. If you cross the start finish line and then reverse back over it the LapDistance will shoot back up buytbut the Lap will stay the same |
Distance |
The laps and percent of laps covered since the session began. The value is negative when you first enter a practice session. After you cross the start finish line for the first time it becomes positive (0). A value of 1.5 would indicate you're halfway through your second lap. 1.995 would indicate you're almost finished your second lap. |
X | The X position of the car in the world |
Y | The Y position of the car in the world |
Z | The Z position of the car in the world |
Speed | The car speed at this point in time. To get km/hr, multiply this value by 3.6 (I'm not sure why codemasters uses this scale). |
XV | |
YV | |
ZV | |
XR | |
YR | |
ZR | |
XD | |
YD | |
ZD | |
SuspensionPositionRearLeft | The position of the rear left suspension |
SuspensionPositionRearRight | The position of the rear right suspension |
SuspensionPositionFrontLeft | The position of the front left suspension |
SuspensionPositionFrontRight | The position of the front right suspension |
SuspensionVelocityRearLeft | The speed of travel of the rear left suspension |
SuspensionVelocityRearRight | The speed of travel of the rear right suspension |
SuspensionVelocityFrontLeft | The speed of travel of the front left suspension |
SuspensionVelocityFrontRight | The speed of travel of the front right suspension |
WheelSpeedRearLeft | The speed the rear left wheel is travelling. I assume this value with Speed subtracted gives wheelspin. Although it's a good 6 km/hr faster than the front, if that's the case! |
WheelSpeedRearRight | The speed the rear right wheel is travelling. |
WheelSpeedFrontLeft | The speed the front left wheel is travelling |
WheelSpeedFrontRight | The speed the front right wheel is travelling |
Throttle | The percent of throttle applied. 1 = full throttle and 0 = no throttle |
Steer | The amount of left/right (-/+) input into steering. 0 = straight ahead. |
Brake | The percent of brake applied. 1 = full brake and 0 = no brake |
Clutch | This value will always be 0 |
Gear | The current gear |
GForceLatitudinal | The amount of gforces being generated due to turning |
GForceLongitudinal | The amount of gforces being generated due to acceleration or braking |
Lap | The current Lap. 0 = first lap across the start/finish line. |
EngineRevs | The RPM of the engine. This value needs to be multiplied by 10 to get the real RPM, so it would seen. |
From what I can tell, the following can be used to determine which lap the driver is on.
Action | Details |
Sitting in the Pits | When the driver is sitting in the pits LapTime is 0, Speed is 0. |
Out Laps |
Out laps, that is laps where the driver has exited the pits but not yet crossed the start/finish line on the race track have a LapTime value of 0 and a negative Distance value or a Distance value of less than 1. The value is the fraction of a lap you have left before you start your first timed lap. As you leave it'll be around -0.95 (95% to go) and as you're about to cross the start finish line it'll be -0.0001 (.01% to go) approx. If you've crossed the start/finish line once, the value starts at 0 and gets larger as you progress through the lap, toward a value of 1 (which is the start of the next lap). On your very first of the session the Lap value will be the same as the next lap so you cannot use only changes in the Lap value to detect new laps. |
Return to Pits | When you return to the pits after being partway through a lap your Lap value will not change, so you need to use some logic to recognise a return to pits. LapTime = 0 is a good one. |
Packet frequency | The first packet received from F1 2012 after the car has crossed the start/finish line will be within 1/60th of a second, which is the rate at which F1 2011 publishes data. |
Reversing back across the start finish line | LapDistance will vary depending on how much you move around during your lap. If you cross the line it'll be set back to 0. If you then reverse back across the finish line it'll jump to a large number. |
Constructor and Description |
---|
F1TelemetryPacket(byte[] data) |
Modifier and Type | Method and Description |
---|---|
static F1TelemetryPacket |
deserializePacket(byte[] data)
Deserialize the udp-packet back to readable an F1TelemetryPacket object.
|
float |
getEngineRevs()
Get Method for class field 'EngineRevs'.
|
float |
getGear()
Get Method for class field 'Gear'.
|
float |
getRPM()
Gets the engin RPM (which is EngineRevs*10).
|
float |
getSpeed()
Get Method for class field 'Speed'.
|
float |
getSpeedKM()
Gets the speed in km/hr.
|
float |
getThrottle()
Get Method for class field 'Throttle'.
|
void |
setEngineRevs(float EngineRevs)
Set Method for class field 'EngineRevs'.
|
void |
setGear(float Gear)
Set Method for class field 'Gear'.
|
void |
setSpeed(float Speed)
Set Method for class field 'Speed'.
|
void |
setThrottle(float Throttle)
Set Method for class field 'Throttle'.
|
String |
toString() |
public float Time
public float LapTime
public float LapDistance
public float Distance
public float X
public float Y
public float Z
public float Speed
public float WorldSpeedX
public float WorldSpeedY
public float WorldSpeedZ
public float XR
public float Roll
public float ZR
public float XD
public float Pitch
public float ZD
public float SuspensionPositionRearLeft
public float SuspensionPositionRearRight
public float SuspensionPositionFrontLeft
public float SuspensionPositionFrontRight
public float SuspensionVelocityRearLeft
public float SuspensionVelocityRearRight
public float SuspensionVelocityFrontLeft
public float SuspensionVelocityFrontRight
public float WheelSpeedBackLeft
public float WheelSpeedBackRight
public float WheelSpeedFrontLeft
public float WheelSpeedFrontRight
public float Throttle
public float Steer
public float Brake
public float Clutch
public float Gear
public float LateralAcceleration
public float LongitudinalAcceleration
public float Lap
public float EngineRevs
public float NewField1
public float RacePosition
public float KersRemaining
public float KersRecharge
public float DrsStatus
public float Difficulty
public float Assists
public float FuelRemaining
public float SessionType
public float NewField10
public float Sector
public float TimeSector1
public float TimeSector2
public float BrakeTemperatureRearLeft
public float BrakeTemperatureRearRight
public float BrakeTemperatureFrontLeft
public float BrakeTemperatureFrontRight
public float NewField18
public float NewField19
public float NewField20
public float NewField21
public float CompletedLapsInRace
public float TotalLapsInRace
public float TrackLength
public float PreviousLapTime
public float NewField26
public float NewField27
public float NewField28
public F1TelemetryPacket(byte[] data)
public static F1TelemetryPacket deserializePacket(byte[] data)
data
- public void setEngineRevs(float EngineRevs)
EngineRevs
- is the value to set this class field to.public float getEngineRevs()
public float getRPM()
public void setSpeed(float Speed)
Speed
- is the value to set this class field to.public float getSpeed()
public float getSpeedKM()
public void setGear(float Gear)
Gear
- is the value to set this class field to.public float getGear()
public void setThrottle(float Throttle)
Throttle
- is the value to set this class field to.public float getThrottle()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses