在 iPhone 中测量车辆加速所需的时间 [英] Measuring time the vehicle takes to accelerate in iPhone

查看:24
本文介绍了在 iPhone 中测量车辆加速所需的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 iPhone 加速度计测量车辆在 400 米(四分之一英里)内从 0 加速到 100 公里/小时(0-60 英里/小时)所需的时间?

How to measure time the vehicle takes to accelerate from 0 to 100 km/h (0-60 mph) in 400meters (a quarter mile) using iPhone accelerometer?

我需要计算车辆在 400 米(四分之一英里)内从 0 加速到 100 公里/小时所需的时间,我需要使用 iPhone 加速度计来实现.

I have situation where i need to calculate the time the vehicle takes to accelerate from 0 to 100km/h in a 400 meters(quarter mile),i need to implement this using iPhone accelerometer.

推荐答案

您可以使用来自加速度计的加速度值来测量速度.有非常好的论文(使用加速度计实施定位算法)解释了你得到的错误从加速度计和从加速度值获得速度和位置的技术.要获得车辆从 0 公里/小时加速到 100 公里/小时所需的时间,您必须测量达到特定速度所需的时间.

You can use the acceleration values from the accelerometer to measure the velocity. 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. To get the time the vehicle takes to accelerate from 0 to 100 km/h you have to measure the time until you reached a certain velocity.

从加速度值中获取速度必须采取的主要步骤是

The main steps you have to take to get the velocity from the acceleration values are

  • 获取加速度值
  • 对这些值进行积分以获得速度

一些提示:速度[i] = (加速度[i] + 加速度[i-1])/2 * 间隔+速度[i-1]

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

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

为了提高准确性,您必须过滤正手中的加速度值.

To increase accuracy you have to filter the acceleration values in the forehand.

PS:我已经在 iPhone 3GS 上实现了这样的算法,而且效果很好.加速度计可让您测量 30 厘米的距离,误差约为 1 厘米.我还没有测试过更长的距离.

PS: 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天全站免登陆