Package ca.team3161.lib.robot.pid
Class EncoderPIDSrc
- java.lang.Object
-
- ca.team3161.lib.robot.pid.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.PIDRateValueSrc
getRate
-
Methods inherited from interface ca.team3161.lib.robot.pid.PIDRawValueSrc
getValue
-
-
-
-
Method Detail
-
getSensor
public edu.wpi.first.wpilibj.pidwrappers.PIDEncoder getSensor()
Get the sensor behind this PIDSrc.
-
getPIDValue
public java.lang.Float getPIDValue()
Get the measured value of the sensor behind this PIDSrc.- Specified by:
getPIDValue
in interfacePIDSrc<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 interfaceComposedComponent<edu.wpi.first.wpilibj.Encoder>
- Returns:
- the composed components.
-
getPIDSourceType
public edu.wpi.first.wpilibj.PIDSourceType getPIDSourceType()
- Specified by:
getPIDSourceType
in interfaceedu.wpi.first.wpilibj.PIDSource
-
setPIDSourceType
public void setPIDSourceType(edu.wpi.first.wpilibj.PIDSourceType pidSourceType)
- Specified by:
setPIDSourceType
in interfaceedu.wpi.first.wpilibj.PIDSource
-
-