Class PotentiometerVoltagePIDSrc

  • All Implemented Interfaces:
    PIDAngleValueSrc<edu.wpi.first.wpilibj.pidwrappers.PIDAnalogPotentiometer>, PIDSrc<edu.wpi.first.wpilibj.pidwrappers.PIDAnalogPotentiometer,​java.lang.Float>, ComposedComponent<edu.wpi.first.wpilibj.pidwrappers.PIDAnalogPotentiometer>, edu.wpi.first.wpilibj.PIDSource

    public final class PotentiometerVoltagePIDSrc
    extends java.lang.Object
    implements PIDAngleValueSrc<edu.wpi.first.wpilibj.pidwrappers.PIDAnalogPotentiometer>, ComposedComponent<edu.wpi.first.wpilibj.pidwrappers.PIDAnalogPotentiometer>
    A PID source that converts a rotary potentiometer's voltage output into degrees of rotation.
    • Constructor Summary

      Constructors 
      Constructor Description
      PotentiometerVoltagePIDSrc​(edu.wpi.first.wpilibj.pidwrappers.PIDAnalogPotentiometer pot, float minVolt, float maxVolt, float minAngle, float maxAngle)
      Create a new PotentiometerPidSrc instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Float getAngle()
      Get the angle measured by this sensor.
      java.util.Collection<edu.wpi.first.wpilibj.pidwrappers.PIDAnalogPotentiometer> getComposedComponents()
      Get the composed components within this one.
      java.lang.Float getMaxAngle()
      The maximal angle of this sensor.
      java.lang.Float getMinAngle()
      The minimal angle of this sensor.
      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.PIDAnalogPotentiometer 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

      • PotentiometerVoltagePIDSrc

        public PotentiometerVoltagePIDSrc​(edu.wpi.first.wpilibj.pidwrappers.PIDAnalogPotentiometer pot,
                                          float minVolt,
                                          float maxVolt,
                                          float minAngle,
                                          float maxAngle)
        Create a new PotentiometerPidSrc instance.
        Parameters:
        pot - a Potentiometer object to measure voltages from
        minVolt - the minimum measured voltage from the potentiometer at the "small" movement endpoint of the system
        maxVolt - the maximum measured voltage from the potentiometer at the "large" movement endpoint of the system
        minAngle - the minimum angle the system can physically rotate to
        maxAngle - the maximum angle the system can physically rotate to
    • Method Detail

      • getSensor

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

        public java.lang.Float getAngle()
        Get the angle measured by this sensor.
        Specified by:
        getAngle in interface PIDAngleValueSrc<edu.wpi.first.wpilibj.pidwrappers.PIDAnalogPotentiometer>
        Returns:
        the angle value.
      • getPIDValue

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

        public java.lang.Float getMinAngle()
        The minimal angle of this sensor.
        Specified by:
        getMinAngle in interface PIDAngleValueSrc<edu.wpi.first.wpilibj.pidwrappers.PIDAnalogPotentiometer>
        Returns:
        the minimal angle of this sensor
      • getMaxAngle

        public java.lang.Float getMaxAngle()
        The maximal angle of this sensor.
        Specified by:
        getMaxAngle in interface PIDAngleValueSrc<edu.wpi.first.wpilibj.pidwrappers.PIDAnalogPotentiometer>
        Returns:
        the maximal angle of this sensor
      • getComposedComponents

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

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

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