GPS V.S.加速度计计算距离 [英] GPS V.S. accelerometer to calculate distance

查看:23
本文介绍了GPS V.S.加速度计计算距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试实现一个可以在 Android 中跟踪跑步速度和跑步距离的健身应用.

I am trying to implement a fitness app that can keep track of the running speed and running distance in Android.

看起来我可以使用 GPS 或加速度计来计算这些信息.

It looks like I can either use GPS or Accelerometer to calculate these information.

由于跑步者可能会将手机放在手上、肩上或口袋里,我的第一个直觉是使用 GPS 获取位置并计算跑步速度和跑步距离.但是最近有人告诉我,我也可以使用 Accelerometer 也可以这样做.

Since a runner may put his phone in hand, on the shoulder or in his pocket, my first intuition is to use GPS to get locations and calculate running speed and running distance. But recently someone telled me that I can also use Accelerometer also does that.

我的问题是:在Android中,计算跑步速度和跑步距离,GPS还是加速度计,哪种方法更好?

My question is: In Android, which approach is better to calculate running speed and running distance, GPS or Accelerometer?

推荐答案

我怀疑计步器是基于加速度计的,因为加速度计使用起来比 GPS 便宜.事实上,我认为很多计步器甚至不尝试测量距离.只是加速度颠簸等于步数.然后,如果他们为您提供距离测量值,则是将检测到的步长乘以猜测的步长或平均步长.

I suspect that pedometers are based on accelerometers because accelerometers are cheaper than GPS to use. in fact I think a lot of pedometers don't even try to measure distance. just acceleration jolts which equal steps. and then if they give you a distance measurement, it's by multiplying detected steps by a guessed or average step size.

GPS(如果您在它可以工作的地区!)可以很好地测量距离.即使使用非常便宜的 GPS 接收器.一切都基本正常,您应该期望起点和终点位置在 10m 以内,因此对于 1km 的旅行,您有 20m 的不确定性,即总距离不确定性的 2%.这种不确定性随行进距离线性下降(即,2 公里的不确定性为 1%,4 公里的不确定性为 0.5%,等等)这里的问题将与您的实时显示有关(GPS 位置从卫星切换产生大量速度值, 或立即丢失信号导致所有可立即显示的数据丢失)

GPS (if you are in an area where it works!) will do a very good measurement of distance. Even with a very cheap GPS receiver. All being basically OK, you should expect start and end positions to within 10m, and so for a 1km travel, you have 20m of uncertianty, which is 2% total distance uncertianty. This uncertianty goes down linearly with distance travelled (ie a 2km run will have 1% uncertianty, 4 km run will have 0.5% uncertianty, etc) the issues here will be with your realtime displays (GPS position jumps from satellite switching giving massive speed values, or immediate loss of signal giving a loss of all immediately displayable data)

我认为使用一个好的加速度计,从停止开始,您可以不断整合信号以获得速度,并不断整合该结果以获得距离......我只是不确定您在任何给定手机中获得什么样的加速度计质量?您可能需要过滤噪音甚至垃圾数据.而且您还需要考虑它的准确性.传感器 20% 的准确度会使距离跟踪器变得非常糟糕.因此,您可能需要使用步数计算和步长估计值.

I think that with a good accelerometer, starting from stopped you can continually integrate the signal to get speed, and continually integrate that result to get distance... I am just unsure what kind of accelerometer quality you get in any given phone? you may need to filter for noise or even garbage data.. And you also need to consider what accuracy it has. 20% accuracy in your sensor would make for a very bad distance tracker. So you might have to work with step counting and step size guesstimates.

也许两者的结合可以工作?

perhaps a combination of both could work?

我很想使用加速度计数据(积分或计步,取决于什么总是有效的)在短时间内跟踪速度和距离,然后在更长的时间范围内,通用 GPS 数据可用于纠正或缩放来自加速度计的数据.特别是如果您在任何给定时间根据不确定性测量过滤/阻止 GPS 数据.

I'd be tempted to use the accelerometer data (either integrating or step counting depending on what will always work) to track speed and distance in short timeframe, then with much longer timeframe, generalised GPS data could be used to correct or scale that data from the accelerometer. Especially if you filtered/blocked GPS data based on uncertianty measurement at any given time.

这篇关于GPS V.S.加速度计计算距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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