Skip to content

Commit

Permalink
add calculated LatAccel (Sway)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesClonk committed Nov 8, 2018
1 parent cfd198c commit 04ee1d2
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
14 changes: 12 additions & 2 deletions iR60TelemetryProvider/iR60TelemetryInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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));
}
}
}
}
2 changes: 1 addition & 1 deletion iR60TelemetryProvider/iR60TelemetryProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
88 changes: 87 additions & 1 deletion iracing_60hz_iRacing_-_60hz_testing.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Profile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Active="false" Name="iRacing - 60hz testing" TelemetryProvider="iracing_60hz" OverallSmoothnessEnabled="false" OverallSmoothness="0.3" overallIntensity="1" acceleration="60" minSpeed="64704" maxSpeed="65304">
<author>JamesClonk</author>
<version>v1.0-rc.5</version>
<version>v1.0-rc.6</version>
<info>Test profile for iRacing 60hz telemetry.
Right click on the profile name (left) and copy.
Activate your copy and get started!
Expand Down Expand Up @@ -156,6 +156,92 @@ Activate your copy and get started!
</diffgr:diffgram>
</ConfigDataSet>
</FeedbackEffect>
<FeedbackEffect Type="SimFeedback.motion.RollMotionFeedbackEffect">
<linearInterpolation>false</linearInterpolation>
<name>Sway</name>
<telemetryName>LatAccel</telemetryName>
<minValueY1>-30</minValueY1>
<maxValueY1>30</maxValueY1>
<intervalValueY1>10</intervalValueY1>
<minValueX>-4</minValueX>
<maxValueX>4</maxValueX>
<intervalValueX>1</intervalValueX>
<enabled>false</enabled>
<mute>false</mute>
<smoothing>7</smoothing>
<controller-id>1</controller-id>
<intensity>1</intensity>
<ConfigDataSet>
<xs:schema id="DataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="DataSet" msdata:IsDataSet="true" msdata:Locale="de-DE">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Volume" msdata:Locale="de-DE">
<xs:complexType>
<xs:sequence>
<xs:element name="X" type="xs:double" minOccurs="0" />
<xs:element name="Y" type="xs:double" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Frequency" msdata:Locale="de-DE">
<xs:complexType>
<xs:sequence>
<xs:element name="X" type="xs:double" minOccurs="0" />
<xs:element name="Y" type="xs:double" minOccurs="0" />