我正在研究一种半增强现实应用,其中平滑和准确的数据非常重要。传感器返回的值在0到4度之间跳跃,不幸的是它使生活变得困难。如何使android compas传感器变得光滑
我已经尝试实现一个临时解决方案:
private float[] Total = new float[11];
private float Average(){
if (counter == Total.length - 1) {
counter --;
for (int i = 0; i < Total.length - 1; i++) {
Total[i] = Total[i + 1];
}
}
float tot = 0;
for (int i = 0; i < Total.length - 1; i++) {
tot = tot + Total[i];
}
return tot/counter;
}
但是这不符合我的需要的任何建议或帮助?
我认为有精度为每个传感器读这http://developer.android.com/guide/topics/sensors/ sensors_overview.html#sensors-monitor – 2014-11-21 12:30:17