Android位置“去散步"通过它自己 [英] Android Location "going for a walk" by itself

查看:66
本文介绍了Android位置“去散步"通过它自己的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做项目的GPS部分,我想从社区中获得一些东西.我已经搜索了所有典型的GPS跳跃和漂移",并且一直在努力改善获得的信息,但是上周我得到了一些非常怪异的数据,我无法动手.

I am working on the GPS part of a project and I would like to get something past the community. I have searched around for all the typical GPS "jumping and drifting" and I have worked on improving what I get but last week I got some really weird data that I cannot put my finger on.

应用程序基本上具有前台服务,该服务会跟踪位置,然后将其上载到计时器上.当然,我们拥有所需的所有适当权限,并且还有一个筛选器,它会以非常差的准确度清除数据并停止"检测.一切运行良好,直到您看到这里发生的一切为止.这些是我得到的一些数据点.一个美丽的"图案图.同样的情况也发生在另一个位置,但没有扩展到这个位置.我检查了数据,以找出为什么我的过滤器甚至没有尝试使事情变得更好,但我发现它无法做到.所有这些要点都具有适当的速度,方向和准确性,并且出于所有意图和目的,我可以说这个人实际上做了整个事情.问题是它没有发生.电话(Samsung J5)可能不是最好的电话,它一直都在一个房间里.根据我对融合位置提供程序的了解,如果在此过程中未涉及GPS,则不会报告速度.并假设手机坐在那里实际上可以得到GPS信号.我可以看到它在跳来跳去,但要在附近走走吗?

The application basically has a foreground service that tracks the location and then uploads that data on a timer. Of course we have all the proper permissions needed and there is also a filter that weeds out data with really bad accuracy and "detects" stops. All was working well until what you can see here happened. These are some of the data points I got. A "beautiful" pattern drawing. The same happens to another location too but not to this extend. I checked the data to find out why my filter didn't even try to make things better and I found out that it would be unable to. All the points have proper speed, heading, and accuracy and for all intents and purposes I could say that the person actually did the whole thing. The problem is that it didn't happen. The phone, (Samsung J5) might not be the best there is out there, was in a room the whole time. From my understanding of the Fused Location Provider there is no speed reported if there is no GPS involved in the process. And lets assume that where the phone was sitting it could actually get a GPS signal. I can see it jumping around but going for a walk around the neighborhood?

我知道并了解,Android(及任何其他平台)中的位置可能是一个非常复杂的问题,其中包含许多不同的变量,这些变量主要从提供这些变量的硬件开始,但是我们如何解释这种突然的疯狂涌入,即使看似适当,数据呢?我们是否可以考虑使定位服务长时间保持运行并实际上使系统陷入瘫痪或疲倦"了?到目前为止,已经提供OK数据的同一设备如何突然提供该数据集?

I know and understand that the location in Android (and any other platform) can be a very complicated matter comprised of many different variables that mainly start from the hardware providing these variables, but how can we explain this sudden influx of crazy, even though seemingly proper, data? Can we consider that keeping the location service up and running for a long time actually bogged or "tired" the system? How can the same device that has given OK data to this point suddenly provide this dataset?

要添加到该问题中.在数据中,还有大约一分钟或两分钟的长延迟(间隔设置为15秒和10秒(最快)).我100%确信该服务没有重新启动或某种形式的启动,因为我正在为此登录.

To add to the issue. In the data there were also one or two long delays of around 2 minutes (intervals set to 15 and 10 (for fastest) seconds). I am 100% sure that the service did not restart or anything of the kind because I am logging for that.

任何种类的见识将不胜感激,如果有任何方法/方法/算法,您可以建议研究以修复"这种行为将是很好的.在此先感谢您,很长的问题对不起.我需要提供适当的背景.

Any kind of insight would be greatly appreciated and if there is any way/method/algorithm you could recommend looking into to "fix" this kind of behavior would be great. Thank you in advance and sorry for the long question. I needed to provide a proper background.

编辑:这并不是我的问题的真正答案,为什么会突然出现这种行为,因此,我在这里添加它作为尝试缓解问题的方法,至少可以缓解一下.我决定使用Google的ActivityRecognitionAPI(与位置API捆绑在一起,因此不需要更多依赖项),并将其输出与我现有的过滤器合并,以期修复"假"位置数据.

This is not really the answer to my question, why such a behavior suddenly appears, so I am adding it here as a way to try and mitigate the problem, at least a bit. I decided to use the Google's ActivityRecognitionAPI (comes bundled in the location API so no need to have more dependencies) and merged its output with my existing filter to hopefully "fix" the "false" location data.

如果有人仍然可以,请给我一个很好的答案(帮助我理解),是否存在运行时间长的因素,或者其他硬件(或软件)因素(不包括电话中GPS芯片不良的一般知识)),它可能会引起像上述提到的怪异和意外行为.

If someone could still, though, give me a good answer (help me understand) on whether there are factors like long running times, or other hardware (or software) factors (excluding the typical knowledge that GPS chips on phones are bad) that can cause weird and unexpected behaviors like the mentioned one would be rather appreciated.

(我们当然可以总是说-这是电话的问题",并且可以完成;))

(We can of course always say - "It is the phones fault" - and be done ;) )

推荐答案

GPS出现错误,因此即使您站在同一点,您也会获得不同的读数.您可以做几件事:

The GPS has errors, so even if you stand still at the same point you will get different readings. There's a couple of things you can do:

  1. 使用GPS的精度值-如果新读数与上一个读数之间的距离小于精度,则忽略它.
  2. 使用设备的加速度计来确定它是否在移动.

这篇关于Android位置“去散步"通过它自己的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆