Class EncoderPIDSrc

  • All Implemented Interfaces:
    PIDRateValueSrc<edu.wpi.first.wpilibj.pidwrappers.PIDEncoder>, PIDRawValueSrc<edu.wpi.first.wpilibj.pidwrappers.PIDEncoder>, PIDSrc<edu.wpi.first.wpilibj.pidwrappers.PIDEncoder,​java.lang.Float>, ComposedComponent<edu.wpi.first.wpilibj.Encoder>, edu.wpi.first.wpilibj.PIDSource

    public class EncoderPIDSrc
    extends java.lang.Object
    implements PIDRateValueSrc<edu.wpi.first.wpilibj.pidwrappers.PIDEncoder>, PIDRawValueSrc<edu.wpi.first.wpilibj.pidwrappers.PIDEncoder>, ComposedComponent<edu.wpi.first.wpilibj.Encoder>
    A PID source backed by a physical Encoder. Defaults to returning encoder rate values.
    • Constructor Summary

      Constructors 
      Constructor Description
      EncoderPIDSrc​(edu.wpi.first.wpilibj.pidwrappers.PIDEncoder enc)
      Create a new EncoderPidSrc instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Collection<edu.wpi.first.wpilibj.Encoder> getComposedComponents()
      Get the composed components within this one.
      edu.wpi.first.wpilibj.PIDSourceType getPIDSourceType()  
      java.lang.Float getPIDValue()
      Get the measured value of the sensor behind this PIDSrc.
      edu.wpi.first.wpilibj.pidwrappers.PIDEncoder getSensor()
      Get the sensor behind this PIDSrc.
      void setPIDSourceType​(edu.wpi.first.wpilibj.PIDSourceType pidSourceType)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface ca.team3161.lib.robot.pid.PIDSrc

        pidGet
    • Constructor Detail

      • EncoderPIDSrc

        public EncoderPIDSrc​(edu.wpi.first.wpilibj.pidwrappers.PIDEncoder enc)
        Create a new EncoderPidSrc instance.
        Parameters:
        enc - an Encoder object to use as a PIDSrc
    • Method Detail

      • getSensor

        public edu.wpi.first.wpilibj.pidwrappers.PIDEncoder getSensor()
        Get the sensor behind this PIDSrc.
        Specified by:
        getSensor in interface PIDSrc<edu.wpi.first.wpilibj.pidwrappers.PIDEncoder,​java.lang.Float>
        Returns:
        the sensor.
      • getPIDValue

        public java.lang.Float getPIDValue()
        Get the measured value of the sensor behind this PIDSrc.
        Specified by:
        getPIDValue in interface PIDSrc<edu.wpi.first.wpilibj.pidwrappers.PIDEncoder,​java.lang.Float>
        Returns:
        the value.
      • getComposedComponents

        public java.util.Collection<edu.wpi.first.wpilibj.Encoder> getComposedComponents()
        Get the composed components within this one.
        Specified by:
        getComposedComponents in interface ComposedComponent<edu.wpi.first.wpilibj.Encoder>
        Returns:
        the composed components.
      • getPIDSourceType

        public edu.wpi.first.wpilibj.PIDSourceType getPIDSourceType()
        Specified by:
        getPIDSourceType in interface edu.wpi.first.wpilibj.PIDSource
      • setPIDSourceType

        public void setPIDSourceType​(edu.wpi.first.wpilibj.PIDSourceType pidSourceType)
        Specified by:
        setPIDSourceType in interface edu.wpi.first.wpilibj.PIDSource