简体   繁体   English

从加速度计算偏航、俯仰和横滚

[英]Calculation of Yaw, Pitch and Roll from Acceleration

I'm using an expensive equipment which measures and records the following data when I was on a ship and did some sailing:我正在使用昂贵的设备,当我在船上并进行一些航行时,它可以测量和记录以下数据:

GpsTime, GyroX, GyroY, GyroZ, AccX, AccY, accZ, Heading, Pitch, Roll, Latitude Longitude, Heave, V_East, V_North, V_UP. GpsTime、GyroX、GyroY、GyroZ、AccX、AccY、accZ、航向、俯仰、滚动、纬度、经度、起伏、V_East、V_North、V_UP。

What I'm trying to do: I'm trying to predict the Roll, Pitch and Yaw from AccX, AccY, AccZ.我正在尝试做的事情:我正在尝试从 AccX、AccY、AccZ 预测 Roll、Pitch 和 Yaw。

What I've tried: After reading some tutorials I found that the following equations are wrong and I'm not sure why, any ideas which equations will work?我尝试了什么:阅读了一些教程后,我发现以下方程式是错误的,我不确定为什么,有什么想法可以使用哪些方程式?

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

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

AccX, AccY, AccZ can give you pitch and roll but not yaw. AccX、AccY、AccZ 可以为您提供俯仰和滚动,但不能提供偏航。 The answer they give for pitch and roll will also be subject to errors if and when the detector itself is accelerated (a foregone conclusion unfortunately if you're on a boat/ship).如果以及当探测器本身加速时,他们给出的俯仰和滚动答案也将受到错误的影响(不幸的是,如果你在船上/船上,这已成定局)。

GyroX, GyroY, GyroZ give you an independent answer, this time for all 3 angles: yaw pitch and roll. GyroX、GyroY、GyroZ 给你一个独立的答案,这次是针对所有 3 个角度:yaw pitch 和 roll。 But this new answer is subject to drift error which grows over time.但是这个新的答案会随着时间的推移而增加漂移误差。

The trick is to combine these two answers because they are complimentary, the gyro's strength is the accelerometer's weakness and vice versa.诀窍是将这两个答案结合起来,因为它们是互补的,陀螺仪的优势是加速度计的劣势,反之亦然。 This job of combining the two, called fusion, is handled for you by many detectors if you know how to extract the fusion result.如果您知道如何提取融合结果,许多检测器会为您处理将两者结合起来的工作,称为融合。 If you're using an MPU-6050 for example, you have to make sure you're getting the result from what's called the DMP (where the fusion happens).例如,如果您使用的是 MPU-6050,则必须确保从所谓的 DMP(发生融合的地方)获得结果。 The fusion result is typically in quaternion format and the trick then is to make sure to use the correct conversion from quaternion to yaw pitch and roll.融合结果通常采用四元数格式,然后诀窍是确保使用从四元数到偏航俯仰和滚动的正确转换。

Finally, just as the gyro was fused with the accelerometer, the result of that fusion can in turn be fused with results from the GPS or magnetometer (the other readings you list like V_East, V_North).最后,就像陀螺仪与加速度计融合一样,融合的结果又可以与 GPS 或磁力计的结果融合(您列出的其他读数,如 V_East、V_North)。 This second fusion should help with yaw accuracy (the yaw was left out of the first fusion).第二次融合应该有助于偏航精度(偏航被排除在第一次融合之外)。

This is all explained in detail in the following tutorial:这一切都在以下教程中详细解释:

https://youtu.be/eupjMxxdWBo https://youtu.be/eupjMxxdWBo

You don't need expensive equipment for this by the way.顺便说一句,您不需要昂贵的设备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM