在android中检测轴上的运动

发布于 2024-09-26 09:28:44 字数 165 浏览 1 评论 0原文

你好, 我愿意实现一个逻辑,其中我需要了解手机在 xy 或 z 轴上所做的运动量, 使用加速度计我只能找到这些轴上的加速度,即使我尝试根据x轴上的加速度计算相对x坐标值,它也没有用,因为我无法确定运动方向(即是向左运动还是向右运动) 我一定错过了一些东西..如果有人能提供任何指示,那就太好了..:) 提前致谢...

HI,
I am willing to implement a logic in which i need to know about the amount of motion made by phone on x y or z axis,
using accelerometer i can only find acceleration on these axis, even if i try calculating the relative x coordinate value based on acceleration on x axis, its of no use as i cannot determine the direction of motion (i.e whether it was left movement or right)
i must be missing on something.. it will be great if anyone could provide any pointers to this.. :)
thanks in advance...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

无名指的心愿 2024-10-03 09:28:44

您应该能够获得加速度的符号,但积分加速度以确定速度并再次积分以确定位置往往会产生较差的结果,因为误差很快就会失控。

此外,要制作 IMU,您不仅需要良好的加速度计,还需要 3 个良好的陀螺仪来确定加速度计的方向 - 而您没有任何陀螺仪,只有一个相当片状的罗盘传感器。

You should be able to get the sign of the acceleration, but integrating acceleration to determine velocity and integrating it again to determine position tends to give poor results, since errors quickly grow out of control.

Further, to make an IMU you need not only good accelerometers, you need 3 good gyros to determine the orientation of your accelerometers - and you don't have any, just a rather flaky compass sensor.

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