仅使用卫星纬度/经度启动标题/面向方向

发布于 2025-02-06 16:10:58 字数 308 浏览 3 评论 0原文

我从NMEA读者那里获得了自己的位置,这不会返回轴承,这是一个问题。我想始终显示该应用程序用户面临的方向,就像Google Maps位置层的小箭头指示用户面对的方向一样。 我尝试使用True North作为固定目的地,从而从我的位置到True North计算轴承。但这不如我所期望的。(当我转动时,标记不会与该轴承一起旋转),并且我尝试使用电磁传感器,但在我的Techno手机中不可用。 因此,只有一个纬度和经度,有没有办法弄清楚用户面临的位置?并可能朝那个方向绘制箭头? (从我的自定义位置提供商NMEA格式实时,LAT/LNG不断进来

)我只是得到坐标,想知道我在任何一点上面对的位置

I get my location from an NMEA reader and this does not return bearing which is an issue. I want to always show the direction the user of the app is facing, just like how google maps location layer has a small arrow indicating direction user is facing.
I have tried using true North as a fixed destination point and thus calculating bearing from my location to True North. But this does not work as i expected.(When i turn, the marker does not rotate with that bearing), and i tried using the electromagnetic sensor but it is not available in my techno phone.
So, with only a latitude and Longitude, is there a way i can figure out where the user is facing? And probably draw an arrow in that direction? (The lat/lng keep coming in, in real time from my custom location provider in nmea format)

note: I don't have a set/absolute destination point so bearingTo might not be helpful. I just get the coordinates, and want to know where I'm facing at any one point

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

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

发布评论

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

评论(1

不离久伴 2025-02-13 16:10:59

我从NMEA读者那里获得我的位置,这不会返回轴承,这是一个问题。

当我转动时,标记不会用轴承

旋转

,是的,如果没有任何数据,就无法计算您的方向。您需要向方向移动。如果在rmc消息或其他消息中没有轨道标题,那么唯一的方法是通过随着时间的推移使用几个点并从那里弄清楚一个向量来计算自己。这要求您朝着一个方向移动,而不仅仅是旋转。

I get my location from an NMEA reader and this does not return bearing which is an issue.

When i turn, the marker does not rotate with that bearing

Well, yes, you can't calculate your orientation without any data to do so with. You need to be moving in a direction. If there is no track heading in the RMC message, or other messages, then the only way is to calculate one yourself by using several points over time and figuring out a vector from there. This requires that you are moving in a direction, and not simply rotating.

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