Interface RelativeEncoder

All Known Implementing Classes:
DetachedEncoder, SparkFlexExternalEncoder, SparkMaxAlternateEncoder, SparkRelativeEncoder, SplineEncoder

public interface RelativeEncoder
  • Method Details

    • getPosition

      Signal<Double> getPosition()
      Get the position of the motor. This returns the native units of 'rotations'.
      Returns:
      Number of rotations of the motor
    • getVelocity

      Signal<Double> getVelocity()
      Get the velocity of the motor. This returns the native units of 'RPM'.
      Returns:
      Number the RPM of the motor
    • setPosition

      REVLibError setPosition(double position)
      Set the position of the encoder. By default the units are 'rotations'.
      Parameters:
      position - Number of rotations of the motor
      Returns:
      REVLibError.kOk if successful