Template C++ LinearFilter to work with unit types (#2142)

This commit is contained in:
Oblarg
2019-12-01 02:12:02 -05:00
committed by Peter Johnson
parent 5b73c17f25
commit 9a515c80f8
7 changed files with 76 additions and 100 deletions

View File

@@ -35,7 +35,7 @@ PIDBase::PIDBase(double Kp, double Ki, double Kd, double Kf, PIDSource& source,
m_F = Kf;
m_pidInput = &source;
m_filter = LinearFilter::MovingAverage(1);
m_filter = LinearFilter<double>::MovingAverage(1);
m_pidOutput = &output;
@@ -196,7 +196,7 @@ void PIDBase::SetPercentTolerance(double percent) {
void PIDBase::SetToleranceBuffer(int bufLength) {
std::scoped_lock lock(m_thisMutex);
m_filter = LinearFilter::MovingAverage(bufLength);
m_filter = LinearFilter<double>::MovingAverage(bufLength);
}
bool PIDBase::OnTarget() const {