Skip to content

Commit

Permalink
New Property SlipAngle and velocity data
Browse files Browse the repository at this point in the history
  • Loading branch information
saxxon66 committed Oct 17, 2018
1 parent bc407e9 commit 9ec3771
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Src/RF2/RF2TelemetryProvider/rf2/RF2Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// THE SOFTWARE.
//
//
using System;
using System.Runtime.InteropServices;

namespace SimFeedback.telemetry.rf2
Expand All @@ -36,6 +37,14 @@ public struct RF2Data
public float rotAccelX; // local pitch rotational acceleration (+ up) in radians/sec^2
public float rotAccelY; // local yaw rotational acceleration (+ right) in radians/sec^2
public float rotAccelZ; // local roll rotational acceleration (+ right) in radians/sec^2
public float velX; // local lateral velocity (+ left) in m/s
public float velY; // local vertical velocity (+ up) in m/s
public float velZ; // local longitudinal velocity (+ back) in m/s
public float rotVelX; // local pitch rotational velocity (+ up) in radians/sec
public float rotVelY; // local yaw rotational velocity (+ right) in radians/sec
public float rotVelZ; // local roll rotational velocity (+ right) in radians/sec


public float speed; // speed in m/s
public float rpm; // engine rounds in r/min

Expand Down Expand Up @@ -63,5 +72,25 @@ public float RollDeg
{
get { return roll * 57.296f; }
}

public float SlipAngle
{
get
{
float slipAngle = 0.0f;
if (speed > 5)
{
// Porsche GT3 Cup
// Fahrzeug Länge: 4.564
// Radstand: 1.980 x 2.456
slipAngle = (float)(Math.Atan(
(velX - rotVelY * (1.980f / 2))
/
(velZ - rotVelY * (2.456f / 2))
) * 180 / Math.PI);
}
return slipAngle;
}
}
};
}

0 comments on commit 9ec3771

Please sign in to comment.