加速度计移动的距离 [英] Distance moved by Accelerometer

查看:37
本文介绍了加速度计移动的距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过移动 iPhone 来移动 iPhone 屏幕上的对象(矩形、圆形等).例如,我沿 X 轴移动 iPhone,对象沿 X 轴移动.Y、Z 轴相同.

I want to move objects on iPhone screen (rectangle, circle and so on) by moving iPhone. For example, I move iPhone along X-axis and the object moves along X-axis. The same for Y,Z-axis.

我该怎么做?我可以得到它的算法吗?

How can I do this? Can I get algorithm for it?

谢谢.

附:我看了一会儿,似乎可以使用加速度计.

P.S: I looked for a while and seems like it is possible using accelerometer.

推荐答案

你可以通过对线性加速度进行两次积分来获得位置,但错误很可怕.实践中没用.

You get position by integrating the linear acceleration twice but the error is horrible. It is useless in practice.

这是 23:20 的解释原因(Google 技术讲座).我强烈推荐这个视频.

Here is an explanation why (Google Tech Talk) at 23:20. I highly recommend this video.

但是陀螺仪鼠标可能适用于您的应用程序,请参见视频中的 37:00-38:25.

However the gyro mouse might work for your application, see between 37:00-38:25 in the video.

类似问题:

在没有 GPS 的情况下跟踪 iphone 的小动作
手机加速度计用于定位时的真实世界精度是多少?
如何从静止状态计算手机在垂直方向上的移动?
iOS:3D 空间中的运动精度
Android 应用开发中如何使用加速度计测量距离
如何计算陀螺仪和加速度计的行驶距离?

这篇关于加速度计移动的距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆