android 加速度计精度极差
编写了一个简单的程序来打印加速度计输出。
mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
mSensorManager.registerListener(this,mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_FASTEST);
事实证明:
加速度计输出始终设置为“最低”,具体取决于:
public void onAccuracyChanged(传感器传感器, int 精度) { 如果(收集数据){ accelPrecision.setText("加速度计精度:" + 精度); } }
实际加速度计读数非常不准确 - 即使将其放在桌子上,也会有约 2%-5% 的波动
据我所知,在 Nexus S、Nexus One 和 G1 上也存在同样的问题 知道
如何使其模式准确吗/ 什么设置了
Wrote a simple program that prints out accelerometer output.
mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
mSensorManager.registerListener(this,mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_FASTEST);
It turns out that:
The accelerometer output is always set to "lowest" as determined by:
public void onAccuracyChanged(Sensor sensor, int accuracy) { if (collectingData){ accelPrecision.setText("accelerometer accuracy: " + accuracy); } }
The actual accelerometer readings are very inaccurate - about 2%-5% fluctuations even when it's resting on the table
as far as I can tell it's the same problem on Nexus S, Nexus One and G1
Any idea how it could be made mode accurate / what sets a
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用过滤器。您正在查看原始数据,因此它当然会波动。类似于加权平均值或移动平均线就足够了。
Use a filter. You are looking at raw data so of course its going to fluctuate. Something like a weighted average or a moving average will suffice.