本文介绍了如何使用陀螺仪和磁力计计算航向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有陀螺仪和磁力计的原始数据.根据这些数据,我必须计算出准确度为1Deg的航向"信息.

I have raw data of Gyroscope and magnetometer. on basis of this data, i have to calculate Heading information with an accuracy of 1Deg.

我想知道,是否有任何算法可以帮助我使用提到的准确性的可用信息来获取标题信息?

I would like to know, is there any algorithm which can help me to get heading info using available information with mentioned accuracy?

任何文章或任何链接也将有所帮助.

Any article or any link also will be helpful.

谢谢

推荐答案

我假设您正在使用电话收集gyroscope+magnetometer数据.

I am assuming you are using phone to collect gyroscope+magnetometer data.

除非知道设备的初始状态,否则无法使用Gyro+Magnetometer计算标题.您必须尝试Accelerometer+Magnetometer.您可以从Android/IOS设备的运动传感器API的rotation-matrix' or yaw`组件获取航向值.

You cannot calculate Heading with Gyro+Magnetometer unless you know initial state of device. You have to try Accelerometer+Magnetometer. You can get heading values from rotation-matrix' oryaw` component from Motion sensor API of Android/IOS device.

如果要实现自己的尝试,请尝试倾斜补偿算法.您要做的就是使用accelerometermagnetometer实现倾斜补偿的电子罗盘.您在设备框架中获得了accelerometermagnetometer读数. AccelerometerMagnetometer给出的读数是设备旋转的函数.该旋转包含设备的横滚,俯仰和航向信息.以下是使用accelerometer+magnetometer进行的航向估计的解释和推导.

If you want to implement of your own try tilt-compensation algorithm. All you have to do is implement tilt- compensated ecompass using accelerometer and magnetometer. You get accelerometer and magnetometer readings in device frame. Accelerometer and Magnetometer gives readings as a function of rotation of device. This rotation contains information of Roll, Pitch and Heading of device. Following is explanation and derivation of heading estimation using accelerometer+magnetometer.

倾斜补偿算法

accelerometermagnetometer给您

分别阅读.它们在设备框架中,并且设备通过

readings respectively. They are in device frame, and device is rotated through

.

的标题.因此设备的旋转矩阵将为

Where is heading you are looking for. So rotation matrix of device will be

我们必须解决.因此,请逐步解决.

We have to solve for . So step by step solving for .

从上面等于零,我们得到

From above, equating to zero we get

具有从上面

这是从accelerometer+magentomete获取航向"值的基本方法.偏航/航向值由手机中存在的运动传感器API提供.

This is basic method of obtaining Heading value from accelerometer+magentomete. Yaw/Heading value is provided by Motion sensor APIs present in mobile phones.

在实现sensor-fusion算法时,您必须了解几件事. Accelerometers并不总是重力方向,它给出了传感器(例如在线性加速度下的设备)所经历的椭圆加速的方向. Magnetometer读数由于附近的铁磁性物质而变形.精度也取决于gyroscope传感器中的系统偏置分量.

You have to look at few things while implementing sensor-fusion algorithms. Accelerometers doesn't always gravity direction, it gives direction of ovarall acceleration experienced by the sensor eg, devices under linear accelerations. Magnetometer readings are subjected distortion due to ferromagnetic substances in vicinity. Accuracy depends on systematic bias component in gyroscope sensor too.

有许多算法可以估算准确的航向值.其中一些是

There are numerous algorithms to estimate accurate heading values. Some of them are

  • Madgwick AHRS
  • Complementary filter
  • Kalman filter
  • Compensation of Magnetic Disturbances, this algorithm gave best results among all.

这篇关于如何使用陀螺仪和磁力计计算航向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-06 14:50