Package com.ctre.phoenix6.hardware
Class Pigeon2
java.lang.Object
com.ctre.phoenix6.jni.CtreJniWrapper
com.ctre.phoenix6.hardware.ParentDevice
com.ctre.phoenix6.hardware.core.CorePigeon2
com.ctre.phoenix6.hardware.Pigeon2
- All Implemented Interfaces:
Sendable
,Gyro
,AutoCloseable
public class Pigeon2 extends CorePigeon2 implements Sendable, Gyro
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ctre.phoenix6.hardware.ParentDevice
ParentDevice.MapGenerator<T>
-
Field Summary
Fields inherited from class com.ctre.phoenix6.hardware.ParentDevice
deviceIdentifier, kDefaultControlRatePeriodsSec
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description void
calibrate()
This function does nothing; it exists to satisfy the WPILib Gyro interface.void
close()
double
getAngle()
double
getRate()
Rotation2d
getRotation2d()
void
initSendable(SendableBuilder builder)
void
reset()
Methods inherited from class com.ctre.phoenix6.hardware.core.CorePigeon2
clearStickyFault_BootDuringEnable, clearStickyFault_BootDuringEnable, clearStickyFault_BootIntoMotion, clearStickyFault_BootIntoMotion, clearStickyFault_BootupAccelerometer, clearStickyFault_BootupAccelerometer, clearStickyFault_BootupGyroscope, clearStickyFault_BootupGyroscope, clearStickyFault_BootupMagnetometer, clearStickyFault_BootupMagnetometer, clearStickyFault_DataAcquiredLate, clearStickyFault_DataAcquiredLate, clearStickyFault_Hardware, clearStickyFault_Hardware, clearStickyFault_LoopTimeSlow, clearStickyFault_LoopTimeSlow, clearStickyFault_SaturatedAccelometer, clearStickyFault_SaturatedAccelometer, clearStickyFault_SaturatedGyroscope, clearStickyFault_SaturatedGyroscope, clearStickyFault_SaturatedMagnetometer, clearStickyFault_SaturatedMagnetometer, clearStickyFault_Undervoltage, clearStickyFault_Undervoltage, clearStickyFaults, clearStickyFaults, getAccelerationX, getAccelerationY, getAccelerationZ, getAccumGyroX, getAccumGyroY, getAccumGyroZ, getAngularVelocityX, getAngularVelocityY, getAngularVelocityZ, getConfigurator, getFault_BootDuringEnable, getFault_BootIntoMotion, getFault_BootupAccelerometer, getFault_BootupGyroscope, getFault_BootupMagnetometer, getFault_DataAcquiredLate, getFault_Hardware, getFault_LoopTimeSlow, getFault_SaturatedAccelometer, getFault_SaturatedGyroscope, getFault_SaturatedMagnetometer, getFault_Undervoltage, getFault_UnlicensedFeatureInUse, getFaultField, getGravityVectorX, getGravityVectorY, getGravityVectorZ, getIsProLicensed, getMagneticFieldX, getMagneticFieldY, getMagneticFieldZ, getNoMotionCount, getNoMotionEnabled, getPitch, getQuatW, getQuatX, getQuatY, getQuatZ, getRawMagneticFieldX, getRawMagneticFieldY, getRawMagneticFieldZ, getResetOccurredChecker, getRoll, getSimState, getStickyFault_BootDuringEnable, getStickyFault_BootIntoMotion, getStickyFault_BootupAccelerometer, getStickyFault_BootupGyroscope, getStickyFault_BootupMagnetometer, getStickyFault_DataAcquiredLate, getStickyFault_Hardware, getStickyFault_LoopTimeSlow, getStickyFault_SaturatedAccelometer, getStickyFault_SaturatedGyroscope, getStickyFault_SaturatedMagnetometer, getStickyFault_Undervoltage, getStickyFault_UnlicensedFeatureInUse, getStickyFaultField, getSupplyVoltage, getTemperature, getTemperatureCompensationDisabled, getUpTime, getVersion, getVersionBugfix, getVersionBuild, getVersionMajor, getVersionMinor, getYaw, hasResetOccurred, reportIfTooOld, setControl, setYaw, setYaw
Methods inherited from class com.ctre.phoenix6.hardware.ParentDevice
getAppliedControl, getDeviceHash, getDeviceID, getNetwork, lookupStatusSignal, lookupStatusSignal, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilizationForAll, setControlPrivate
-
Constructor Details
-
Pigeon2
Constructs a new Pigeon 2 sensor object.Constructs the device using the default CAN bus for the system:
- "rio" on roboRIO
- "can0" on Linux
- "*" on Windows
- Parameters:
deviceId
- ID of the device, as configured in Phoenix Tuner.
-
Pigeon2
Constructs a new Pigeon 2 sensor object.- Parameters:
deviceId
- ID of the device, as configured in Phoenix Tuner.canbus
- Name of the CAN bus this device is on. Possible CAN bus strings are:- "rio" for the native roboRIO CAN bus
- CANivore name or serial number
- SocketCAN interface (non-FRC Linux only)
- "*" for any CANivore seen by the program
- empty string (default) to select the default for the
system:
- "rio" on roboRIO
- "can0" on Linux
- "*" on Windows
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
-
calibrate
This function does nothing; it exists to satisfy the WPILib Gyro interface.Pigeon 2 does not require manual calibration.
-
reset
-
getAngle
-
getRate
-
getRotation2d
- Specified by:
getRotation2d
in interfaceGyro
-
initSendable
- Specified by:
initSendable
in interfaceSendable
-