Class Pigeon2
java.lang.Object
com.ctre.phoenix6.hardware.ParentDevice
com.ctre.phoenix6.hardware.core.CorePigeon2
com.ctre.phoenix6.hardware.Pigeon2
- All Implemented Interfaces:
PhoenixAlertable, CommonDevice, AutoCloseable, TelemetryLoggable
WPILib-integrated version of
CorePigeon2.-
Nested Class Summary
Nested classes/interfaces inherited from class ParentDevice
ParentDevice.MapGenerator -
Field Summary
Fields inherited from class ParentDevice
_emptyControl, deviceIdentifier -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()final QuaternionReturns the orientation of the Pigeon 2 as aQuaternion.final Rotation2dReturns the heading of the Pigeon 2 as aRotation2d.final Rotation3dReturns the orientation of the Pigeon 2 as aRotation3dcreated from the quaternion signals.Gets the telemetry table type.voidlogTo(TelemetryTable table) Logs the object to aTelemetryTable.static Pigeon2none()Constructs a stubbed-out Pigeon2, where all status signals, controls, configs, etc.final voidreset()Resets the Pigeon 2 to a heading of zero.Methods inherited from class 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_SaturatedAccelerometer, clearStickyFault_SaturatedAccelerometer, clearStickyFault_SaturatedGyroscope, clearStickyFault_SaturatedGyroscope, clearStickyFault_SaturatedMagnetometer, clearStickyFault_SaturatedMagnetometer, clearStickyFault_Undervoltage, clearStickyFault_Undervoltage, clearStickyFault_UnlicensedFeatureInUse, clearStickyFault_UnlicensedFeatureInUse, clearStickyFaults, clearStickyFaults, getAccelerationX, getAccelerationX, getAccelerationY, getAccelerationY, getAccelerationZ, getAccelerationZ, getAccumGyroX, getAccumGyroX, getAccumGyroY, getAccumGyroY, getAccumGyroZ, getAccumGyroZ, getAngularVelocityXDevice, getAngularVelocityXDevice, getAngularVelocityXWorld, getAngularVelocityXWorld, getAngularVelocityYDevice, getAngularVelocityYDevice, getAngularVelocityYWorld, getAngularVelocityYWorld, getAngularVelocityZDevice, getAngularVelocityZDevice, getAngularVelocityZWorld, getAngularVelocityZWorld, getConfigurator, getFault_BootDuringEnable, getFault_BootDuringEnable, getFault_BootIntoMotion, getFault_BootIntoMotion, getFault_BootupAccelerometer, getFault_BootupAccelerometer, getFault_BootupGyroscope, getFault_BootupGyroscope, getFault_BootupMagnetometer, getFault_BootupMagnetometer, getFault_DataAcquiredLate, getFault_DataAcquiredLate, getFault_Hardware, getFault_Hardware, getFault_LoopTimeSlow, getFault_LoopTimeSlow, getFault_SaturatedAccelerometer, getFault_SaturatedAccelerometer, getFault_SaturatedGyroscope, getFault_SaturatedGyroscope, getFault_SaturatedMagnetometer, getFault_SaturatedMagnetometer, getFault_Undervoltage, getFault_Undervoltage, getFault_UnlicensedFeatureInUse, getFault_UnlicensedFeatureInUse, getFaultField, getFaultField, getGravityVectorX, getGravityVectorX, getGravityVectorY, getGravityVectorY, getGravityVectorZ, getGravityVectorZ, getIsProLicensed, getIsProLicensed, getMagneticFieldX, getMagneticFieldX, getMagneticFieldY, getMagneticFieldY, getMagneticFieldZ, getMagneticFieldZ, getNoMotionCount, getNoMotionCount, getNoMotionEnabled, getNoMotionEnabled, getPitch, getPitch, getQuatW, getQuatW, getQuatX, getQuatX, getQuatY, getQuatY, getQuatZ, getQuatZ, getRawMagneticFieldX, getRawMagneticFieldX, getRawMagneticFieldY, getRawMagneticFieldY, getRawMagneticFieldZ, getRawMagneticFieldZ, getRoll, getRoll, getSimState, getStickyFault_BootDuringEnable, getStickyFault_BootDuringEnable, getStickyFault_BootIntoMotion, getStickyFault_BootIntoMotion, getStickyFault_BootupAccelerometer, getStickyFault_BootupAccelerometer, getStickyFault_BootupGyroscope, getStickyFault_BootupGyroscope, getStickyFault_BootupMagnetometer, getStickyFault_BootupMagnetometer, getStickyFault_DataAcquiredLate, getStickyFault_DataAcquiredLate, getStickyFault_Hardware, getStickyFault_Hardware, getStickyFault_LoopTimeSlow, getStickyFault_LoopTimeSlow, getStickyFault_SaturatedAccelerometer, getStickyFault_SaturatedAccelerometer, getStickyFault_SaturatedGyroscope, getStickyFault_SaturatedGyroscope, getStickyFault_SaturatedMagnetometer, getStickyFault_SaturatedMagnetometer, getStickyFault_Undervoltage, getStickyFault_Undervoltage, getStickyFault_UnlicensedFeatureInUse, getStickyFault_UnlicensedFeatureInUse, getStickyFaultField, getStickyFaultField, getSupplyVoltage, getSupplyVoltage, getTemperature, getTemperature, getTemperatureCompensationDisabled, getTemperatureCompensationDisabled, getUpTime, getUpTime, getVersion, getVersion, getVersionBugfix, getVersionBugfix, getVersionBuild, getVersionBuild, getVersionMajor, getVersionMajor, getVersionMinor, getVersionMinor, getYaw, getYaw, registerAlerts, setYaw, setYaw, setYaw, setYawMethods inherited from class ParentDevice
getAppliedControl, getDeviceHash, getDeviceID, getIsConnectedChecker, getIsConnectedChecker, getNetwork, getResetOccurredChecker, hasResetOccurred, isConnected, isConnected, lookupStatusSignal, lookupStatusSignal, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilization, optimizeBusUtilizationForAll, optimizeBusUtilizationForAll, optimizeBusUtilizationForAll, resetSignalFrequencies, resetSignalFrequencies, resetSignalFrequenciesForAll, setControlPrivate, toString
-
Constructor Details
-
Pigeon2
Constructs a new Pigeon 2 sensor object.- Parameters:
deviceId- ID of the device, as configured in Phoenix Tunercanbus- The CAN bus this device is on
-
-
Method Details
-
none
Constructs a stubbed-out Pigeon2, where all status signals, controls, configs, etc. perform no action and immediately return OK. This can be used to silence error messages for devices that have been completely removed from the robot.- Returns:
- Stubbed-out Pigeon2
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
reset
public final void reset()Resets the Pigeon 2 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.
-
getRotation2d
Returns the heading of the Pigeon 2 as aRotation2d.The angle increases as the Pigeon 2 turns counterclockwise when looked at from the top. This follows the NWU axis convention.
- Returns:
- The current heading of the Pigeon 2 as a
Rotation2d
-
getRotation3d
Returns the orientation of the Pigeon 2 as aRotation3dcreated from the quaternion signals.- Returns:
- The current orientation of the Pigeon 2 as a
Rotation3d
-
getQuaternion
Returns the orientation of the Pigeon 2 as aQuaternion.- Returns:
- The current orientation of the Pigeon 2 as a
Quaternion
-
logTo
Logs the object to aTelemetryTable.- Specified by:
logToin interfaceTelemetryLoggable- Parameters:
table- telemetry table
-
getTelemetryType
Gets the telemetry table type.- Specified by:
getTelemetryTypein interfaceTelemetryLoggable- Returns:
- Table type
-