android 加速度计精度极差

发布于 2024-10-10 16:54:51 字数 597 浏览 0 评论 0原文

编写了一个简单的程序来打印加速度计输出。

mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
mSensorManager.registerListener(this,mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_FASTEST);     

事实证明:

  1. 加速度计输出始终设置为“最低”,具体取决于:

    public void onAccuracyChanged(传感器传感器, int 精度) {
      如果(收集数据){  
         accelPrecision.setText("加速度计精度:" + 精度);
      }
    }
    
  2. 实际加速度计读数非常不准确 - 即使将其放在桌子上,也会有约 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:

  1. 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);
      }
    }
    
  2. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

屋檐 2024-10-17 16:54:51

使用过滤器。您正在查看原始数据,因此它当然会波动。类似于加权平均值移动平均线就足够了。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文