IMU Command
Tag 0x30
-0x3f
command for Inertial measurement unit (IMU) are explained in this page.
Keyword
NA: Not applicable, this command should no be sent by the sensor/application.
None: No data contained in this command, data length can be set to 0x00.
Tag 0x30
Meaning:
Start recording from IMU. Recording continue until user call the stop recording command tag0x31
. Data replay from IMU will use tag0x36
-0x39
.Data format - app send:
Byte Length 1 1 1 1 1 Meaning Accel ODR Accel FS Gyro ODR Gyro FS reply format Output Data Rate (ODR), Full Scale (FS) and reply format code listed below.
Accel ODR / Hz code Accel FS / +-g code 67770x0a 16 0x01 33330x09 8 0x03 16670x08 4 0x02 8330x07 2 0x00 4160x06 208 0x05 104 0x04 52 0x03 26 0x02 12.5 0x01 1.6 0x0b OFF 0x00
Gyro ODR / Hz code Gyro FS / +-dps code 67770x0a 2000 0x03 33330x09 1000 0x02 16670x08 500 0x01 8330x07 250 0x00 4160x06 208 0x05 104 0x04 52 0x03 26 0x02 12.5 0x01 OFF 0x00 Magnetometer ODR and FS is auto selected by the setting of Accelerometer and Gyroscope.
Magnetometer only turn on when both Accel ODR and Gyro ODR are ON.
Reply data format code reply tag tag info Accel, Gyro and Mag value 0x01 0x36
here Accel, Gyro and Mag value with time stamp 0x02 0x36
here Quaternion 6x 0x03 0x37
here Quaternion 6x with time stamp 0x04 0x37
here Quaternion 9x 0x05 0x38
here Quaternion 9x with time stamp 0x06 0x38
here Quaternion 9x with Accel value and time stamp 0x07 0x39
here Data format - app receive:
Same as send format.Same format will acknowledge after command is executed.
Tag 0x31
Meaning:
Stop recording from IMU.Data format - app send:
NoneData format - app receive:
Same as send format.Same format will acknowledge after command is executed.
Tag 0x32
Meaning:
Set IMU offset. (On development...)Data format - app send:
Byte Length 16 (optional) Meaning Offset Quaternion Offset Quaternion: contains 4 Float value, 4 bytes each, in the order of X Y Z W, represent the quaternion offset. All zero or no offset given means remove the current offset.
When starting a new IMU data streaming with 6x or 9x quaternion format, sensor will load the last offset from save on default.
Data format - app receive:
Same as send format.Same format will acknowledge after command is executed.
Tag 0x36
Meaning:
Reply IMU data in accelerometer(ms^-2) and gyroscope(degree/s) value format.Data format - app send:
NAData format - app receive:
Byte Length 12 12 12 8 (optional) Meaning Accel Value Gyro Value Mag value Time Stamp Accel Value: Float format, accelerometer(g) X, Y, Z axis value, each axis has 4 bytes length. Can be turn off by setting the ODR to 0x00.
Gyro Value: Float format, gyroscope(degree/s) X, Y, Z axis value, each axis has 4 bytes length. Can be turn off by setting the ODR to 0x00.
Mag Value: Float format, magnetometer(mGauss) X, Y, Z axis value, each axis has 4 bytes length. Only available when both accelerometer and gyroscope turn on. ODR and FS are auto selected.
Time Stamp: Unsigned Long, unit is 2.4414us. Represent the data record time. Only appear when the "with time stamp" format is chosen. Pay attention that this value might not start from zero. Usually it is used to help synchronize data from multiple sensors or calculate the accurate data rate.
Tag 0x37
Meaning:
Reply IMU data in quaternion data format. 6 axis (accel + gyro) are used to calculate the quaternion value.Data format - app send:
NAData format - app receive:
Byte Length 16 8 (optional) Meaning Quaternion Time Stamp Quaternion: contains 4 Float value, 4 bytes each, in the order of X Y Z W, represent the rotation axis and angle of the sensor.
Time Stamp: Unsigned Long, unit is 2.4414us. Represent the data record time. Only appear when the "with time stamp" format is chosen. Pay attention that this value might not start from zero. Usually it is used to help synchronize data from multiple sensors or calculate the accurate data rate.
Tag 0x38
Meaning:
Reply IMU data in quaternion data format. 9 axis (accel + gyro + mag) are used to calculate the quaternion value.Data format - app send:
NAData format - app receive:
Byte Length 16 8 (optional) Meaning Quaternion Time Stamp Quaternion: contains 4 Float value, 4 bytes each, in the order of X Y Z W, represent the rotation axis and angle of the sensor.
Time Stamp: Unsigned Long, unit is 2.4414us. Represent the data record time. Only appear when the "with time stamp" format is chosen. Pay attention that this value might not start from zero. Usually it is used to help synchronize data from multiple sensors or calculate the accurate data rate.
Tag 0x39
Meaning:
Reply IMU data in quaternion with Accel value data format. 9 axis (accel + gyro + mag) are used to calculate the quaternion value.Data format - app send:
NAData format - app receive:
Byte Length 12 16 8 Meaning Accel Value Quaternion Time Stamp Accel Value: Accelerometer(g) value separated in X, Y, Z axis, each axis has 4 bytes, all in Float format.
Quaternion: contains 4 Float value, 4 bytes each, in the order of X Y Z W, represent the rotation axis and angle of the sensor.
Time Stamp: Unsigned Long, unit is 2.4414us. Represent the data record time. Only appear when the "with time stamp" format is chosen. Pay attention that this value might not start from zero. Usually it is used to help synchronize data from multiple sensors or calculate the accurate data rate.