NMEA 消息发送至 Android 位置

发布于 2024-12-18 09:49:12 字数 162 浏览 6 评论 0原文

我正在使用外部 GPS,因为它们更加准确。我已经解决了蓝牙连接问题,但现在我陷入了大量 NMEA 格式的消息中。

看起来,既然您可以从内置 GPS 堆栈中获取 NMEA,那么一定有一种方法可以在给定 NMEA 消息的情况下获取位置。

如何将 NMEA 消息转换为有用的位置对象?

I am working with an external GPS, since they are far more accurate. I already have the bluetooth connection worked out, but now I'm stuck in a flood of NMEA formatted messages.

It seems like, since you can get NMEA out of the built in GPS stack, that there must be a way to get a Location given a NMEA message.

How do I go about converting my NMEA messages into useful Location objects?

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

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

发布评论

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

评论(1

來不及說愛妳 2024-12-25 09:49:12

NMEA 很容易解析。不同的事物有不同类型的句子。对于位置数据,您需要关心的句子是“推荐最小值”,$GPRMC

此处的示例: http://aprs.gids.nl/nmea/#rmc

$GPRMC,225446,A,4916.45,N,12311.12,W,000.5,054.7,191194,020.3,E*68
  • 225446(修复时间 22:54:46 UTC)
  • A(导航接收器警告 A = 正常,V = 警告)
  • 4916.45,N(纬度 49北纬 16.45 分)
  • 12311.12,W
  • (西经 123 度 11.12 分)000.5(对地速度,节)
  • 054.7(航向做得好,真实)
  • 191194(修复日期 1994 年 11 月 19 日)
  • 020.3,E(地磁偏转 20.3 度东)
  • *68(强制校验和)

您可能还对 $GPGSA,其中包含长期的卫星数据以及位置稀释(定位质量)。

如果没有可用于解析 NMEA 的内部类,您可以使用这些示例轻松地自己制作一个。不幸的是,我不是 Android 开发人员,所以我不知道您可以使用哪些内部类。

NMEA is quite easy to parse. There are various types of sentences for different things. For location data, the sentence you need to concern yourself with is the "recommended minimum", $GPRMC.

Example from here: http://aprs.gids.nl/nmea/#rmc

$GPRMC,225446,A,4916.45,N,12311.12,W,000.5,054.7,191194,020.3,E*68
  • 225446 (Time of fix 22:54:46 UTC)
  • A (Navigation receiver warning A = OK, V = warning)
  • 4916.45,N (Latitude 49 deg. 16.45 min North)
  • 12311.12,W (Longitude 123 deg. 11.12 min West)
  • 000.5 (Speed over ground, Knots)
  • 054.7 (Course Made Good, True)
  • 191194 (Date of fix 19 November 1994)
  • 020.3,E (Magnetic variation 20.3 deg East)
  • *68 (mandatory checksum)

You might be also interested in $GPGSA, which has satellite data long with dilution of position (quality of fix).

If there is no internal class available for parsing NMEA, you can use these examples to easily make one yourself. Unfortunately, I'm not an Android developer, so I don't know what internal classes are available to you.

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