How to detect walking with Android accelerometer

前端 未结 5 1401
悲&欢浪女
悲&欢浪女 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 05:50

    EDIT: I don't think it's accurate enough since when walking normally the average acceleration would be near 0. The most you could do measuring acceleration is detect when someone starts walking or stops (But as you said, it's difficult to filter it from the device moved by someone standing at one place)

    So... what I wrote earlier, probably wouldn't work anyway:

    You can "predict" whether the user is moving by discarding when the user is not moving (obvious), And first two options coming to my mind are:
    Check whether the phone is "hidden", using proximity and light sensor (optional). This method is less accurate but easier.
    Controlling the continuity of the movement, if the phone is moving for more than... 10 seconds and the movement is not despicable, then you consider he is walking. I know is not perfet either, but it's difficult wihout using any kind of positioning, by the way... why don't you just use LocationManager?

提交回复
热议问题