ReduxLib C++ 2023.2.0
Loading...
Searching...
No Matches
redux::sensors::canandcoder::CanandcoderFaults Class Reference

#include <CanandcoderFaults.h>

Public Member Functions

constexpr CanandcoderFaults (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 Canandcoder, as returned by Canandcoder::GetActiveFaults and Canandcoder::GetStickyFaults This class is immutable once constructed.

Constructor & Destructor Documentation

◆ CanandcoderFaults()

constexpr redux::sensors::canandcoder::CanandcoderFaults::CanandcoderFaults ( 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::canandcoder::CanandcoderFaults::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::canandcoder::CanandcoderFaults::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::canandcoder::CanandcoderFaults::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::canandcoder::CanandcoderFaults::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::canandcoder::CanandcoderFaults::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::canandcoder::CanandcoderFaults::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::canandcoder::CanandcoderFaults::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::canandcoder::CanandcoderFaults::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: