From 04ee1d253efcce0008034aed1cd96284c382c6c1 Mon Sep 17 00:00:00 2001 From: JamesClonk Date: Thu, 8 Nov 2018 22:21:55 +0100 Subject: [PATCH] add calculated LatAccel (Sway) --- README.md | 4 +- iR60TelemetryProvider/iR60TelemetryInfo.cs | 14 ++- .../iR60TelemetryProvider.cs | 2 +- iracing_60hz_iRacing_-_60hz_testing.xml | 88 ++++++++++++++++++- 4 files changed, 102 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5f50e5e..6950169 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # iR60TelemetryProvider -iRacing 60hz Telemetry Provider for SimFeedback +iRacing 60Hz Telemetry Provider for SimFeedback ## Install - Go to [Releases](https://github.com/JamesClonk/iR60TelemetryProvider/releases) to get the latest version - Download the 2 DLL files and copy them into SimFeedback's `provider` folder - Download the [Test profile](iracing_60hz_iRacing_-_60hz_testing.xml) and copy it into SimFeedback's `profiles` folder -- Make sure iRacing is set to log 60hz telemetry: set `irsdkLog360Hz=0` in `app.ini` +- Make sure iRacing is set to log 60Hz telemetry: set `irsdkLog360Hz=0` in `app.ini` - Run `remove_blocking.bat` included with SimFeedback - Start SimFeedback diff --git a/iR60TelemetryProvider/iR60TelemetryInfo.cs b/iR60TelemetryProvider/iR60TelemetryInfo.cs index f9c4bbf..0fd33af 100644 --- a/iR60TelemetryProvider/iR60TelemetryInfo.cs +++ b/iR60TelemetryProvider/iR60TelemetryInfo.cs @@ -43,7 +43,9 @@ public TelemetryValue TelemetryValueByName(string name) case "LongAccel": data = LongAccel; break; - // TODO: calculate LatAccel + case "LatAccel": + data = LatAccel; + break; case "Pitch": data = RadianToDegree("Pitch") * -1; // invert Pitch @@ -177,6 +179,14 @@ private float LongAccel } } - // TODO: calculate LatAccel + private float LatAccel + { + get + { + return (float)( + (float)_sdk.GetData("LatAccel") + * (Math.Cos((float)_sdk.GetData("Roll")) / G)); + } + } } } diff --git a/iR60TelemetryProvider/iR60TelemetryProvider.cs b/iR60TelemetryProvider/iR60TelemetryProvider.cs index 732c7ad..173b225 100644 --- a/iR60TelemetryProvider/iR60TelemetryProvider.cs +++ b/iR60TelemetryProvider/iR60TelemetryProvider.cs @@ -22,7 +22,7 @@ public sealed class iR60TelemetryProvider : AbstractTelemetryProvider public iR60TelemetryProvider() : base() { Author = "JamesClonk"; - Version = "v1.0-rc.5"; + Version = "v1.0-rc.6"; BannerImage = @"img\banner_iracing.png"; // Image shown on top of the profiles tab IconImage = @"img\iracing.jpg"; // Icon used in the tree view for the profile TelemetryUpdateFrequency = 60; // the update frequency in samples per second diff --git a/iracing_60hz_iRacing_-_60hz_testing.xml b/iracing_60hz_iRacing_-_60hz_testing.xml index 7bc1b2c..28f0e64 100644 --- a/iracing_60hz_iRacing_-_60hz_testing.xml +++ b/iracing_60hz_iRacing_-_60hz_testing.xml @@ -1,7 +1,7 @@ JamesClonk - v1.0-rc.5 + v1.0-rc.6 Test profile for iRacing 60hz telemetry. Right click on the profile name (left) and copy. Activate your copy and get started! @@ -156,6 +156,92 @@ Activate your copy and get started! + + false + Sway + LatAccel + -30 + 30 + 10 + -4 + 4 + 1 + false + false + 7 + 1 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -4 + 0 + + + -1 + 0 + + + 0 + 0 + + + 1 + 0 + + + 4 + 0 + + + -4 + 30 + + + 0 + 0 + + + 4 + -30 + + + + + true Pitch