3

I am needing to implement a shake recognizer, and I am using the accelerometer on the device to that. However, when I check the values I get from the sensor, it appears that they vary wildly from device to device. For instance, I get a value range of 0-8 as force (after some calculations) on one device, and on the other 0 - 4.

So it looks like they have very different ranges.

Is there anything I can do to make these ranges equal. Or are there some variables that I can use to somehow calculate what a fairly hard shake would be?

4

3 回答 3

2

According to specification accelerometer should return Measures the acceleration force in m/s2. So it should be calibrated. One thing you could check however is the Sensor class's getMaximumRange() and getResolution()

于 2012-11-14T15:45:34.853 回答
0

芯片在 pcb 上的物理放置以及 pcb 在设备内的固定以及设备的结构都可能导致不同的阻尼效应,以响应您的振动输入力。

你没有说你如何处理传感器数据,很可能会产生与在驱动程序级别执行的采样和过滤相关的影响。

您显然需要在代码中灵活地使用您期望的值范围并在各种设备上进行测试。

于 2012-11-14T16:55:09.823 回答
0

应校准传感器。

显然不是。如果不同方向(即 x、y、z)上的增益没有显着差异,那么寻找加速度计矢量的长度^2 的突然变化就足够了:x^2+y^2+z^2.

如果增益也显着不同,那么您别无选择,只能编写一个用于加速度计校准的应用程序......

顺便说一句,您不是第一个报告严重错误的人,例如Android:加速度计传感器中的 z 值范围在不同的设备上是不同的

于 2012-11-14T18:18:08.953 回答