MPU6050计算三个姿态使用的公式

这两天折腾MPU6050, 仔细看了看文档。

下面内容就是不同的角度的算法。

Pitch angle 俯仰角

  • To find Pitch angle should be the angle between X and Z axis which will be
    atan2(accelZ,accelX)*180/PI

    Roll angle 滚动角

  • For Roll angle should be the angle between Y and Z axis which will be
    atan2(accelZ,accelY)*180/PI

    yaw angle 偏航角

    And to find yaw it should be the angle between X and VectorY+Z which will be

    atan2(sqrt(accelY*accelY+accelZ*accelZ),accelX)*180/PI

    总结

    1. 校准IMU
    2. 读取原始数据
    3. 处理数据信息