ReduxLib C++ 2024.3.2
Loading...
Searching...
No Matches
redux::sensors::canandmag::CanandmagFaults Class Reference

#include <CanandmagFaults.h>

Public Member Functions

constexpr CanandmagFaults (uint8_t field, bool valid)
 

Public Attributes

bool powerCycle
 
bool canIdConflict
 
bool canGeneralError
 
bool outOfTemperatureRange
 
bool hardwareFault
 
bool magnetOutOfRange
 
bool underVolt
 
bool faultsValid
 

Detailed Description

A class to hold device faults for the Canandmag, as returned by Canandmag::GetActiveFaults and Canandmag::GetStickyFaults This class is immutable once constructed.

Constructor & Destructor Documentation

◆ CanandmagFaults()

constexpr redux::sensors::canandmag::CanandmagFaults::CanandmagFaults ( uint8_t  field,
bool  valid 
)
inlineconstexpr

Constructs from a fault field.

Parameters
fieldthe fault bitfield
validwhether data is valid or not

Member Data Documentation

◆ canGeneralError

bool redux::sensors::canandmag::CanandmagFaults::canGeneralError

The CAN general error flag, which will raise if the encoder cannot RX packets reliably. This is usually due to wiring issues, such as a shorted CAN bus

◆ canIdConflict

bool redux::sensors::canandmag::CanandmagFaults::canIdConflict

The CAN ID conflict flag, which is set to true if there is a CAN id conflict. In practice, you should physically inspect the encoder to ensure it's not flashing blue.

◆ faultsValid

bool redux::sensors::canandmag::CanandmagFaults::faultsValid

Flag if any faults data has been received at all from the encoder. This will be false until the first status frame arrives after either the start of robot code or after ClearStickyFaults is called.

◆ hardwareFault

bool redux::sensors::canandmag::CanandmagFaults::hardwareFault

The hardware fault flag, which will raise if a hardware issue is detected. Generally will raise if the device's controller cannot read the physical sensor itself.

◆ magnetOutOfRange

bool redux::sensors::canandmag::CanandmagFaults::magnetOutOfRange

The magnet out of range flag, which will raise if the measured shaft's magnet is not detected. This will match the encoder's LED shining red in normal operation.

◆ outOfTemperatureRange

bool redux::sensors::canandmag::CanandmagFaults::outOfTemperatureRange

The temperature range flag, which will raise if the encoder is not between 0-70 degrees Celsius. This may be of concern if the encoder is near very active motors.

◆ powerCycle

bool redux::sensors::canandmag::CanandmagFaults::powerCycle

The power cycle fault flag, which is set to true when the encoder first boots. Clearing sticky faults and then checking this flag can be used to determine if the encoder rebooted.

◆ underVolt

bool redux::sensors::canandmag::CanandmagFaults::underVolt

The undervolt flag, which will raise if the encoder is experiencing brownout conditions.


The documentation for this class was generated from the following file: