API
USB / UART API to communicate with the IMU Sensor
Sensor Transmit (Tx) API
The sensor transmits data continuously at 100Hz in the format below. Each messages is 19 bytes.
Header | Index | Yaw | Roll | Pitch | X-axis accel. | Y-axis accel. | Z-axis accel. | Reserved | Csum |
2 byte | 1 byte | 2 byte | 2 byte | 2 byte | 2 byte | 2 byte | 2 byte | 3 byte | 1 byte |
0xAAAA | LSB-MSB | LSB-MSB | LSB-MSB | LSB-MSB | LSB-MSB | LSB-MSB | 0x000000 |
Data | Description |
Header | Each message starts with 0xAAAA |
Index | 8 bit counter (0-255) |
Yaw | Rotation around z-axis, range -180 to 180. Clockwise is positive. 0.01 degree increments, e.g. 7435 is 74.35 degrees. |
Roll | Rotation around x-axis, range -90 to 90. Counter clockwise positive. 0.01 degree increments, e.g. 1222 is 12.22 degrees. |
Pitch | Rotation around y-axis, range -180 to 180. Counter clockwise positive. 0.01 degree increments, e.g. 1356 is 13.56 degrees. |
X-axis acceleration | X-axis acceleration in mg |
Y-axis acceleration | Y-axis acceleration in mg |
Z-axis acceleration | Z-axis acceleration in mg |
Reserved | 3 bytes set to 0. |
Checksum (Csum) | Sum of index, yaw, pitch, roll, and acceleration. |
Sensor Receive (Rx) API
To reset the sensor heading direction (Yaw, Pitch, Roll) to 0 send the following command to the sensor.
Example Message
Below is an example message sent by the IMU sensor.
Message: 0xAA AA DE 01 00 92 FF 25 08 8D FE EC FF D1 03 00 00 00 E7
Data | Hex | Value |
Index | 0xDE | 222 |
Yaw | 0x00 01 | 0.01 degrees multiply by -1 for counter clockwise = -0.01 degrees |
Roll | 0xFF 92 | -1.10 degrees |
Pitch | 0x 08 25 | 20.85 degrees |
X-accel | 0x FE 8D | -371 mg or -3.638 m/s2 |
Y-accel | 0x FF EC | -20 mg or -0.196 m/s2 |
z-accel | 0x 03 D1 | 977 mg or 9.581 m/s2 multiply by -1 for Z-accel. up = -977 mg |
Checksum | 0xE7 |
Last updated