Skip to content

Commit

Permalink
fix filter rate calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkirie committed Dec 6, 2021
1 parent a95766e commit 7d370c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ControllerService/XInputController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ private unsafe void DS4_UpdateReport(object sender, ElapsedEventArgs e)
outDS4Report.sCurrentTouch.bTouchData2[2] = (byte)(touch.TrackPadTouch1.Y >> 4);
}

var rate = 1.0 / stopwatch.ElapsedMilliseconds;
var rate = 1.0 / stopwatch.Elapsed.Milliseconds;
outDS4Report.wGyroX = (short)gyroFilter.axis1Filter.Filter(-AngularVelocity.X * F_GYRO_RES_IN_DEG_SEC, rate); // gyroPitchFull
outDS4Report.wGyroY = (short)gyroFilter.axis1Filter.Filter(-AngularVelocity.Y * F_GYRO_RES_IN_DEG_SEC, rate); // gyroYawFull
outDS4Report.wGyroZ = (short)gyroFilter.axis1Filter.Filter(AngularVelocity.Z * F_GYRO_RES_IN_DEG_SEC, rate); // gyroRollFull
Expand Down

0 comments on commit 7d370c9

Please sign in to comment.