Android的加速度计全系列 [英] Android accelerometer full range

查看:243
本文介绍了Android的加速度计全系列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在与Android传感器API和加速度计数据。 虽然内部组件应支持高加速度(甚至+ -16g),我尝试了一些最近的智能手机,发现暴露的数据的最大范围通常为+ -2G(例如Nexus的5),有时+ -4g(例如Nexus的4)。 有什么办法来设置传感器的满量程? (我没能找到这个公共API) 另外,有没有支持更高的范围内股票的任何旗舰智能手机? (例如+ -8g,+ -16g)。

I am currently working with Android Sensor API and accelerometer data. Though the internal components should support high acceleration (even +-16g), I tried some recent smartphone and found that the maximum range of exposed data is usually +-2g (e.g. Nexus 5) and sometimes +-4g (e.g. Nexus 4). Is there any way to set the full scale of the sensor? (I didn't manage to find a public API for this) Alternatively, is there any flagship smartphone that support higher range from stock? (e.g. +-8g, +-16g).

推荐答案

我面临着同样的问题,因为你的。 免责声明:我刚刚发现了我写的,所以我没有测试它在所有...但我认为这是正确的方向前进

I'm facing the same problem as yours. DISCLAIMER: I just discovered what I'm writing, so I haven't tested it at all... but I think it's in the right direction.

检查什么范围是功能相当简单:Sensor.getMaximumRange() 的http://developer.android.com/reference/android/hardware/Sensor.html#getMaximumRange%28%29

Checking what range is functional is quite simple: Sensor.getMaximumRange() http://developer.android.com/reference/android/hardware/Sensor.html#getMaximumRange%28%29

现在,如你所知,设置适当的值是一个更积极参与的事情。我相信这是与Android的所谓的硬件抽象层 https://source.android.com/devices/reference/files.html

Now, as you know, setting the appropriate value is a much more involved thing. I believe it has to do with Android's so-called "Hardware Abstraction Layer" https://source.android.com/devices/reference/files.html

我发现这个文件由意法半导体,谁是嵌入在三星Galaxy SIII和S4 <一个加速度计的制造商href="http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00063297.pdf" rel="nofollow">http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00063297.pdf

I've found this document by STMicroelectronics, who are the manufacturers of the accelerometers embedded in Samsung Galaxy SIII and S4 http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00063297.pdf

如果我得到它的权利,你需要在configuration.h(该文件的第5页)#定义ACCEL_MAX_RANGE为8或16 * GRAVITY_EARTH。有大量的下面的说明,这我还是想知道,但我认为一个人需要以root的智能手机,并从它的源代码编译的Andr​​oid。

If I'm getting it right, you need to #define ACCEL_MAX_RANGE in configuration.h (page 5 of the document) as 8 or 16*GRAVITY_EARTH. There are plenty of instructions following, which I'm still trying to understand, but I think one would need to root the smartphone and compile Android from its source.

希望这有助于!如果你能解决这个问题,请让我知道,使我们可以互相帮助。

Hope this helps! If you manage to solve it, please let me know so that we can help each other.

问候

这篇关于Android的加速度计全系列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆