简体   繁体   English

Android上的Accelerometer,Gyro和Magnetometer之间的样本数量不均匀

[英]Uneven number of samples between Accelerometer, Gyro and Magnetometer on Android

I am developing an Android app that records the inertial data on a smartphone to then further processes it. 我正在开发一款Android应用程序,用于记录智能手机上的惯性数据,然后进一步处理它。 Different Android devices have different behaviors depending on the firmware interfacing the inertial sensors to Android and that's crystal clear. 不同的Android设备具有不同的行为,具体取决于将惯性传感器连接到Android的固件,这一点非常清晰。 One thing I cannot answer myself though is, how come only the moto g 2nd gen yet showed that when the app is recording I have significantly different numbers of sensors samples? 有一点我无法回答的问题是,为什么只有moto g 2nd gen还表明当应用程序正在录制时我的传感器样本数量明显不同?

For example, few second of recording and I see: 例如,几秒钟的录音,我看到:

  • ~6000 samples for the gyro ~6000个样本用于陀螺仪

  • ~5200 samples for the acc ~5200个样本用于acc

  • ~2000 samples for the magnetometer 〜2000个磁力计样品

Assume as well that the activity I am recording affects all sensors at all time and hence I'd expect the onSensorChange function to be called evenly. 假设我正在录制的活动一直影响所有传感器,因此我希望可以均匀地调用onSensorChange函数。 That happens for every other smartphone I tried (5 or 6 different ones). 这种情况发生在我试过的其他智能手机上(5或6个不同的智能手机)。

Any suggestions how come the magnetos mostly seem to not change values as often as the other sensors in order for the onSensorChange to record it? 为了让onSensorChange记录它,为什么磁体大多数似乎不像其他传感器那样经常改变值?

The obvious answer is because of the firmware, but do you have any idea how to mitigate the effect I am seeing? 显而易见的答案是因为固件,但您是否知道如何减轻我所看到的影响?

Thanks folks! 谢谢大家!

This question is really old, but I figured I'd answer it for the community's sake: 这个问题真的很老了,但我想我会为了社区的缘故回答这个问题:

I work as an app developer at a startup that specializes in sensor processing on smartphones. 我是一家专注于智能手机传感器处理的初创公司的应用程序开发人员。 We have a couple 2nd Gen Moto G's and we've found that they do a really bad job of giving uniform sampling rates both for one sensor as well as across sensors. 我们有两个第二代Moto G,我们发现他们在为一个传感器和传感器提供统一的采样率方面做得非常糟糕。

To mitigate the problems, we write a whole row of samples at once with the most recent data, every time we get a sample from the accelerometer. 为了缓解这些问题,我们每次从加速度计中获取样本时,都会使用最新数据一次写出整行样本。 If a new sample hasn't come in on any other sensors since the last accelerometer sample, the same values get printed twice. 如果自上次加速度计样本以来新样本未进入任何其他传感器,则相同的值将被打印两次。

ie.) 即。)

Accel (3-axis) | Gyro (3-axis)
0,0,0|0,0,0
<new accelerometer sample>
1,1,1|0,0,0
<5 gyro samples and 1 accelerometer>
2,2,2|5,5,5
...

Anyways, hope this helps someone! 无论如何,希望这有助于某人!

TLDR; TLDR; The 2nd Gen Moto G has inconsistent sampling rates both for one sensor and across multiple sensors. 第二代Moto G对于一个传感器和多个传感器都具有不一致的采样率。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 加速度计和磁力计的Android Tilt问题 - Android Tilt issue with Accelerometer and Magnetometer Android加速度计和磁力计同时读取 - Android Accelerometer and Magnetometer readings simultaneously 如何在Android中获取原始加速度计和磁力计数据? - How to get raw accelerometer and Magnetometer data in Android? 如何从Android中的加速度计和磁力计中检索位置 - how to retrieve location from accelerometer and magnetometer in android 互补滤波器陀螺加速度计 - Complementary filter Gyro accelerometer 如何从加速度计和磁力计传感器计算android中的旋转矩阵 - How to calculate Rotation Matrix in android from accelerometer and magnetometer sensor 使用加速度计和陀螺仪以及加速度计和磁力计来查找方向有什么区别? - What is the different between using accelerometer&gyroscope and accelerometer&Magnetometer to find the orientation? Android示例-加速度计和APIDemos无法构建 - Android samples - Accelerometer and APIDemos do not build 不同的传感器(磁力计,加速度计)如何工作以制作指南针-Android(Java) - How does different sensor(magnetometer, accelerometer) work to make compass - Android (Java) 完整的运动传感器图表-加速度计,陀螺仪和磁力计 - Meaningfull charts for Motion Sensors - Accelerometer, Gyroscope and Magnetometer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM