GyroBase

class wpilib.GyroBase[source]

Bases: wpilib.SensorBase

GyroBase is the common base class for Gyro implementations such as AnalogGyro.

class PIDSourceType

Bases: object

A description for the type of output value to provide to a PIDController

kDisplacement = 0
kRate = 1
GyroBase.calibrate()[source]
GyroBase.getAngle()[source]
GyroBase.getPIDSourceType()[source]
GyroBase.getRate()[source]
GyroBase.pidGet()[source]

Get the output of the gyro for use with PIDControllers. May be the angle or rate depending on the set PIDSourceType

Returns:the current angle according to the gyro
Return type:float
GyroBase.reset()[source]
GyroBase.setPIDSourceType(pidSource)[source]

Set which parameter of the gyro you are using as a process control variable. The Gyro class supports the rate and angle parameters.

Parameters:pidSource (PIDSource.PIDSourceType) – An enum to select the parameter.