Class WPI_PigeonIMU
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
,edu.wpi.first.wpilibj.interfaces.Gyro
,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ctre.phoenix.sensors.PigeonIMU
PigeonIMU.CalibrationMode, PigeonIMU.FusionStatus, PigeonIMU.GeneralStatus, PigeonIMU.PigeonState
-
Constructor Summary
ConstructorDescriptionWPI_PigeonIMU
(int deviceNumber) Constructor for Pigeon IMU.WPI_PigeonIMU
(TalonSRX talon) Construtor for WPI_PigeonIMU. -
Method Summary
Modifier and TypeMethodDescriptionvoid
This function does nothing, it exists to satisfy the WPILib Gyro interface.void
close()
double
getAngle()
Return the heading of the robot in degrees.double
getRate()
Return the rate of rotation of the gyro.edu.wpi.first.math.geometry.Rotation2d
Return the heading of the robot as aRotation2d
.void
initSendable
(edu.wpi.first.util.sendable.SendableBuilder builder) Initializes thisSendable
object.void
reset()
Reset the gyro.Methods inherited from class com.ctre.phoenix.sensors.PigeonIMU
addFusedHeading, addFusedHeading, configAllSettings, configAllSettings, configFactoryDefault, configFactoryDefault, enterCalibrationMode, enterCalibrationMode, getAccelerometerAngles, getAllConfigs, getAllConfigs, getFaults, getFusedHeading, getFusedHeading, getGeneralStatus, getState, getStickyFaults, setCompassAngle, setCompassAngle, setCompassDeclination, setCompassDeclination, setFusedHeading, setFusedHeading, setFusedHeadingToCompass, setFusedHeadingToCompass, setTemperatureCompensationDisable, setTemperatureCompensationDisable
Methods inherited from class com.ctre.phoenix.sensors.BasePigeon
addYaw, addYaw, clearStickyFaults, clearStickyFaults, configGetCustomParam, configGetCustomParam, configGetParameter, configGetParameter, configGetParameter, configGetParameter, configSetCustomParam, configSetCustomParam, configSetParameter, configSetParameter, configSetParameter, configSetParameter, DestroyObject, get6dQuaternion, getAbsoluteCompassHeading, getAccumGyro, getBiasedAccelerometer, getBiasedMagnetometer, getCompassFieldStrength, getCompassHeading, getDeviceID, getFirmwareVersion, getHandle, getLastError, getPitch, getRawGyro, getRawMagnetometer, getResetCount, getResetFlags, getRoll, getSimCollection, getStatusFramePeriod, getStatusFramePeriod, getTemp, getUpTime, getYaw, getYawPitchRoll, hasResetOccurred, setAccumZAngle, setAccumZAngle, setControlFramePeriod, setControlFramePeriod, setStatusFramePeriod, setStatusFramePeriod, setStatusFramePeriod, setStatusFramePeriod, setYaw, setYaw, setYawToCompass, setYawToCompass
-
Constructor Details
-
WPI_PigeonIMU
Constructor for Pigeon IMU.- Parameters:
deviceNumber
- device ID of Pigeon IMU
-
WPI_PigeonIMU
Construtor for WPI_PigeonIMU.- Parameters:
talon
- The Talon SRX ribbon-cabled to Pigeon.
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
-
calibrate
This function does nothing, it exists to satisfy the WPILib Gyro interface. Pigeon does calibration on boot and any one-time calibrations (like temperature) are done via Phoenix Tuner.- Specified by:
calibrate
in interfaceedu.wpi.first.wpilibj.interfaces.Gyro
-
reset
Description copied from interface:edu.wpi.first.wpilibj.interfaces.Gyro
Reset the gyro. Resets the gyro to a heading of zero. This can be used if there is significant drift in the gyro and it needs to be recalibrated after it has been running.- Specified by:
reset
in interfaceedu.wpi.first.wpilibj.interfaces.Gyro
-
getAngle
Description copied from interface:edu.wpi.first.wpilibj.interfaces.Gyro
Return the heading of the robot in degrees.The angle is continuous, that is it will continue from 360 to 361 degrees. This allows algorithms that wouldn't want to see a discontinuity in the gyro output as it sweeps past from 360 to 0 on the second time around.
The angle is expected to increase as the gyro turns clockwise when looked at from the top. It needs to follow the NED axis convention.
This heading is based on integration of the returned rate from the gyro.
- Specified by:
getAngle
in interfaceedu.wpi.first.wpilibj.interfaces.Gyro
- Returns:
- the current heading of the robot in degrees.
-
getRate
Description copied from interface:edu.wpi.first.wpilibj.interfaces.Gyro
Return the rate of rotation of the gyro.The rate is based on the most recent reading of the gyro analog value
The rate is expected to be positive as the gyro turns clockwise when looked at from the top. It needs to follow the NED axis convention.
- Specified by:
getRate
in interfaceedu.wpi.first.wpilibj.interfaces.Gyro
- Returns:
- the current rate in degrees per second
-
getRotation2d
Description copied from interface:edu.wpi.first.wpilibj.interfaces.Gyro
Return the heading of the robot as aRotation2d
.The angle is continuous, that is it will continue from 360 to 361 degrees. This allows algorithms that wouldn't want to see a discontinuity in the gyro output as it sweeps past from 360 to 0 on the second time around.
The angle is expected to increase as the gyro turns counterclockwise when looked at from the top. It needs to follow the NWU axis convention.
This heading is based on integration of the returned rate from the gyro.
- Specified by:
getRotation2d
in interfaceedu.wpi.first.wpilibj.interfaces.Gyro
- Returns:
- the current heading of the robot as a
Rotation2d
.
-
initSendable
Description copied from interface:edu.wpi.first.util.sendable.Sendable
Initializes thisSendable
object.- Specified by:
initSendable
in interfaceedu.wpi.first.util.sendable.Sendable
- Parameters:
builder
- sendable builder
-