从 xyz 磁力计获取磁北 (iPhone 3.0)
我实际上是在转发 iphone 开发板的一个问题。 我没有问它,但我在试图寻找它的答案时发现了它。 那里还没有人回复,所以我想我应该尝试将其发布在这里。
预先感谢您的任何帮助!
有谁知道有关根据 CLHeading 的原始 xyz 值计算磁航向的算法的任何细节吗? 我确信必须有一种适用于不同磁力计的通用方法。
I'm actually reposting a question from the iphone development boards. I didn't ask it, but I found it when trying to find its answer. Nobody had yet responded there, so I thought I'd try posting it here.
Thanks in advance for any help!
Does anybody know any specifics about the algorithm of computing the magnetic heading from the raw xyz values of CLHeading? I am sure there must be a general approach to this that works for different magnetometers as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您不想使用
trueHeading
值,并假设罗盘完全水平放置,则可以通过以下方式计算航向:(这些来自http://www.magnetsensors.com/datasheets/an203.pdf)
...加上标题必须针对磁偏差和磁偏角
如果罗盘不是水平的,您应该仅使用水平分量(不能忽略 z 轴)将 (x, y, z) 向量投影到与地球表面平行的平面,然后根据投影的 x 和 y 计算航向。
希望能帮助到你。
If you don't want to use the
trueHeading
value, and assuming that the compass lies perfectly horizontal, the heading can be computed this way:(these are from http://www.magneticsensors.com/datasheets/an203.pdf)
... plus the heading must be corrected for Magnetic deviation and Magnetic declination
in case the compass is not horizontal, you should use only the horizontal component (you can not ignore the z axis) by projecting the (x, y, z) vector to a plane that is parallel to the earth surface and then compute the heading from this projected x and y.
Hope it helps.