Class EncoderPair

java.lang.Object
lib.custom.sensors.EncoderPair
All Implemented Interfaces:
CustomEncoder, NativeDerivativeSensor

public class EncoderPair extends Object implements CustomEncoder
Amalgamates the data of several encoders for the purpose of controlling a single motion controller.

The amalgamation will be the average. Verify before using this class that all the encoders will be rotating in the same direction with the same rate (before setDistancePerTick).

  • Field Details

    • DEFAULT_DISTANCE_TOLERANCE

      protected static final double DEFAULT_DISTANCE_TOLERANCE
      See Also:
    • DEFAULT_RATE_TOLERANCE

      protected static final double DEFAULT_RATE_TOLERANCE
      See Also:
  • Constructor Details

    • EncoderPair

      public EncoderPair(CustomEncoder encoder1, CustomEncoder encoder2, double distanceTolerance, double rateTolerance)
      Amalgamates the data of two encoders for the purpose of controlling a single motion controller.

      The amalgamation will be the average. Verify before using this class that all the encoders will be rotating in the same direction with the same rate (before setDistancePerTick).

      Parameters:
      encoder1 - The first encoder to amalgamate.
      encoder2 - The second encoder to amalgamate.
      distanceTolerance - The distance by which the encoders can be different before isInSync() returns false
      rateTolerance - The rate by which the encoders can be different before isInSync() returns false
    • EncoderPair

      public EncoderPair(CustomEncoder encoder1, CustomEncoder encoder2)
      Amalgamates the data of two encoders for the purpose of controlling a single motion controller.

      The amalgamation will be the average. Verify before using this class that all the encoders will be rotating in the same direction with the same rate (before setDistancePerTick).

      Parameters:
      encoder1 - The first encoder to amalgamate.
      encoder2 - The second encoder to amalgamate.
  • Method Details