Class CanandgyroDetails.Msg

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

public static class CanandgyroDetails.Msg extends Object
Messages.
  • Field Details

    • kYawOutput

      public static final int kYawOutput
      Yaw angle frame
      See Also:
    • kAngularPositionOutput

      public static final int kAngularPositionOutput
      Angular position quaternion frame
      See Also:
    • kAngularVelocityOutput

      public static final int kAngularVelocityOutput
      Angular velocity frame
      See Also:
    • kAccelerationOutput

      public static final int kAccelerationOutput
      Acceleration frame
      See Also:
    • kCalibrate

      public static final int kCalibrate
      Trigger Calibration
      See Also:
    • kCalibrationStatus

      public static final int kCalibrationStatus
      Calibration Status
      See Also:
    • kEnumerate

      public static final int kEnumerate
      Device enumerate response
      See Also:
    • kPartyMode

      public static final int kPartyMode
      Party mode
      See Also:
    • kStatus

      public static final int kStatus
      Status frame
      See Also:
    • kClearStickyFaults

      public static final int kClearStickyFaults
      Clear device sticky faults
      See Also:
    • kReportSetting

      public static final int kReportSetting
      setting value report from device
      See Also:
    • kSetSetting

      public static final int kSetSetting
      update setting on device
      See Also:
    • kSettingCommand

      public static final int kSettingCommand
      setting control command
      See Also:
    • kDlc_YawOutput

      public static final int kDlc_YawOutput
      YAW_OUTPUT message length
      See Also:
    • kDlc_AngularPositionOutput

      public static final int kDlc_AngularPositionOutput
      ANGULAR_POSITION_OUTPUT message length
      See Also:
    • kDlc_AngularVelocityOutput

      public static final int kDlc_AngularVelocityOutput
      ANGULAR_VELOCITY_OUTPUT message length
      See Also:
    • kDlc_AccelerationOutput

      public static final int kDlc_AccelerationOutput
      ACCELERATION_OUTPUT message length
      See Also:
    • kDlc_Calibrate

      public static final int kDlc_Calibrate
      CALIBRATE message length
      See Also:
    • kDlc_CalibrationStatus

      public static final int kDlc_CalibrationStatus
      CALIBRATION_STATUS message length
      See Also:
    • kDlc_Enumerate

      public static final int kDlc_Enumerate
      ENUMERATE message length
      See Also:
    • kDlcMin_PartyMode

      public static final int kDlcMin_PartyMode
      PARTY_MODE message min length
      See Also:
    • kDlcMax_PartyMode

      public static final int kDlcMax_PartyMode
      PARTY_MODE message max length
      See Also:
    • kDlc_Status

      public static final int kDlc_Status
      STATUS message length
      See Also:
    • kDlcMin_ClearStickyFaults

      public static final int kDlcMin_ClearStickyFaults
      CLEAR_STICKY_FAULTS message min length
      See Also:
    • kDlcMax_ClearStickyFaults

      public static final int kDlcMax_ClearStickyFaults
      CLEAR_STICKY_FAULTS message max length
      See Also:
    • kDlc_ReportSetting

      public static final int kDlc_ReportSetting
      REPORT_SETTING message length
      See Also:
    • kDlc_SetSetting

      public static final int kDlc_SetSetting
      SET_SETTING message length
      See Also:
    • kDlcMin_SettingCommand

      public static final int kDlcMin_SettingCommand
      SETTING_COMMAND message min length
      See Also:
    • kDlcMax_SettingCommand

      public static final int kDlcMax_SettingCommand
      SETTING_COMMAND message max length
      See Also:
  • Method Details

    • extractYawOutput_Yaw_Yaw

      public static float extractYawOutput_Yaw_Yaw(long field)
      Extracts Yaw angle (f32 between [-pi..pi) degrees) from YawOutput_Yaw.
      Parameters:
      field - data bitfield
      Returns:
      yaw as a float:32
    • extractYawOutput_Yaw_Wraparound

      public static int extractYawOutput_Yaw_Wraparound(long field)
      Extracts Wraparound counter from YawOutput_Yaw.
      Parameters:
      field - data bitfield
      Returns:
      wraparound as a sint:16
    • extractAngularPositionOutput_W

      public static int extractAngularPositionOutput_W(long field)
      Extracts Quaternion w term from AngularPositionOutput.
      Parameters:
      field - data bitfield
      Returns:
      w as a sint:16
    • extractAngularPositionOutput_X

      public static int extractAngularPositionOutput_X(long field)
      Extracts Quaternion x term from AngularPositionOutput.
      Parameters:
      field - data bitfield
      Returns:
      x as a sint:16
    • extractAngularPositionOutput_Y

      public static int extractAngularPositionOutput_Y(long field)
      Extracts Quaternion y term from AngularPositionOutput.
      Parameters:
      field - data bitfield
      Returns:
      y as a sint:16
    • extractAngularPositionOutput_Z

      public static int extractAngularPositionOutput_Z(long field)
      Extracts Quaternion z term from AngularPositionOutput.
      Parameters:
      field - data bitfield
      Returns:
      z as a sint:16
    • extractAngularVelocityOutput_Yaw

      public static int extractAngularVelocityOutput_Yaw(long field)
      Extracts Yaw velocity from AngularVelocityOutput.
      Parameters:
      field - data bitfield
      Returns:
      yaw as a sint:16
    • extractAngularVelocityOutput_Pitch

      public static int extractAngularVelocityOutput_Pitch(long field)
      Extracts Pitch velocity from AngularVelocityOutput.
      Parameters:
      field - data bitfield
      Returns:
      pitch as a sint:16
    • extractAngularVelocityOutput_Roll

      public static int extractAngularVelocityOutput_Roll(long field)
      Extracts Roll velocity from AngularVelocityOutput.
      Parameters:
      field - data bitfield
      Returns:
      roll as a sint:16
    • extractAccelerationOutput_Z

      public static int extractAccelerationOutput_Z(long field)
      Extracts Z-axis acceleration from AccelerationOutput.
      Parameters:
      field - data bitfield
      Returns:
      z as a sint:16
    • extractAccelerationOutput_Y

      public static int extractAccelerationOutput_Y(long field)
      Extracts Y-axis acceleration from AccelerationOutput.
      Parameters:
      field - data bitfield
      Returns:
      y as a sint:16
    • extractAccelerationOutput_X

      public static int extractAccelerationOutput_X(long field)
      Extracts X-axis acceleration from AccelerationOutput.
      Parameters:
      field - data bitfield
      Returns:
      x as a sint:16
    • extractCalibrate_CalibrationType

      public static int extractCalibrate_CalibrationType(long field)
      Extracts Calibration type from Calibrate.
      Parameters:
      field - data bitfield
      Returns:
      calibration_type as a enum:CALIBRATION_TYPE
    • extractEnumerate_Serial

      public static long extractEnumerate_Serial(long field)
      Extracts Device-unique serial number from Enumerate.
      Parameters:
      field - data bitfield
      Returns:
      serial as a buf:48
    • extractEnumerate_IsBootloader

      public static boolean extractEnumerate_IsBootloader(long field)
      Extracts Device is in bootloader. from Enumerate.
      Parameters:
      field - data bitfield
      Returns:
      is_bootloader as a bool
    • extractPartyMode_PartyLevel

      public static int extractPartyMode_PartyLevel(long field)
      Extracts Party level. 0 disables the strobe, whereas each increased value up to 10 increases strobe period by 50 ms. from PartyMode.
      Parameters:
      field - data bitfield
      Returns:
      party_level as a uint:8
    • extractStatus_Faults

      public static int extractStatus_Faults(long field)
      Extracts 8-bit active faults bitfield from Status.
      Parameters:
      field - data bitfield
      Returns:
      faults as a bitset:8
    • extractStatus_StickyFaults

      public static int extractStatus_StickyFaults(long field)
      Extracts 8-bit sticky faults bitfield from Status.
      Parameters:
      field - data bitfield
      Returns:
      sticky_faults as a bitset:8
    • extractStatus_Temperature

      public static int extractStatus_Temperature(long field)
      Extracts 16-bit signed temperature byte in 1/256ths of a Celsius from Status.
      Parameters:
      field - data bitfield
      Returns:
      temperature as a sint:16
    • extractReportSetting_Address

      public static int extractReportSetting_Address(long field)
      Extracts Setting index to write to from ReportSetting.
      Parameters:
      field - data bitfield
      Returns:
      address as a enum:SETTING
    • extractReportSetting_Value

      public static long extractReportSetting_Value(long field)
      Extracts 6-byte setting value from ReportSetting.
      Parameters:
      field - data bitfield
      Returns:
      value as a buf:48
    • extractReportSetting_Flags

      public static int extractReportSetting_Flags(long field)
      Extracts Setting receive status from ReportSetting.
      Parameters:
      field - data bitfield
      Returns:
      flags as a bitset:8
    • extractSetSetting_Address

      public static int extractSetSetting_Address(long field)
      Extracts Setting index to write to from SetSetting.
      Parameters:
      field - data bitfield
      Returns:
      address as a enum:SETTING
    • extractSetSetting_Value

      public static long extractSetSetting_Value(long field)
      Extracts 6-byte setting value from SetSetting.
      Parameters:
      field - data bitfield
      Returns:
      value as a buf:48
    • extractSetSetting_Flags_Ephemeral

      public static boolean extractSetSetting_Flags_Ephemeral(long field)
      Extracts Whether the setting should be set ephemeral from SetSetting_Flags.
      Parameters:
      field - data bitfield
      Returns:
      ephemeral as a bool
    • extractSetSetting_Flags_SynchHold

      public static boolean extractSetSetting_Flags_SynchHold(long field)
      Extracts Whether the setting should be held until the next synch barrier from SetSetting_Flags.
      Parameters:
      field - data bitfield
      Returns:
      synch_hold as a bool
    • extractSetSetting_Flags_SynchMsgCount

      public static int extractSetSetting_Flags_SynchMsgCount(long field)
      Extracts Synch message count from SetSetting_Flags.
      Parameters:
      field - data bitfield
      Returns:
      synch_msg_count as a uint:4
    • extractSettingCommand_ControlFlag

      public static int extractSettingCommand_ControlFlag(long field)
      Extracts Setting command index from SettingCommand.
      Parameters:
      field - data bitfield
      Returns:
      control_flag as a enum:SETTING_COMMAND
    • extractSettingCommand_SettingIndex

      public static int extractSettingCommand_SettingIndex(long field)
      Extracts setting index to fetch from SettingCommand.
      Parameters:
      field - data bitfield
      Returns:
      setting_index as a enum:SETTING
    • constructYawOutput

      public static long constructYawOutput(float yawYaw, int yawWraparound)
      Constructs a YAW_OUTPUT message.
      Parameters:
      yawYaw - Yaw angle (f32 between [-pi..pi) degrees) (float:32)
      yawWraparound - Wraparound counter (sint:16)
      Returns:
      message data as long
    • constructAngularPositionOutput

      public static long constructAngularPositionOutput(int w, int x, int y, int z)
      Constructs a ANGULAR_POSITION_OUTPUT message.
      Parameters:
      w - Quaternion w term (sint:16)
      x - Quaternion x term (sint:16)
      y - Quaternion y term (sint:16)
      z - Quaternion z term (sint:16)
      Returns:
      message data as long
    • constructAngularVelocityOutput

      public static long constructAngularVelocityOutput(int yaw, int pitch, int roll)
      Constructs a ANGULAR_VELOCITY_OUTPUT message.
      Parameters:
      yaw - Yaw velocity (sint:16)
      pitch - Pitch velocity (sint:16)
      roll - Roll velocity (sint:16)
      Returns:
      message data as long
    • constructAccelerationOutput

      public static long constructAccelerationOutput(int z, int y, int x)
      Constructs a ACCELERATION_OUTPUT message.
      Parameters:
      z - Z-axis acceleration (sint:16)
      y - Y-axis acceleration (sint:16)
      x - X-axis acceleration (sint:16)
      Returns:
      message data as long
    • constructCalibrate

      public static long constructCalibrate(int calibrationType)
      Constructs a CALIBRATE message.
      Parameters:
      calibrationType - Calibration type (enum:CALIBRATION_TYPE)
      Returns:
      message data as long
    • constructCalibrationStatus

      public static long constructCalibrationStatus()
      Constructs a CALIBRATION_STATUS message.
      Returns:
      message data as long
    • constructEnumerate

      public static long constructEnumerate(long serial, boolean isBootloader)
      Constructs a ENUMERATE message.
      Parameters:
      serial - Device-unique serial number (buf:48)
      isBootloader - Device is in bootloader. (bool)
      Returns:
      message data as long
    • constructPartyMode

      public static long constructPartyMode(int partyLevel)
      Constructs a PARTY_MODE message.
      Parameters:
      partyLevel - Party level. 0 disables the strobe, whereas each increased value up to 10 increases strobe period by 50 ms. (uint:8)
      Returns:
      message data as long
    • constructStatus

      public static long constructStatus(int faults, int stickyFaults, int temperature)
      Constructs a STATUS message.
      Parameters:
      faults - 8-bit active faults bitfield (bitset:8)
      stickyFaults - 8-bit sticky faults bitfield (bitset:8)
      temperature - 16-bit signed temperature byte in 1/256ths of a Celsius (sint:16)
      Returns:
      message data as long
    • constructClearStickyFaults

      public static long constructClearStickyFaults()
      Constructs a CLEAR_STICKY_FAULTS message.
      Returns:
      message data as long
    • constructReportSetting

      public static long constructReportSetting(int address, long value, int flags)
      Constructs a REPORT_SETTING message.
      Parameters:
      address - Setting index to write to (enum:SETTING)
      value - 6-byte setting value (buf:48)
      flags - Setting receive status (bitset:8)
      Returns:
      message data as long
    • constructSetSetting

      public static long constructSetSetting(int address, long value, boolean flagsEphemeral, boolean flagsSynchHold, int flagsSynchMsgCount)
      Constructs a SET_SETTING message.
      Parameters:
      address - Setting index to write to (enum:SETTING)
      value - 6-byte setting value (buf:48)
      flagsEphemeral - Whether the setting should be set ephemeral (bool)
      flagsSynchHold - Whether the setting should be held until the next synch barrier (bool)
      flagsSynchMsgCount - Synch message count (uint:4)
      Returns:
      message data as long
    • constructSettingCommand

      public static long constructSettingCommand(int controlFlag, int settingIndex)
      Constructs a SETTING_COMMAND message.
      Parameters:
      controlFlag - Setting command index (enum:SETTING_COMMAND)
      settingIndex - setting index to fetch (enum:SETTING)
      Returns:
      message data as long