Calculate height where my phone is being held

做~自己de王妃 提交于 2019-12-01 19:47:50

问题


Is there a way to calculate the height between ground and your phone ? I thought i could use accelerometer to measure height but this post suggest that you should not use it considering the inaccuracy rate. If so what approach should i take to measure the height where my phone is held ?


回答1:


GPS is accurate enough for you to get the elevation to within a few meters, but that's probably not what you're going for.

I suppose you could try some sort of sonar, after you determine that the phone's mic/speaker is pointing straight towards the ground with the accelerometer. You could assume STP, which would probably introduce about 20% error.

You could also tell the user to drop the thing, and use the accelerometer to see how long it falls before hitting the ground. Probably the most precise and accurate. This might use up a lot of phones though.




回答2:


An accelerometer (and timer) could measure relative height. If you start from the ground you could get an approximation.

If you don't mind it only working once:

Drop it, use the same technique, stop timing after the first impact.



来源:https://stackoverflow.com/questions/8221300/calculate-height-where-my-phone-is-being-held

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