MPU9250
Measure acceleration, angular rate, and magnetic field, and calculate fusion values such as Euler angles and quaternion along the axes of MPU-9250 sensor
Add-On Required: This feature requires the Simulink Coder Support Package for Beaglebone Blue Hardware add-on.
Libraries:
Simulink Coder Support Package for BeagleBone Blue Hardware /
Sensors
Description
The MPU9250 block reads data from the MPU-9250 sensor that is connected to the hardware. The block has two operation modes: Random and DMP.
The block outputs acceleration, angular rate, and strength of the magnetic field along
the axes of the sensor in Random and DMP mode. In DMP mode, the block also outputs the
orientation of the sensor as an Euler angle and quaternions. The values emitted in the
Random mode are raw values, whereas the values emitted in the DMP mode are calibrated
values. The block outputs all the values except for quaternion as a 3-by-1 array of
double
data type. The quaternion is a 4-by-1 array of
double
data type.
This illustration shows the default orientation of the x-, y-, and z- axes of the MPU-9250 sensor.
If you simulate a model that contains the MPU9250 block without connecting the hardware, the block outputs zeros. For more information, see Block Produces Zeros or Does Nothing in Simulation.
Note
Before generating code from the MPU9250 block in
DMP
mode, calibrate the sensor using the calibrateGyro
, calibrateAccel
, and calibrateMag
functions. These functions calibrate the three-axis
gyroscope, accelerometer, and magnetometer located inside the sensor.
Ports
Output
Parameters
Version History
Introduced in R2019a