Class CanandgyroDetails.Bitsets

java.lang.Object
com.reduxrobotics.sensors.canandgyro.CanandgyroDetails.Bitsets
Enclosing class:
CanandgyroDetails

public static class CanandgyroDetails.Bitsets extends Object
Canandgyro bitsets.
  • Field Details

    • kSettingReportFlags_SetSuccess

      public static final int kSettingReportFlags_SetSuccess
      setting_report_flags - Whether the setting set was successful
      See Also:
    • kSettingReportFlags_CommitSuccess

      public static final int kSettingReportFlags_CommitSuccess
      setting_report_flags - Whether the setting synch commit was successful
      See Also:
    • kFaults_PowerCycle

      public static final int kFaults_PowerCycle
      faults - 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_CanIdConflict
      faults - 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_CanGeneralError
      faults - 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_OutOfTemperatureRange
      faults - 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_HardwareFault
      faults - 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_Calibrating
      faults - The calibration status flag, which will raise if the device is currently calibrating.
      See Also:
    • kFaults_AngularVelocitySaturation

      public static final int kFaults_AngularVelocitySaturation
      faults - The angular velocity saturation flag, which triggers on saturation of angular velocity.
      See Also:
    • kFaults_AccelerationSaturation

      public static final int kFaults_AccelerationSaturation
      faults - 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 successful
      commitSuccess - 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