哪种方法更好以获得方向?

发布于 2025-01-05 21:19:40 字数 316 浏览 0 评论 0原文

我想获得 Android 方面的指导。有两种方法。

一是方向传感器。 data value[0] 的值是方位角:绕 z 轴的磁北方向与 y 轴之间的角度(0 到 359)。 0=北,90=东,180=南,270=西。

另一个是GPS。我可以使用 android.location.Location.getBearing() 来获取以真北以东的度数的行进方向。

我同时使用这两种方法,发现值相差很大。例如,方向传感器的值为20,而GPS方位的值为340,为什么会有差异?哪个更好?

顺便说一句,这种差异与磁北和真北之间的差异有关吗?在地理上,它们并不相同。

I want to get the direction in Android. There are two methods.

One is the orientation sensor. The value of data value[0] is the azimuth: angle between the magnetic north direction and the y-axis, around the z-axis (0 to 359). 0=North, 90=East, 180=South, 270=West.

The other is GPS. I can use android.location.Location.getBearing() to get the direction of travel in degrees East of true North.

I use both of these methods at the same time, and find the values differs a lot. For example, the value of orientation sensor is 20, while the value of the GPS bearing is 340. Why are there differences? Which is better?

BTW, is the difference related to the difference between the magnetic north and the true north? In geography, they are not same.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱的那么颓废 2025-01-12 21:19:40

我相信差异是因为 GPS 使用地理北极/南极而不是磁极。你越往北,你所在的地方的差异就越大。 GPS 卫星位置必须是绝对的,使用磁极等波动的参考点是一个很大的禁忌。

你应该使用哪一个:移动时我会使用 GPS,静止时我会使用指南针。

I believe the difference is because GPS uses the geographical North/South Pole rather than the magnetic ones. The further north you are, the bigger the difference is to where you are. The GPS satellite positions need to be absolute, and using a fluctuating point of reference like the magnetic poles is a big no-no.

Which one you should use: I would go with GPS when moving, and compass when standing still.

那小子欠揍 2025-01-12 21:19:40

磁传感器显示手机的磁航向,即手机指向的方向。磁北。
GPS 指示手机的方位。真北,即行进方向或真实轨迹。
如果手机在运动线上移动(磁力变化为零的线,例如在法国移动),并且如果手机指向行进方向,则它们应该相同(加上/减去传感器的精度) )。

The magnetic sensors show the magnetic heading of the phone, i.e. where it is pointed to wrt. magnetic north.
The GPS indicated the bearing of the phone wrt. true north, i.e. the direction of travel or the true track.
If the phone is moving on the agonic line (the line where the magnetic variation is zero, it moves through in France for example) and if the phone pointing in the direction of travel they should be the same (plus/minus accuracy of the sensor).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文