mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Template C++ LinearFilter to work with unit types (#2142)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user