mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
Clean up LinearDigitalFilter class (#782)
* Renamed LinearDigitalFilter to LinearFilter * Filter base class removed since it wasn't useful * C++: std::shared_ptr<> replaced with double parameter
This commit is contained in:
committed by
Peter Johnson
parent
311e2de4c1
commit
30e936837c
@@ -1,5 +1,5 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
|
||||
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
@@ -14,11 +14,11 @@
|
||||
#include <wpi/mutex.h>
|
||||
|
||||
#include "frc/Base.h"
|
||||
#include "frc/LinearFilter.h"
|
||||
#include "frc/PIDInterface.h"
|
||||
#include "frc/PIDOutput.h"
|
||||
#include "frc/PIDSource.h"
|
||||
#include "frc/Timer.h"
|
||||
#include "frc/filters/LinearDigitalFilter.h"
|
||||
#include "frc/smartdashboard/SendableBase.h"
|
||||
|
||||
namespace frc {
|
||||
@@ -215,7 +215,7 @@ class PIDBase : public SendableBase, public PIDInterface, public PIDOutput {
|
||||
*
|
||||
* @return the average error
|
||||
*/
|
||||
WPI_DEPRECATED("Use a LinearDigitalFilter as the input and GetError().")
|
||||
WPI_DEPRECATED("Use a LinearFilter as the input and GetError().")
|
||||
virtual double GetAvgError() const;
|
||||
|
||||
/**
|
||||
@@ -397,8 +397,7 @@ class PIDBase : public SendableBase, public PIDInterface, public PIDOutput {
|
||||
double m_error = 0;
|
||||
double m_result = 0;
|
||||
|
||||
std::shared_ptr<PIDSource> m_origSource;
|
||||
LinearDigitalFilter m_filter{nullptr, {}, {}};
|
||||
LinearFilter m_filter{{}, {}};
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
Reference in New Issue
Block a user