ReduxLib C++ 2025.0.0-beta2
Loading...
Searching...
No Matches
redux::sensors::canandgyro::CanandgyroFaults Class Reference

#include <CanandgyroFaults.h>

Public Member Functions

constexpr CanandgyroFaults (uint8_t field, bool valid)
 

Public Attributes

bool powerCycle
 
bool canIdConflict
 
bool canGeneralError
 
bool outOfTemperatureRange
 
bool hardwareFault
 
bool calibrating
 
bool angularVelocitySaturation
 
bool accelerationSaturation
 
bool faultsValid
 

Detailed Description

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

Constructor & Destructor Documentation

◆ CanandgyroFaults()

constexpr redux::sensors::canandgyro::CanandgyroFaults::CanandgyroFaults ( uint8_t  field,
bool  valid 
)
inlineconstexpr

Constructs from a fault field.

Parameters
fieldthe fault bitfield
validwhether data is valid or not

Member Data Documentation

◆ accelerationSaturation

bool redux::sensors::canandgyro::CanandgyroFaults::accelerationSaturation

The acceleration saturation flag, which triggers on saturation of acceleration.

◆ angularVelocitySaturation

bool redux::sensors::canandgyro::CanandgyroFaults::angularVelocitySaturation

The angular velocity saturation flag, which triggers on saturation of angular velocity.

◆ calibrating

bool redux::sensors::canandgyro::CanandgyroFaults::calibrating

Returns the calibrating flag, which will raise if the device is currently calibrating.

◆ canGeneralError

bool redux::sensors::canandgyro::CanandgyroFaults::canGeneralError

Returns the CAN general error flag, which will raise if the device has encountered a bus fault. This typically indicates a physical wiring issue on the robot, such as loose connections or an intermittently shorting CAN bus

◆ canIdConflict

bool redux::sensors::canandgyro::CanandgyroFaults::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::canandgyro::CanandgyroFaults::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::canandgyro::CanandgyroFaults::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.

◆ outOfTemperatureRange

bool redux::sensors::canandgyro::CanandgyroFaults::outOfTemperatureRange

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

◆ powerCycle

bool redux::sensors::canandgyro::CanandgyroFaults::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.


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