这两天折腾MPU6050, 仔细看了看文档。
下面内容就是不同的角度的算法。
Pitch angle 俯仰角
- To find
Pitch angle
should be the angle between X and Z axis which will beatan2(accelZ,accelX)*180/PI
Roll angle 滚动角
- For
Roll angle
should be the angle between Y and Z axis which will beatan2(accelZ,accelY)*180/PI
yaw angle 偏航角
And to find
yaw
it should be the angle between X and VectorY+Z which will beatan2(sqrt(accelY*accelY+accelZ*accelZ),accelX)*180/PI
总结
- 校准IMU
- 读取原始数据
- 处理数据信息