之间是什么&QUOT的差异,重力和QUOT;和"加速"在Android的传感器? [英] What is the difference between "gravity" and "acceleration" sensors in Android?

查看:149
本文介绍了之间是什么&QUOT的差异,重力和QUOT;和"加速"在Android的传感器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android的重力和加速度传感器之间的区别是什么?从我的角度来看的体力值是在两种情况下是相同的。

What is the difference between gravity and acceleration sensors in Android? From my point of view the physical value is the same in both cases.

哪一个测量作用在单位质量的设备内部的力量?

Which one measures the force acting on unit mass inside the device?

加成

现在的问题是:什么物理量是由这些传感器测得的?据等效原理加速度和重力是无法区分的,并同时测量的唯一方法是用通常的(但3D)弹簧秤

The question is: what physical quantity is measured by these sensors? According to equivalence principle the acceleration and gravity are indistinguishable and the only way to measure both is by usual (but 3d) spring balance.

推荐答案

加速度传感器给你全部回力总和应用到您的设备,而重力感应重力返回只影响。如果要排除加速的严重性,您可以使用高通滤波器或只是减去重力传感器值加速度传感器值 - 。不知道哪种方法提供了更好的precision

Acceleration sensor gives you back the sum of all forces applied to your device, while Gravity sensor returns only the influence of gravity. If you want to exclude the gravity from acceleration, you may use a high-pass filter or just subtract the gravity sensor values from acceleration sensor values -- not sure which method gives better precision.

另一种方法可以是使用Sensor.TYPE_LINEAR_ACCELERATION,这给准确地(加速度 - 重力),但你应该检查它是否可以在设备上。我发现了几个设备,具有加速度传感器的工作,但没有重力和LINEAR_ACCELERATION传感器的响应。

Another method could be using Sensor.TYPE_LINEAR_ACCELERATION, which gives exactly (acceleration - gravity), however you should check if it's available on the device. I've found a few devices, which have ACCELERATION sensor working, but no response from GRAVITY or LINEAR_ACCELERATION sensors.

这篇关于之间是什么&QUOT的差异,重力和QUOT;和"加速"在Android的传感器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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