Class XEncoder

java.lang.Object
xbot.common.controls.sensors.XEncoder
All Implemented Interfaces:
DataFrameRefreshable
Direct Known Subclasses:
EncoderWPIAdapter, MockEncoder

public abstract class XEncoder extends Object implements DataFrameRefreshable
  • Field Details

    • isInverted

      protected boolean isInverted
    • distancePerPulse

      protected org.wpilib.tunable.TunableDouble distancePerPulse
    • distancePerPulseSupplier

      protected DoubleSupplier distancePerPulseSupplier
  • Constructor Details

  • Method Details

    • setDistancePerPulseSupplier

      public void setDistancePerPulseSupplier(DoubleSupplier supplier)
    • getAdjustedDistance

      public double getAdjustedDistance()
    • getAdjustedRate

      public double getAdjustedRate()
    • setInverted

      public void setInverted(boolean inverted)
    • getRate

      protected abstract double getRate()
    • getDistance

      protected abstract double getDistance()
    • setRateWindow

      public final void setRateWindow(org.wpilib.units.measure.Time rateWindow)
      Sets the duration used to calculate the encoder rate.

      The duration must be between 5 and 255 milliseconds, inclusive. It is rounded to the nearest millisecond to match the resolution supported by WPILib.

      Parameters:
      rateWindow - rate calculation window
    • setRateWindowMilliseconds

      protected abstract void setRateWindowMilliseconds(int rateWindowMilliseconds)
    • updateInputs

      public abstract void updateInputs(XEncoderInputs inputs)
    • refreshDataFrame

      public void refreshDataFrame()
      Description copied from interface: DataFrameRefreshable
      Consumes and processes inputs from the device or subsystem.
      Specified by:
      refreshDataFrame in interface DataFrameRefreshable