Class CanandgyroDetails.Bitsets
java.lang.Object
com.reduxrobotics.sensors.canandgyro.CanandgyroDetails.Bitsets
- Enclosing class:
- CanandgyroDetails
Canandgyro bitsets.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
faults - The acceleration saturation flag, which triggers on saturation of acceleration.static final int
faults - The angular velocity saturation flag, which triggers on saturation of angular velocity.static final int
faults - The calibration status flag, which will raise if the device is currently calibrating.static final int
faults - The CAN general error flag, which will raise if the device cannot RX packets reliably.static final int
faults - The CAN ID conflict flag, which is set to true if there is a CAN id conflict.static final int
faults - The hardware fault flag, which will raise if a hardware issue is detected.static final int
faults - The temperature range flag, which will raise if the device is not between 0-70 degrees Celsius.static final int
faults - The power cycle fault flag, which is set to true when the device first boots.static final int
setting_report_flags - Whether the setting synch commit was successfulstatic final int
setting_report_flags - Whether the setting set was successful -
Method Summary
Modifier and TypeMethodDescriptionstatic int
constructFaults
(boolean powerCycle, boolean canIdConflict, boolean canGeneralError, boolean outOfTemperatureRange, boolean hardwareFault, boolean calibrating, boolean angularVelocitySaturation, boolean accelerationSaturation) Constructs a faults bitset.static int
constructSettingReportFlags
(boolean setSuccess, boolean commitSuccess) Constructs a setting_report_flags bitset.static boolean
extractFaults_AccelerationSaturation
(int field) Extracts acceleration_saturation from faults.static boolean
extractFaults_AngularVelocitySaturation
(int field) Extracts angular_velocity_saturation from faults.static boolean
extractFaults_Calibrating
(int field) Extracts calibrating from faults.static boolean
extractFaults_CanGeneralError
(int field) Extracts can_general_error from faults.static boolean
extractFaults_CanIdConflict
(int field) Extracts can_id_conflict from faults.static boolean
extractFaults_HardwareFault
(int field) Extracts hardware_fault from faults.static boolean
extractFaults_OutOfTemperatureRange
(int field) Extracts out_of_temperature_range from faults.static boolean
extractFaults_PowerCycle
(int field) Extracts power_cycle from faults.static boolean
extractSettingReportFlags_CommitSuccess
(int field) Extracts commit_success from setting_report_flags.static boolean
extractSettingReportFlags_SetSuccess
(int field) Extracts set_success from setting_report_flags.
-
Field Details
-
kSettingReportFlags_SetSuccess
public static final int kSettingReportFlags_SetSuccesssetting_report_flags - Whether the setting set was successful- See Also:
-
kSettingReportFlags_CommitSuccess
public static final int kSettingReportFlags_CommitSuccesssetting_report_flags - Whether the setting synch commit was successful- See Also:
-
kFaults_PowerCycle
public static final int kFaults_PowerCyclefaults - 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.- See Also:
-
kFaults_CanIdConflict
public static final int kFaults_CanIdConflictfaults - 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.- See Also:
-
kFaults_CanGeneralError
public static final int kFaults_CanGeneralErrorfaults - 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.- See Also:
-
kFaults_OutOfTemperatureRange
public static final int kFaults_OutOfTemperatureRangefaults - 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.- See Also:
-
kFaults_HardwareFault
public static final int kFaults_HardwareFaultfaults - 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.- See Also:
-
kFaults_Calibrating
public static final int kFaults_Calibratingfaults - The calibration status flag, which will raise if the device is currently calibrating.- See Also:
-
kFaults_AngularVelocitySaturation
public static final int kFaults_AngularVelocitySaturationfaults - The angular velocity saturation flag, which triggers on saturation of angular velocity.- See Also:
-
kFaults_AccelerationSaturation
public static final int kFaults_AccelerationSaturationfaults - The acceleration saturation flag, which triggers on saturation of acceleration.- See Also:
-
-
Method Details
-
constructSettingReportFlags
public static int constructSettingReportFlags(boolean setSuccess, boolean commitSuccess) Constructs a setting_report_flags bitset.- Parameters:
setSuccess
- Whether the setting set was successfulcommitSuccess
- Whether the setting synch commit was successful- Returns:
- bitset data as int
-
constructFaults
public static int constructFaults(boolean powerCycle, boolean canIdConflict, boolean canGeneralError, boolean outOfTemperatureRange, boolean hardwareFault, boolean calibrating, boolean angularVelocitySaturation, boolean accelerationSaturation) Constructs a faults bitset.- Parameters:
powerCycle
- 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.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 device to ensure it's not flashing blue.canGeneralError
- 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.outOfTemperatureRange
- 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.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.calibrating
- The calibration status flag, which will raise if the device is currently calibrating.angularVelocitySaturation
- The angular velocity saturation flag, which triggers on saturation of angular velocity.accelerationSaturation
- The acceleration saturation flag, which triggers on saturation of acceleration.- Returns:
- bitset data as int
-
extractSettingReportFlags_SetSuccess
public static boolean extractSettingReportFlags_SetSuccess(int field) Extracts set_success from setting_report_flags.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractSettingReportFlags_CommitSuccess
public static boolean extractSettingReportFlags_CommitSuccess(int field) Extracts commit_success from setting_report_flags.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractFaults_PowerCycle
public static boolean extractFaults_PowerCycle(int field) Extracts power_cycle from faults.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractFaults_CanIdConflict
public static boolean extractFaults_CanIdConflict(int field) Extracts can_id_conflict from faults.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractFaults_CanGeneralError
public static boolean extractFaults_CanGeneralError(int field) Extracts can_general_error from faults.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractFaults_OutOfTemperatureRange
public static boolean extractFaults_OutOfTemperatureRange(int field) Extracts out_of_temperature_range from faults.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractFaults_HardwareFault
public static boolean extractFaults_HardwareFault(int field) Extracts hardware_fault from faults.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractFaults_Calibrating
public static boolean extractFaults_Calibrating(int field) Extracts calibrating from faults.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractFaults_AngularVelocitySaturation
public static boolean extractFaults_AngularVelocitySaturation(int field) Extracts angular_velocity_saturation from faults.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-
extractFaults_AccelerationSaturation
public static boolean extractFaults_AccelerationSaturation(int field) Extracts acceleration_saturation from faults.- Parameters:
field
- data bitfield- Returns:
- true if set, false if not
-