Class CanandgyroDetails.Bitsets
java.lang.Object
com.reduxrobotics.sensors.canandgyro.CanandgyroDetails.Bitsets
- Enclosing class:
- CanandgyroDetails
Canandgyro bitsets.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intfaults - The acceleration saturation flag, which triggers on saturation of acceleration.static final intfaults - The angular velocity saturation flag, which triggers on saturation of angular velocity.static final intfaults - The calibration status flag, which will raise if the device is currently calibrating.static final intfaults - The CAN general error flag, which will raise if the device encounters a CAN fault during operation.static final intfaults - The CAN ID conflict flag, which is set to true if there is a CAN id conflict.static final intfaults - The hardware fault flag, which will raise if a hardware issue is detected.static final intfaults - The temperature range flag, which will raise if the device is not between 0-70 degrees Celsius.static final intfaults - The power cycle fault flag, which is set to true when the device first boots.static final intsetting_report_flags - Whether the setting synch commit was successfulstatic final intsetting_report_flags - Whether the setting set/fetch was successful -
Method Summary
Modifier and TypeMethodDescriptionstatic intconstructFaults(boolean powerCycle, boolean canIdConflict, boolean canGeneralError, boolean outOfTemperatureRange, boolean hardwareFault, boolean calibrating, boolean angularVelocitySaturation, boolean accelerationSaturation) Constructs a faults bitset.static intconstructSettingReportFlags(boolean setSuccess, boolean commitSuccess) Constructs a setting_report_flags bitset.static booleanextractFaults_AccelerationSaturation(int field) Extracts acceleration_saturation from faults.static booleanextractFaults_AngularVelocitySaturation(int field) Extracts angular_velocity_saturation from faults.static booleanextractFaults_Calibrating(int field) Extracts calibrating from faults.static booleanextractFaults_CanGeneralError(int field) Extracts can_general_error from faults.static booleanextractFaults_CanIdConflict(int field) Extracts can_id_conflict from faults.static booleanextractFaults_HardwareFault(int field) Extracts hardware_fault from faults.static booleanextractFaults_OutOfTemperatureRange(int field) Extracts out_of_temperature_range from faults.static booleanextractFaults_PowerCycle(int field) Extracts power_cycle from faults.static booleanextractSettingReportFlags_CommitSuccess(int field) Extracts commit_success from setting_report_flags.static booleanextractSettingReportFlags_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/fetch 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 encounters a CAN fault during operation. If communication with the device still functions, this will not register as an active fault for long if at all. This may raise due to wiring issues, such as an intermittently 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/fetch 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 encounters a CAN fault during operation. If communication with the device still functions, this will not register as an active fault for long if at all. This may raise due to wiring issues, such as an intermittently 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
-