ReduxLib C++ 2024.1.1-beta0
Loading...
Searching...
No Matches
redux::sensors::canandcolor::CanandcolorFaults Class Reference

#include <CanandcolorData.h>

Public Member Functions

constexpr CanandcolorFaults (uint8_t field, bool valid)
 

Public Attributes

bool powerCycle
 
bool canIDConflict
 
bool canGeneralError
 
bool outOfTemperatureRange
 
bool hardwareFaultProximity
 
bool hardwareFaultColor
 
bool faultsValid
 

Detailed Description

A class to hold device faults for the Canandcolor, as returned by Canandcolor::GetStickyFaults and Canandcolor::GetActiveFaults

Constructor & Destructor Documentation

◆ CanandcolorFaults()

constexpr redux::sensors::canandcolor::CanandcolorFaults::CanandcolorFaults ( uint8_t  field,
bool  valid 
)
inlineconstexpr

Constructs from a fault field

Parameters
fieldthe fault bitfield
validwhether the data is valid or not

Member Data Documentation

◆ canGeneralError

bool redux::sensors::canandcolor::CanandcolorFaults::canGeneralError

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

◆ canIDConflict

bool redux::sensors::canandcolor::CanandcolorFaults::canIDConflict

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

◆ faultsValid

bool redux::sensors::canandcolor::CanandcolorFaults::faultsValid

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

◆ hardwareFaultColor

bool redux::sensors::canandcolor::CanandcolorFaults::hardwareFaultColor

Returns the color sensor hardware fault flag, which will raise if the color sensor is unreadable.

◆ hardwareFaultProximity

bool redux::sensors::canandcolor::CanandcolorFaults::hardwareFaultProximity

Returns the proximity sensor hardware fault flag, which will raise if the proximity sensor is unreadable.

◆ outOfTemperatureRange

bool redux::sensors::canandcolor::CanandcolorFaults::outOfTemperatureRange

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

◆ powerCycle

bool redux::sensors::canandcolor::CanandcolorFaults::powerCycle

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


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