Package edu.wpi.first.wpilibj
Class GyroBase
- java.lang.Object
-
- edu.wpi.first.wpilibj.GyroBase
-
- All Implemented Interfaces:
Gyro,PIDSource,Sendable,AutoCloseable
- Direct Known Subclasses:
ADXRS450_Gyro,AnalogGyro
public abstract class GyroBase extends Object implements Gyro, PIDSource, Sendable
GyroBase is the common base class for Gyro implementations such as AnalogGyro.
-
-
Constructor Summary
Constructors Constructor Description GyroBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PIDSourceTypegetPIDSourceType()Get which parameter of the device you are using as a process control variable.voidinitSendable(SendableBuilder builder)Initializes thisSendableobject.doublepidGet()Get the output of the gyro for use with PIDControllers.voidsetPIDSourceType(PIDSourceType pidSource)Set which parameter of the gyro you are using as a process control variable.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.AutoCloseable
close
-
Methods inherited from interface edu.wpi.first.wpilibj.interfaces.Gyro
calibrate, getAngle, getRate, reset
-
Methods inherited from interface edu.wpi.first.wpilibj.Sendable
addChild, getName, getSubsystem, setName, setName, setName, setName, setSubsystem
-
-
-
-
Method Detail
-
setPIDSourceType
public void setPIDSourceType(PIDSourceType pidSource)
Set which parameter of the gyro you are using as a process control variable. The Gyro class supports the rate and displacement parameters- Specified by:
setPIDSourceTypein interfacePIDSource- Parameters:
pidSource- An enum to select the parameter.
-
getPIDSourceType
public PIDSourceType getPIDSourceType()
Description copied from interface:PIDSourceGet which parameter of the device you are using as a process control variable.- Specified by:
getPIDSourceTypein interfacePIDSource- Returns:
- the currently selected PID source parameter
-
pidGet
public double pidGet()
Get the output of the gyro for use with PIDControllers. May be the angle or rate depending on the set PIDSourceType
-
initSendable
public void initSendable(SendableBuilder builder)
Description copied from interface:SendableInitializes thisSendableobject.- Specified by:
initSendablein interfaceSendable- Parameters:
builder- sendable builder
-
-