Measuring time the vehicle takes to accelerate in iPhone

亡梦爱人 提交于 2019-11-28 20:58:27

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

  • get the acceleration values
  • integrate over the values to get the velocity

Some hint: velocity[i] = (acceleration[i] + acceleration[i-1])/2 * interval + velocity[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: 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.

the accelerometer can only be used to measure G-forces.. not speeds.. You will need GPS to measure when you've reached 100km/u speeds..

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!