All Known Implementing Classes:
AFilterGroup, AHighPassFilter, ALowPassFilter, AMotionProfile, ARateLimit

public interface AFilter
This is the Filter interface class that gives a definition for how to implement a filter.

All that a filter does is take in the next double in a series and gives you the filtered value.

  • Method Summary

    Modifier and Type
    Method
    Description
    default AFilter
    add(AFilter other)
    Combine two AFilters by adding their results together
    static AFilter
    create(AFilter... filters)
    Create an AFilter from a list of AFilters.
    get(Angle next)
    Get next value in Filter based on the next value given
    default AFilter
    Invert an AFilter by subtracting the input from the result of the AFilter.
    default AFilter
    sub(AFilter other)
    Combine two AFilters by subtracting their results together
    default AFilter
    then(AFilter next)
    Combine an AFilter with another AFilter
  • Method Details

    • create

      static AFilter create(AFilter... filters)
      Create an AFilter from a list of AFilters. This will create an AFilter with the least possible overhead for the number of filters provided.
      Parameters:
      filters - list of AFilters to apply
      Returns:
      an AFilter that uses every filter given
    • get

      Angle get(Angle next)
      Get next value in Filter based on the next value given
      Parameters:
      next - next input value in the stream
      Returns:
      the output value of the filter
    • then

      default AFilter then(AFilter next)
      Combine an AFilter with another AFilter
      Parameters:
      next - filter to be evaluated after this one
      Returns:
      the combined filter
    • add

      default AFilter add(AFilter other)
      Combine two AFilters by adding their results together
      Parameters:
      other - other AFilter to add to this one
      Returns:
      the resulting AFilter after the sum
    • sub

      default AFilter sub(AFilter other)
      Combine two AFilters by subtracting their results together
      Parameters:
      other - other AFilter to subtract from this one
      Returns:
      the resulting AFilter after the subtraction
    • invert

      default AFilter invert()
      Invert an AFilter by subtracting the input from the result of the AFilter.

      Inverting a LowPassFilter gives you a HighPassFilter and vise versa.

      Inverting something twice gives you the original value.

      Returns:
      the inverted filter