Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
304 views
in Technique[技术] by (71.8m points)

accelerometer - Measuring time the vehicle takes to accelerate in iPhone

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?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...