ANROT Tutorial

Matlab Serial Reading Tutorial

Minimal public workflow for validating ANROT serial output with Matlab 2020 or newer.

Updated Jan 1, 2025 Products 6
  • matlab
  • uart
  • tutorial

Read IMU data using Matlab

Protocol Support

Protocol / frameSupportHow this example handles it
0x91 IMUSOLSupportedDecodes the complete float frame into raw.imu.acc/gyr/mag/eul/quat.
0x90, 0xA0, 0xB0, 0xC0, 0xD0SupportedParses ID, acceleration, gyroscope, magnetometer, and Euler loose items.
0xD1 QuaternionNot supported standaloneimu_read.m has no standalone 0xD1 case; quaternion data comes from 0x91.
0x62, 0x63 GatewayNot supportedThis MATLAB example only handles a single IMU data stream.
0xF0 PressureSkippedThe script advances past the pressure item and does not output pressure.

Matlab Sample Code download

Environment: Please use Matlab 2020 or above

Examples include: crc16.m, imu_read.m

After decompression, use Matlab 2020 or later to open,

Modify the position information of the red box in the following figure: Baud rate and serial port number:

Click Run, you can get the IMU information in the output area, you can modify the value to be printed out in the program

  • raw.imu.id

  • raw.imu.acc

  • raw.imu.gyr

  • raw.imu.mag (only valid for 9-axis mode)

  • raw.imu.eul

  • raw.imu.quat