开发者

GPS Accuracy problem

w开发者_如何学Gohat the factors effect my GPS accuracy ? i'm using android gps so how can i solve the problem of the accuracy because i'm doing a real life game depend on the GPS so its seems to be hell to me this un accuracy


None of the sensors are accurate by themselves, and there are too many real world factors to tell which may be the most accurate.

Nonetheless, I've implemented a weighted average of each sensor, weighted by both recency and claimed accuracy:

  1. Track the last location fix for each LocationProvider individually. I use a Map of each LocationProvider name to the corresponding Location object.
  2. On each update compute a new weighted average from the set of most recent fixes:
    1. Throw out any fixes older than some age threshold (say, 20 minutes)
    2. Calculate the weight of the remaining based on the inverse of each fixes' accuracy.
    3. To prevent discontinuities, depreciate weight location fixes less than some lesser threshold (say, 10 minutes) down to zero at first threshold.
    4. Sum weights, and calculate the percentage of each weight as it related to the total.
    5. Sum each latitude as weight_percent*fix.getLatitude(). Repeat for longitude.
  3. Create a new Location object with artificial LocationProvider name "average" and computed lat/lon to use through out the rest of your program.

Also, see the following: http://developer.android.com/guide/topics/location/obtaining-user-location.html#BestEstimate

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜