计算手机握持位置的高度
有没有办法计算地面和手机之间的高度?我以为我可以使用加速度计
来测量高度,但这篇文章建议考虑到不准确率,您不应该使用它。如果是这样,我应该采取什么方法来测量手机放置的高度?
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 ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(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.
GPS 的精确度足以让您将海拔高度控制在几米之内,但这可能不是您想要的。
我想在您确定手机的麦克风/扬声器通过加速度计直接指向地面后,您可以尝试某种声纳。您可以假设 STP,这可能会引入大约 20% 的错误。
您还可以告诉用户放下东西,并使用加速计来查看它在落地之前下落的时间。可能是最精确和准确的。不过,这可能会用掉很多手机。
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.