Package edu.wpi.first.wpilibj.filters
Class Filter
- java.lang.Object
-
- edu.wpi.first.wpilibj.filters.Filter
-
- All Implemented Interfaces:
PIDSource
- Direct Known Subclasses:
LinearDigitalFilter
public abstract class Filter extends Object implements PIDSource
Superclass for filters.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract double
get()
Returns the current filter estimate without also inserting new data as pidGet() would do.PIDSourceType
getPIDSourceType()
Get which parameter of the device you are using as a process control variable.abstract double
pidGet()
Get the result to use in PIDController.protected double
pidGetSource()
Calls PIDGet() of source.abstract void
reset()
Reset the filter state.void
setPIDSourceType(PIDSourceType pidSource)
Set which parameter of the device you are using as a process control variable.
-
-
-
Constructor Detail
-
Filter
public Filter(PIDSource source)
-
-
Method Detail
-
setPIDSourceType
public void setPIDSourceType(PIDSourceType pidSource)
Description copied from interface:PIDSource
Set which parameter of the device you are using as a process control variable.- Specified by:
setPIDSourceType
in interfacePIDSource
- Parameters:
pidSource
- An enum to select the parameter.
-
getPIDSourceType
public PIDSourceType getPIDSourceType()
Description copied from interface:PIDSource
Get which parameter of the device you are using as a process control variable.- Specified by:
getPIDSourceType
in interfacePIDSource
- Returns:
- the currently selected PID source parameter
-
pidGet
public abstract double pidGet()
Description copied from interface:PIDSource
Get the result to use in PIDController.
-
get
public abstract double get()
Returns the current filter estimate without also inserting new data as pidGet() would do.- Returns:
- The current filter estimate
-
reset
public abstract void reset()
Reset the filter state.
-
pidGetSource
protected double pidGetSource()
Calls PIDGet() of source.- Returns:
- Current value of source
-
-