Class GyroAnglePIDSrc

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

    public class GyroAnglePIDSrc
    extends java.lang.Object
    implements PIDSrc<edu.wpi.first.wpilibj.pidwrappers.PIDAnalogGyro,​java.lang.Float>, PIDAngleValueSrc<edu.wpi.first.wpilibj.pidwrappers.PIDAnalogGyro>, ComposedComponent<edu.wpi.first.wpilibj.interfaces.Gyro>
    A PID source backed by a physical Gyroscope. Defaults to returning gyroscope angle values.
    • Constructor Summary

      Constructors 
      Constructor Description
      GyroAnglePIDSrc​(edu.wpi.first.wpilibj.pidwrappers.PIDAnalogGyro gyro)
      Create a new GyroAnglePIDSrc instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Collection<edu.wpi.first.wpilibj.interfaces.Gyro> 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.PIDAnalogGyro 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

      • GyroAnglePIDSrc

        public GyroAnglePIDSrc​(edu.wpi.first.wpilibj.pidwrappers.PIDAnalogGyro gyro)
        Create a new GyroAnglePIDSrc instance.
        Parameters:
        gyro - a Gyro object to use as a PIDSrc.
    • Method Detail

      • 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.PIDAnalogGyro,​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.PIDAnalogGyro>
        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.PIDAnalogGyro>
        Returns:
        the maximal angle of this sensor
      • getSensor

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

        public java.util.Collection<edu.wpi.first.wpilibj.interfaces.Gyro> getComposedComponents()
        Get the composed components within this one.
        Specified by:
        getComposedComponents in interface ComposedComponent<edu.wpi.first.wpilibj.interfaces.Gyro>
        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