Android:Sensor.getResolution() 值
我正在开发将 SensorManager 用于不同目的的 Android 应用程序。 在调查过程中,我发现 Sensor.getResolution()
函数针对不同设备返回不同的值:
HTC Sensation 所有板载传感器的分辨率值为 1.0。
Motorola XOOM:
3-axis Accelerometer -> 0.009576807
3-axis Magnetic field sensor -> 0.0625
L3G4200D Gyroscope sensor -> 0.0012217305
Linear Acceleration Sensor -> 0.009576807
Gravity Sensor -> 0.009576807
不清楚在使用适当的传感器值之前是否需要使用此分辨率值进行额外计算。官方文档并没有阐明这一点。
有人可以向我解释一下这个“分辨率”的价值目的吗?
I'm working on Android applications which uses SensorManager for different purposes.
During investigation I found that Sensor.getResolution()
function returns different values for different devices:
HTC Sensation has 1.0 resolution value for all on board sensors.
Motorola XOOM:
3-axis Accelerometer -> 0.009576807
3-axis Magnetic field sensor -> 0.0625
L3G4200D Gyroscope sensor -> 0.0012217305
Linear Acceleration Sensor -> 0.009576807
Gravity Sensor -> 0.009576807
It's not clear whether I need to do additional calculation using this resolution value before using appropriate sensor's values. Official documentation doesn't throw the light upon it.
Can anybody explain me this 'resolution' value purpose?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
传感器的输出是电压。该值由 ADC 转换为整数。
假设
您的加速度计的灵敏度为 800mV/g
您的测量范围为 -1.5..1.5 g
你有一个 12 位 ADC
那么你的分辨率约为 (1.5g + 1.5g) / 800mV/g = 7*10-4 g/单位。
也就是说,低于此值的任何内容都无法区分,因此名称解析。
您不必对此值执行任何操作。它只是告诉您设备的理论极限。不幸的是,根据我的经验,传感器的准确性比这个极限更差......:(
The output of the sensors is voltage. This is converted to an integer by the ADC.
Assume
the sensitivity of your accelermeter is 800mV/g
you are measuring between -1.5..1.5 g
you have a 12 bit ADC
Then your resolution is approximately (1.5g + 1.5g) / 800mV/g = 7*10-4 g / unit.
That is, anything below this cannot be distinguised, hence the name resolution.
You do not have to do anything with this value. It is just tells you the theoretical limit of the device. Unfortunately, in my experience, the accuracy of the sensors is worse than this limit... :(
分辨率定义为传感器可以检测到的最小变化。
Resolution is defined as smallest change that can be detected by a sensor.