Class XDutyCycleEncoder

java.lang.Object
xbot.common.controls.sensors.XDutyCycleEncoder
All Implemented Interfaces:
DataFrameRefreshable, XBaseIO
Direct Known Subclasses:
DutyCycleEncoderWpiAdapter, MockDutyCycleEncoder

public abstract class XDutyCycleEncoder extends Object implements XBaseIO, DataFrameRefreshable
  • Field Details

    • channel

      protected int channel
    • inverted

      protected boolean inverted
  • Constructor Details

  • Method Details

    • getAbsolutePosition

      public Rotation2d getAbsolutePosition()
      Typically not recommended - use getWrappedPosition() instead.
      Returns:
      the absolute position of the encoder in degrees from (0, 360)
    • getAbsoluteDegrees

      public double getAbsoluteDegrees()
    • getWrappedPosition

      public WrappedRotation2d getWrappedPosition()
      Returns:
      the absolute position of the encoder in degrees from (-180, 180)
    • getChannel

      public int getChannel()
      Specified by:
      getChannel in interface XBaseIO
    • setInverted

      public void setInverted(boolean inverted)
    • inversionFactor

      protected double inversionFactor()
    • updateInputs

      public abstract void updateInputs(XDutyCycleEncoderInputs 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