Package edu.wpi.first.wpilibj
Class GyroBase
- java.lang.Object
-
- edu.wpi.first.wpilibj.SendableBase
-
- edu.wpi.first.wpilibj.GyroBase
-
- All Implemented Interfaces:
Gyro
,PIDSource
,Sendable
,AutoCloseable
- Direct Known Subclasses:
ADXRS450_Gyro
,AnalogGyro
public abstract class GyroBase extends SendableBase implements Gyro, PIDSource
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 PIDSourceType
getPIDSourceType()
Get which parameter of the device you are using as a process control variable.void
initSendable(SendableBuilder builder)
Initializes thisSendable
object.double
pidGet()
Get the output of the gyro for use with PIDControllers.void
setPIDSourceType(PIDSourceType pidSource)
Set which parameter of the gyro you are using as a process control variable.-
Methods inherited from class edu.wpi.first.wpilibj.SendableBase
addChild, close, free, getName, getSubsystem, setName, setName, setName, setSubsystem
-
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
-
-
-
-
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:
setPIDSourceType
in interfacePIDSource
- Parameters:
pidSource
- An enum to select the parameter.
-
getPIDSourceType
public PIDSourceType getPIDSourceType()
Description copied from interface:PIDSource
Get which parameter of the device you are using as a process control variable.- Specified by:
getPIDSourceType
in 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:Sendable
Initializes thisSendable
object.- Specified by:
initSendable
in interfaceSendable
- Parameters:
builder
- sendable builder
-
-