How to detect walking with Android accelerometer

前端 未结 5 1392
悲&欢浪女
悲&欢浪女 2020-12-13 04:53

I\'m writing an application and my aim is to detect when a user is walking. I\'m using a Kalman filter like this:

float kFilteringFactor=0.6f;

        gravi         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 05:45

    Try detecting the up and down oscillations, the fore and aft oscillations and the frequency of each and make sure they stay aligned within bounds on average, because you would detect walking and specifically that person's gait style which should remain relatively constant for several steps at once to qualify as moving. As long as the last 3 oscillations line up within reason then conclude walking is occurring as long as this also is true:-

    You measure horizontal acceleration and update a velocity value with it. Velocity will drift with time, but you need to keep a moving average of velocity smoothed over the time of a step, and as long as it doesn't drift more than say half of walking speed per 3 oscillations then it's walking but only if it initially rose to walking speed within a short time ie half a second or 2 oscillations perhaps.
    All of that should just about cover it. Of course, a little ai would help make things simpler or just as complex but amazingly accurate if you considered all of these as inputs to a NN. Ie preprocessing.

提交回复
热议问题