计算手机握持位置的高度

发布于 2024-12-17 06:25:37 字数 199 浏览 0 评论 0原文

有没有办法计算地面和手机之间的高度?我以为我可以使用加速度计来测量高度,但这篇文章建议考虑到不准确率,您不应该使用它。如果是这样,我应该采取什么方法来测量手机放置的高度?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

oО清风挽发oО 2024-12-24 06:25:37

加速计(和计时器)可以测量相对高度。如果你从头开始,你可以获得一个近似值。

如果您不介意它只工作一次:

放下它,使用相同的技术,在第一次撞击后停止计时。

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.

优雅的叶子 2024-12-24 06:25:37

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文