iphone加速度计速度和距离 [英] iphone accelerometer speed and distance

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

问题描述

我想从加速度计事件中找到行进距离和速度.就像 iphone 的 gMeter 应用程序所做的那样.

I want to find distance traveled and velocity from accelerometer events. Like iphone's gMeter application is doing.

任何建议,我应该使用哪个值或公式?

Any suggestion, by which value or formula I should use for that?

提前致谢.

推荐答案

您可以使用来自加速度计的加速度值来测量速度和距离.有非常好的论文(使用加速度计实现定位算法)解释您从加速度计获得的误差以及从加速度值获得速度和位置的技术.

You can use the acceleration values from the accelerometer to measure the velocity and distance. There is really good paper (Implementing Positioning Algorithms Using Accelerometers) which explains the errors you get from the accelerometer and the techniques to get the velocity and position from the acceleration values.

一些伪代码:

速度[i] = (加速度[i] + 加速度[i-1])/2 * 间隔+速度[i-1]distance[i] = (velocity[i] + velocity[i-1])/2 * interval + distance[i-1]

intervalacceleration/velocity[i]acceleration/velocity[i-1] 之间的时间,与更新有关加速度计的频率.

interval is the time between acceleration/velocity[i] and acceleration/velocity[i-1] which is related to the update frequency of the accelerometer.

为了提高准确性,您必须过滤正手中的加速度值.我已经在 iPhone 3GS 上实现了这样的算法,并且效果很好.加速度计可让您测量 30 厘米的距离,误差约为 1 厘米.我还没有测试过更长的距离.

To increase accuracy you have to filter the acceleration values in the forehand. I've implemented such an algorithm on an iPhone 3GS and it worked pretty good. The accelerometer let's you measure distances of 30 cm with an error of approximately 1 cm. I didn't tested longer distances yet.

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

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