Skip to content
This repository was archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
Carry over OneEuroFilter change from Steam Controller project
Browse files Browse the repository at this point in the history
Might not use reset in this project
  • Loading branch information
Ryochan7 committed Jul 9, 2022
1 parent 6f9c909 commit ef63247
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions DS4Windows/OneEuroFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ protected double Alpha(double rate, double cutoff)
var te = 1.0 / rate;
return 1.0 / (1.0 + tau / te);
}

public void Reset()
{
xFilt.Reset();
dxFilt.Reset();
}
}

public class LowpassFilter
Expand Down Expand Up @@ -89,5 +95,11 @@ public double Filter(double x, double alpha)

return hatX;
}

public void Reset()
{
firstTime = true;
hatXPrev = 0.0;
}
}
}

0 comments on commit ef63247

Please sign in to comment.