22struct [[deprecated("This device's Phoenix 5 API is deprecated for removal in the 2025 season."
23 "Users should update to Phoenix 6 firmware and migrate to the Phoenix 6 API."
24 "A migration guide is available at https:
87 return HardwareFault |
91 SaturatedRotVelocity |
103 uint64_t commonFaults = 0;
104 commonFaults |= HardwareFault ? 1 : 0; commonFaults <<= 1;
105 commonFaults |= APIError ? 1 : 0; commonFaults <<= 1;
106 commonFaults |= UnderVoltage ? 1 : 0; commonFaults <<= 1;
107 commonFaults |= ResetDuringEn ? 1 : 0; commonFaults <<= 1;
109 uint64_t deviceFaults = 0;
110 deviceFaults |= SaturatedRotVelocity ? 1 : 0; deviceFaults <<= 1;
111 deviceFaults |= SaturatedAccel ? 1 : 0; deviceFaults <<= 1;
112 deviceFaults |= SaturatedMag ? 1 : 0; deviceFaults <<= 1;
116 deviceFaults |= BootIntoMotion ? 1 : 0; deviceFaults <<= 1;
117 deviceFaults |= MagnetometerFault ? 1 : 0; deviceFaults <<= 1;
118 deviceFaults |= GyroFault ? 1 : 0; deviceFaults <<= 1;
119 deviceFaults |= AccelFault ? 1 : 0; deviceFaults <<= 1;
121 return commonFaults | (deviceFaults << 30);
130 HardwareFault = (bits & mask) ?
true :
false; mask <<= 1;
131 APIError = (bits & mask) ?
true :
false; mask <<= 1;
132 UnderVoltage = (bits & mask) ?
true :
false; mask <<= 1;
133 ResetDuringEn = (bits & mask) ?
true :
false; mask <<= 1;
135 AccelFault = (bits & mask) ?
true :
false; mask <<= 1;
136 GyroFault = (bits & mask) ?
true :
false; mask <<= 1;
137 MagnetometerFault = (bits & mask) ?
true :
false; mask <<= 1;
138 BootIntoMotion = (bits & mask) ?
true :
false; mask <<= 1;
142 SaturatedMag = (bits & mask) ?
true :
false; mask <<= 1;
143 SaturatedAccel = (bits & mask) ?
true :
false; mask <<= 1;
144 SaturatedRotVelocity = (bits & mask) ?
true :
false; mask <<= 1;
namespace ctre
Definition: paramEnum.h:5
Sticky faults available to Pigeon.
Definition: Pigeon2_StickyFaults.h:25
bool SaturatedMag
The device saw a magnetic field that exceeded its maximum.
Definition: Pigeon2_StickyFaults.h:57
bool MagnetometerFault
The magnetometer failed its self-test.
Definition: Pigeon2_StickyFaults.h:70
Pigeon2_StickyFaults()
Definition: Pigeon2_StickyFaults.h:154
bool BootIntoMotion
The Pigeon saw motion as soon as it booted, and didn't attempt to self-test its features.
Definition: Pigeon2_StickyFaults.h:64
bool HasAnyFault() const
Definition: Pigeon2_StickyFaults.h:86
void Update(uint64_t bits)
Updates current fault list with specified bit field of faults.
Definition: Pigeon2_StickyFaults.h:128
uint64_t ToBitfield() const
Definition: Pigeon2_StickyFaults.h:102
bool SaturatedRotVelocity
The device rotated at a rate that exceeded its maximum.
Definition: Pigeon2_StickyFaults.h:47
bool SaturatedAccel
The device saw an acceleration that exceeded its maximum.
Definition: Pigeon2_StickyFaults.h:52
bool HardwareFault
Device detects hardware failure.
Definition: Pigeon2_StickyFaults.h:29
bool UnderVoltage
Device is under 6.5V.
Definition: Pigeon2_StickyFaults.h:37
bool ResetDuringEn
Device was powered-on or reset while robot is enabled.
Definition: Pigeon2_StickyFaults.h:42
Pigeon2_StickyFaults(uint64_t bits)
Creates fault list with specified bit field of faults.
Definition: Pigeon2_StickyFaults.h:151
bool APIError
API error detected.
Definition: Pigeon2_StickyFaults.h:33
bool GyroFault
The gyro failed its self-test.
Definition: Pigeon2_StickyFaults.h:75
bool AccelFault
The Accelerometer failed its self-test.
Definition: Pigeon2_StickyFaults.h:81