Android的轨道位置问题轨道、位置、问题、Android

2023-09-07 04:59:40 作者:M - 萌面超人 °

我工作的应用程序中,我要计算从起点的总距离到终点。我使用Android SDK的位置管理,使用位置监听器,并使用这两个供应商(全球定位系统和网络提供商)和每20秒我有跟踪的位置,并把跟踪位置到数组列表。经过一段时间计算总距离由

I am working on app in which I have to calculate the total distance from start point to end point. I use the Location Manager of the Android SDK, use location listener and use both provider(GPS and network provider) and in every 20 seconds I have track the location and put the tracked location into the array list. After a time period calculate the total distance by

total distance = dist at point[0,1]+ dist at point[1,2] + ... +dist at point[n-1,n]

其中, 0,1,2,...,N 是数组列表位置值的索引。

where 0,1,2,...,n is the index of array list location value.

若干测试后,没有得到准确的结果。大约有60-70%的实际里程表的价值。如果必须使用一些其他替代请指导。请指导我如何得到更准确的结果。

After several test, Not got the accurate result. Approximately 60-70% of actual odometer value. Please guide if have some other alternative to be used. Please guide me how I got more accurate result.

推荐答案

GPS和网络定位都有一定程度的与它们相关联的不确定性,因此相比于类似里程表的时候也不会通常给你一个确切的距离。如果你在城市峡谷在户外,而不是,GPS一般会给你一个更好的距离估计比网络位置。

GPS and network location both have a degree of uncertainty associated with them, so neither will generally give you an exact distance when compared to something like an odometer. If you're outdoors and not in urban canyons, GPS will generally give you a better distance estimate than network location.

距离的低估(你看到的),可能是由于你的采样率(每20秒)或丢失GPS信号。我会试着提高采样率,以每4秒左右,并确保您的GPS单元没有失去修复。 GPS灵敏度可跨设备有很大的不同,所以尽量用几个不同的Andr​​oid设备进行测试。您还可以看看Android应用我公司开发,以帮助衡量Android设备上的GPS精度: http://www.gpsbenchmark.com/

Underestimates of distance (what you're seeing) is probably due to your sampling rate (every 20 secs) or lost GPS signals. I'd try increasing your sampling rate to once every 4 seconds or so, and make sure your GPS unit isn't losing a fix. GPS sensitivity can vary widely across devices, so try to test with a few different Android devices. You can also check out an Android app I developed to help measure GPS accuracy on Android devices: http://www.gpsbenchmark.com/

距离的高估一般都是由GPS噪声引起,或者位置蹦跳着,由于小(有时大)的GPS位置误差。卡尔曼滤波器是减少一些这种噪声的影响的好方法。您也可以尝试过滤的路径,并通过简化线减少一些细节。道格拉斯 - 普克算法的实现,这样做可Apache 2.0的下我的足迹项目:http://$c$c.google.com/p/mytracks/source/browse/MyTracks/src/com/google/android/apps/mytracks/util/LocationUtils.java#78

Overestimates of distance are generally caused by GPS noise, or the position bouncing around due to small (and sometimes large) GPS position error. Kalman filters are a good way to reduce the impact of some of this noise. You can also try to filter the path and reduce some of the detail via line simplification. An implementation of the Douglas-Peucker algorithm to do this is available under Apache 2.0 in the MyTracks project: http://code.google.com/p/mytracks/source/browse/MyTracks/src/com/google/android/apps/mytracks/util/LocationUtils.java#78