Detecting Acceleration in a car (iPhone Accelerometer)

后端 未结 5 677
一整个雨季
一整个雨季 2020-12-07 17:55

I am working on an iPhone app where we are trying to calculate the acceleration of a moving car. Similar apps have accomplished this (Dynolicious), but the difference is tha

5条回答
  •  轮回少年
    2020-12-07 18:57

    @The Gazzardian,

    So your essential problem as I understand is to detect the forward vector. You can opt these:

    1. You sample the speed at say every 0.2 seconds for 5 seconds and switch the sampling off for the next n seconds,so that resource is not hogged. Now what you can do from those datapoints is, you will be able to discern the rate of change of speed(there are simple numerical methods to find the derivative using data points). But this wont give you acceleration in the truest sense, because it wont give you the direction. AFAIK, the accelerometer yields the direction as well, i.e how much inclined it is to one of the axis/gravity.

    Consult this figure to detect the angle: Angles and Hills http://lh6.ggpht.com/_p7FIkTnaSc4/S9kkKF7oECI/AAAAAAAABYg/D1tbxNQXo0E/s288/Hill.png

    Another possible method, is to find the extra force during the climbing of the hill. Given the extra force, you might be able to find the angle. The vertical component of the extra force is to counter, the vertical component in opposite direction, g.

提交回复
热议问题