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_Faults.h:25
bool ResetDuringEn
Device was powered-on or reset while robot is enabled.
Definition: Pigeon2_Faults.h:42
bool UnderVoltage
Device is under 6.5V.
Definition: Pigeon2_Faults.h:37
uint64_t ToBitfield() const
Definition: Pigeon2_Faults.h:102
Pigeon2_Faults()
Definition: Pigeon2_Faults.h:154
bool HardwareFault
Device detects hardware failure.
Definition: Pigeon2_Faults.h:29
void Update(uint64_t bits)
Updates current fault list with specified bit field of faults.
Definition: Pigeon2_Faults.h:128
bool MagnetometerFault
The magnetometer failed its self-test.
Definition: Pigeon2_Faults.h:70
bool GyroFault
The gyro failed its self-test.
Definition: Pigeon2_Faults.h:75
bool SaturatedAccel
The device saw an acceleration that exceeded its maximum.
Definition: Pigeon2_Faults.h:52
bool SaturatedRotVelocity
The device rotated at a rate that exceeded its maximum.
Definition: Pigeon2_Faults.h:47
bool APIError
API error detected.
Definition: Pigeon2_Faults.h:33
bool HasAnyFault() const
Definition: Pigeon2_Faults.h:86
bool AccelFault
The Accelerometer failed its self-test.
Definition: Pigeon2_Faults.h:81
bool SaturatedMag
The device saw a magnetic field that exceeded its maximum.
Definition: Pigeon2_Faults.h:57
bool BootIntoMotion
The Pigeon saw motion as soon as it booted, and didn't attempt to self-test its features.
Definition: Pigeon2_Faults.h:64
Pigeon2_Faults(uint64_t bits)
Creates fault list with specified bit field of faults.
Definition: Pigeon2_Faults.h:151