解释 Android 加速计值以获得手机在现实世界中沿轴的平移
我进行了搜索,但找不到答案;在解释 Android 加速计值时,如何将这些值转换为沿 X/Y/Z 轴的现实世界手机翻译?
我希望这是有道理的——我只是无法准确地理解我们如何摆脱重力?我们需要吗?
我在想,如果我们取加速度计返回的 3D 矢量的大小 - 它将是 9.8 或更大,然后我们减去重力以获得实际的加速度大小。但是,由于手机的运动+重力方向分布在所有 3 个轴上,加速度计事件返回的矢量会不准确吗?
请帮忙!
谢谢
I did search but I could not find an answer; When interpreting android accelerometer values, how can one translate these values into real world phone translation along X/Y/Z axes?
I hope it makes sense - I just can't get a grip on exactly how do we get rid of gravity? Do we need to?
I was thinking if we take the magnitude of the 3D vector that is returned by accelerometer - it would be 9.8 or greater, and then we subtract gravity to get the actual acceleration magnitude. But then would the vector returned by the accelerometer event be inaccurate due to motion of the phone + direction of gravity distributed across all 3 axes...
Please help!
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
免责声明:我不知道任何 Android 细节,它可能也是手机特定的。我只是从物理学背景来说。
您需要将加速度积分到速度,并将速度积分到位移(位置)。
你将遭受积分漂移的困扰。每次积分时,都会引入一个积分常数。多次集成会加剧此错误。
您还需要担心角加速度。
IE。当手机旋转但保持在相同的物理位置时会发生什么?
有一些方法可以帮助减少这些错误来源。
如果有多个加速度计,您可以比较它们,尝试确定任何角度分量。
如果有陀螺仪,您可以使用陀螺仪来帮助抵消角度分量。
如果指南针足够精确,您可以尝试至少取消水平面内的分量。
GPS 可用于尝试消除位移积分误差。
当 GPS 指示您已停止时,将积分常数清零。
您将需要开始研究数值积分和过滤算法。
如果没有硬件加速,这可能会导致计算成本高昂。
此时您真正需要开始问自己,您的问题是否真的需要精确的位移测量? GPS 位移就足够了吗?仅通过加速就能达到相同的结果吗?
您应该尝试阅读:
http://en.wikipedia.org/wiki/Inertial_navigation_system
Disclaimer: I do not know any Android specifics, it's likely also handset specific. I merely speaking from a physics background.
You will need to integrate acceleration to velocity, and integrate velocity to displacement (position).
You will suffer from integrational drift. Each time you integrate, an integration constant will be introduced. Multiple integrations compound this error.
You will also need to worry about angular acceleration.
ie. What happens when the handset is rotated, but remains in the same physical location?
There are ways to help reduce these sources of error.
If there are multiple accelerometers you can compare them, to try and determine any angular components.
If there are gyro's, you can use the gyro's to help cancel out the angular components.
If the compass is accurate enough, you can try to cancel at least the components in the horizontal plane.
GPS can be used to try and remove displacement integration errors.
When the GPS says you are stopped, zero out the integration constants.
You will need to start looking at numerical integration and filtering algorithms.
Without hardware acceleration, this could be computationally expensive.
At which point you really need to start asking yourself, does your problem really need precise displacement measurements? Will GPS displacement suffice? Can you achieve the same result with only acceleration?
You should try reading up on:
http://en.wikipedia.org/wiki/Inertial_navigation_system