using Android Accelerometer to calculate distance , eleveation?

 ̄綄美尐妖づ 提交于 2020-01-01 06:37:28

问题


can it be determined that where a person is i.e is he walking ? is he in elevator ? or is he climbing up the stairs ?

using android's accelerometer or is there any other way to calculate such in android ?


回答1:


You can use a combination of the accelerometer and the digital compass, in phones that have them, to determine a speed and direction as mentioned in this post.

If all you need to do is determine if the person is walking, all you need is the accelerometer. Just process its output for foot steps.

There are plenty of tutorials on the web for detecting foot steps with an accelerometer.

There an app note here: http://www.analog.com/library/analogDialogue/archives/41-03/pedometer.html that gives a decent mathematical background and an example algorithm. Its of course up to you to extract the math and rewrite it for Android (the example code is written in C). I don't currently know of an open source android library with a footstep detection algorithm.

If you implement something, I would like to get the code, don't forget to post back the results.



来源:https://stackoverflow.com/questions/3134741/using-android-accelerometer-to-calculate-distance-eleveation

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