Skip to content

Commit 9ec3771

Browse files
committed
New Property SlipAngle and velocity data
1 parent bc407e9 commit 9ec3771

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Src/RF2/RF2TelemetryProvider/rf2/RF2Data.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
// THE SOFTWARE.
2121
//
2222
//
23+
using System;
2324
using System.Runtime.InteropServices;
2425

2526
namespace SimFeedback.telemetry.rf2
@@ -36,6 +37,14 @@ public struct RF2Data
3637
public float rotAccelX; // local pitch rotational acceleration (+ up) in radians/sec^2
3738
public float rotAccelY; // local yaw rotational acceleration (+ right) in radians/sec^2
3839
public float rotAccelZ; // local roll rotational acceleration (+ right) in radians/sec^2
40+
public float velX; // local lateral velocity (+ left) in m/s
41+
public float velY; // local vertical velocity (+ up) in m/s
42+
public float velZ; // local longitudinal velocity (+ back) in m/s
43+
public float rotVelX; // local pitch rotational velocity (+ up) in radians/sec
44+
public float rotVelY; // local yaw rotational velocity (+ right) in radians/sec
45+
public float rotVelZ; // local roll rotational velocity (+ right) in radians/sec
46+
47+
3948
public float speed; // speed in m/s
4049
public float rpm; // engine rounds in r/min
4150

@@ -63,5 +72,25 @@ public float RollDeg
6372
{
6473
get { return roll * 57.296f; }
6574
}
75+
76+
public float SlipAngle
77+
{
78+
get
79+
{
80+
float slipAngle = 0.0f;
81+
if (speed > 5)
82+
{
83+
// Porsche GT3 Cup
84+
// Fahrzeug Länge: 4.564
85+
// Radstand: 1.980 x 2.456
86+
slipAngle = (float)(Math.Atan(
87+
(velX - rotVelY * (1.980f / 2))
88+
/
89+
(velZ - rotVelY * (2.456f / 2))
90+
) * 180 / Math.PI);
91+
}
92+
return slipAngle;
93+
}
94+
}
6695
};
6796
}

0 commit comments

Comments
 (0)