Interface CustomEncoder

All Superinterfaces:
NativeDerivativeSensor
All Known Implementing Classes:
CANEncoder, CustomDigitalEncoder, EncoderPair

public interface CustomEncoder extends NativeDerivativeSensor
This is an extremely minimal encoder that can be either a normal encoder or a CAN encoder.
  • Method Details

    • getDistance

      double getDistance()
      Gets current distance

      does not indicate sensor errors

    • getDistanceSafely

      double getDistanceSafely() throws InvalidSensorException
      Gets current distance
      Throws:
      InvalidSensorException
    • getDirection

      boolean getDirection()
      Gets direction of most recent movement

      does not indicate sensor errors

    • getDirectionSafely

      boolean getDirectionSafely() throws InvalidSensorException
      Gets direction of most recent movement
      Throws:
      InvalidSensorException
    • getStopped

      boolean getStopped()
      Returns true when stopped

      does not indicate sensor errors

    • getStoppedSafely

      boolean getStoppedSafely() throws InvalidSensorException
      Returns true when stopped
      Throws:
      InvalidSensorException
    • getDistancePerPulse

      double getDistancePerPulse()
      Gets the distance per pulse
    • setDistancePerPulse

      void setDistancePerPulse(double distancePerPulse)
      Sets the distance per pulse
    • getReverseDirection

      boolean getReverseDirection()
      Gets inversion state
    • setReverseDirection

      void setReverseDirection(boolean reverseDirection)
      To the surprise of everyone, enables and disables reverse direction
    • reset

      void reset()
      Resets the encoder