Package com.kauailabs.navx
Class IMUProtocol
- java.lang.Object
-
- com.kauailabs.navx.IMUProtocol
-
- Direct Known Subclasses:
AHRSProtocol
public class IMUProtocol extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIMUProtocol.GyroUpdatestatic classIMUProtocol.QuaternionUpdatestatic classIMUProtocol.StreamCommandstatic classIMUProtocol.StreamResponsestatic classIMUProtocol.YPRUpdate
-
Field Summary
Fields Modifier and Type Field Description protected static byte[]hexArraystatic intIMU_PROTOCOL_MAX_MESSAGE_LENGTHstatic byteMSG_ID_STREAM_RESPONSEstatic byteMSGID_GYRO_UPDATEstatic byteMSGID_QUATERNION_UPDATEstatic byteMSGID_STREAM_CMDstatic byteMSGID_YPR_UPDATEstatic shortNAV6_CALIBRATION_STATE_ACCUMULATEstatic shortNAV6_CALIBRATION_STATE_COMPLETEstatic shortNAV6_CALIBRATION_STATE_WAITstatic shortNAV6_FLAG_MASK_CALIBRATION_STATEstatic bytePACKET_START_CHARstatic intSTREAM_CMD_STREAM_TYPE_GYROstatic intSTREAM_CMD_STREAM_TYPE_QUATERNIONstatic intSTREAM_CMD_STREAM_TYPE_YPRstatic byteSTREAM_MSG_TERMINATION_CHAR
-
Constructor Summary
Constructors Constructor Description IMUProtocol()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidbyteToHex(byte thebyte, byte[] dest, int offset)static intdecodeGyroUpdate(byte[] buffer, int offset, int length, IMUProtocol.GyroUpdate u)static floatdecodeProtocolFloat(byte[] buffer, int offset)static shortdecodeProtocolUint16(byte[] uint16_string, int offset)static floatdecodeProtocolUnsignedHundredthsFloat(byte[] uint8_unsigned_hundredths_float, int offset)static intdecodeQuaternionUpdate(byte[] buffer, int offset, int length, IMUProtocol.QuaternionUpdate u)static intdecodeStreamCommand(byte[] buffer, int offset, int length, IMUProtocol.StreamCommand c)static intdecodeStreamResponse(byte[] buffer, int offset, int length, IMUProtocol.StreamResponse r)static bytedecodeUint8(byte[] checksum, int offset)static intdecodeYPRUpdate(byte[] buffer, int offset, int length, IMUProtocol.YPRUpdate u)static intencodeStreamCommand(byte[] protocol_buffer, byte stream_type, byte update_rate_hz)static voidencodeTermination(byte[] buffer, int total_length, int content_length)static booleanverifyChecksum(byte[] buffer, int offset, int content_length)
-
-
-
Field Detail
-
PACKET_START_CHAR
public static final byte PACKET_START_CHAR
- See Also:
- Constant Field Values
-
MSGID_YPR_UPDATE
public static final byte MSGID_YPR_UPDATE
- See Also:
- Constant Field Values
-
MSGID_QUATERNION_UPDATE
public static final byte MSGID_QUATERNION_UPDATE
- See Also:
- Constant Field Values
-
MSGID_GYRO_UPDATE
public static final byte MSGID_GYRO_UPDATE
- See Also:
- Constant Field Values
-
MSGID_STREAM_CMD
public static final byte MSGID_STREAM_CMD
- See Also:
- Constant Field Values
-
STREAM_CMD_STREAM_TYPE_YPR
public static final int STREAM_CMD_STREAM_TYPE_YPR
- See Also:
- Constant Field Values
-
STREAM_CMD_STREAM_TYPE_QUATERNION
public static final int STREAM_CMD_STREAM_TYPE_QUATERNION
- See Also:
- Constant Field Values
-
STREAM_CMD_STREAM_TYPE_GYRO
public static final int STREAM_CMD_STREAM_TYPE_GYRO
- See Also:
- Constant Field Values
-
MSG_ID_STREAM_RESPONSE
public static final byte MSG_ID_STREAM_RESPONSE
- See Also:
- Constant Field Values
-
STREAM_MSG_TERMINATION_CHAR
public static final byte STREAM_MSG_TERMINATION_CHAR
- See Also:
- Constant Field Values
-
NAV6_FLAG_MASK_CALIBRATION_STATE
public static final short NAV6_FLAG_MASK_CALIBRATION_STATE
- See Also:
- Constant Field Values
-
NAV6_CALIBRATION_STATE_WAIT
public static final short NAV6_CALIBRATION_STATE_WAIT
- See Also:
- Constant Field Values
-
NAV6_CALIBRATION_STATE_ACCUMULATE
public static final short NAV6_CALIBRATION_STATE_ACCUMULATE
- See Also:
- Constant Field Values
-
NAV6_CALIBRATION_STATE_COMPLETE
public static final short NAV6_CALIBRATION_STATE_COMPLETE
- See Also:
- Constant Field Values
-
IMU_PROTOCOL_MAX_MESSAGE_LENGTH
public static final int IMU_PROTOCOL_MAX_MESSAGE_LENGTH
- See Also:
- Constant Field Values
-
hexArray
protected static final byte[] hexArray
-
-
Method Detail
-
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)
-
-