Class IMUProtocol

java.lang.Object
com.kauailabs.navx.IMUProtocol
Direct Known Subclasses:
AHRSProtocol

public class IMUProtocol extends Object
  • Field Details

    • PACKET_START_CHAR

      public static final byte PACKET_START_CHAR
      See Also:
    • MSGID_YPR_UPDATE

      public static final byte MSGID_YPR_UPDATE
      See Also:
    • MSGID_QUATERNION_UPDATE

      public static final byte MSGID_QUATERNION_UPDATE
      See Also:
    • MSGID_GYRO_UPDATE

      public static final byte MSGID_GYRO_UPDATE
      See Also:
    • MSGID_STREAM_CMD

      public static final byte MSGID_STREAM_CMD
      See Also:
    • STREAM_CMD_STREAM_TYPE_YPR

      public static final int STREAM_CMD_STREAM_TYPE_YPR
      See Also:
    • STREAM_CMD_STREAM_TYPE_QUATERNION

      public static final int STREAM_CMD_STREAM_TYPE_QUATERNION
      See Also:
    • STREAM_CMD_STREAM_TYPE_GYRO

      public static final int STREAM_CMD_STREAM_TYPE_GYRO
      See Also:
    • MSG_ID_STREAM_RESPONSE

      public static final byte MSG_ID_STREAM_RESPONSE
      See Also:
    • STREAM_MSG_TERMINATION_CHAR

      public static final byte STREAM_MSG_TERMINATION_CHAR
      See Also:
    • IMU_PROTOCOL_MAX_MESSAGE_LENGTH

      public static final int IMU_PROTOCOL_MAX_MESSAGE_LENGTH
      See Also:
    • hexArray

      protected static final byte[] hexArray
  • Constructor Details

    • IMUProtocol

      public IMUProtocol()
  • Method Details

    • encodeStreamCommand

      public static int encodeStreamCommand(byte[] protocol_buffer, byte stream_type, byte update_rate_hz)
    • decodeStreamResponse

      public static int decodeStreamResponse(byte[] buffer, int offset, int length, IMUProtocol.StreamResponse r)
    • decodeStreamCommand

      public static int decodeStreamCommand(byte[] buffer, int offset, int length, IMUProtocol.StreamCommand c)
    • decodeYPRUpdate

      public static int decodeYPRUpdate(byte[] buffer, int offset, int length, IMUProtocol.YPRUpdate u)
    • decodeQuaternionUpdate

      public static int decodeQuaternionUpdate(byte[] buffer, int offset, int length, IMUProtocol.QuaternionUpdate u)
    • decodeGyroUpdate

      public static int decodeGyroUpdate(byte[] buffer, int offset, int length, IMUProtocol.GyroUpdate u)
    • encodeTermination

      public static void encodeTermination(byte[] buffer, int total_length, int content_length)
    • byteToHex

      public static void byteToHex(byte thebyte, byte[] dest, int offset)
    • decodeProtocolUint16

      public static short decodeProtocolUint16(byte[] uint16_string, int offset)
    • decodeProtocolUnsignedHundredthsFloat

      public static float decodeProtocolUnsignedHundredthsFloat(byte[] uint8_unsigned_hundredths_float, int offset)
    • verifyChecksum

      public static boolean verifyChecksum(byte[] buffer, int offset, int content_length)
    • decodeUint8

      public static byte decodeUint8(byte[] checksum, int offset)
    • decodeProtocolFloat

      public static float decodeProtocolFloat(byte[] buffer, int offset)