Android随机传感器值报告

时间:2015-03-25 05:44:50

标签: android android-sensors

我正在尝试分析来自Galaxy Nexus的一堆Android传感器数据,并且我遇到了一些奇怪的模式。例如,磁场传感器的重复值为8,屏幕方向传感器的重复值为255。这些值似乎在我阅读的文档中没有任何特殊意义,但它们反复弹出。任何人都知道为什么?

我包含传感器数据输出的样本,以防任何人想要它,0表示在收听时间段(1分钟)内没有返回数据。每行不同5分钟:

MPU6500 Acceleration Sensor AK09911C Magnetic field Sensor  AK09911C Magnetic Sensor UnCalibrated   MPU6500 Gyroscope Sensor    MPU6500 Uncalibrated Gyroscope Sensor   Barometer Sensor    TMG399X Proximity Sensor    TMG399X RGB Sensor  MPL Rotation Vector MPL Game Rotation Vector    SAMSUNG Step Detector Sensor    SAMSUNG Step Counter Sensor SAMSUNG Significant Motion Sensor   MAX86900    Screen Orientation Sensor   HRM Sensor  Orientation Sensor  Gravity Sensor  Linear Acceleration Sensor
-0.7918822  -1.44   8   -0.0010652645   0   0   0.027657    -0.00831    107.56043   0   0   255 0   0   -0.79049826 0.005798638 344.4021    -0.7916513  0.012937188
-1.6178818  18.66   -1.14   8   8   0   0.028444    -0.008315   0   0   0   255 0   0   -1.6365771  0.04024315  110.17886   -1.6392937  0.029791594
-1.638831   8   8   -2.66E-04   0   0.047552    -0.03045    0   0   0   255 0   0   0   -1.6823589  0.04951334  352.47757   -1.6795416  0.03173232
-1.6753427  -1.08   8   -0.0026631611   0   0.048844    -0.030235   0   1   0   255 0   0   0   -1.7105712  0.07293725  103.25511   -1.7080178  0.043449044
-1.721431   8   8   0.0013315806    0.0013315806    0.044273    -0.03007    0   0   0   255 0   0   0   -1.7184123  0.013740659 358.64462   -1.7213204  0.008867621
-1.7154455  18.72   -1.08   8   0.046393    -0.030042   0   0   0   255 0   0   0   0   -1.7471539  0.020335913 97.08981    -1.7468109  0.036153793
-1.8076223  -1.08   8   -0.0034621095   -0.0034621095   0   0.032184    -0.052209   0   0   0   255 0   0   -1.8572613  0.07178533  9.031282    -1.849128   0.043301344
-1.7962499  -1.08   8   8   -0.051598   -0.050319   1   0   0   255 0   0   0   0   -1.8097965  0.018933535 98.16796    -1.8121501  0.0069220066
-1.7830818  14.4    8   8   0   0   0.031865    -0.051793   0   0   0   0   0   255 -1.8501818  0.051537752 6.3113422   -1.8480959  0.033290982
-1.8968062  -1.02   8   8   0   0.035205    -0.051669   0   0   0   0   255 0   0   -1.9285302  0.06584132  9.900935    -1.9213988  0.02040255
-1.846528   15.06   8   8   0   0   0   88.72001    -0.0386 -1.8738624  255 0   0   0   -1.8782147  0.009540319 13.564674   -1.8787019  0.023794174
-1.2557588  18.6    8   8   0.002130529 -0.056822   -0.059393   0   0   255 0   0   1   0   -1.2829624  0.013437033 99.33356    -1.2816399  0.024684072
-1.2449849  18.6    8   0.014114754 0   0   0   85.962204   0.003289    -0.057907   -1.2985611  0   0   255 -1.2931483  0.042776465 14.364091   -1.2938662  0.037508845
-1.2443863  18.54   -1.26   8   8   0   0   -0.054567   -0.056251   2.5835018   0   0   255 0   -1.2474166  -0.011933446    93.84088    -1.2518827  -0.0062702894
-1.1426327  18.72   8   8   0   -0.052494   -0.056559   1   0   0   255 0   0   0   -1.1527904  0.017340302 6.746513    -1.1546664  0.01502645
-1.1492168  18.6    8   8   0.002396845 0   -0.048156   -0.04867    0   0   255 0   0   0   -1.1757433  0.03131497  99.13985    -1.1777196  0.019524574
-1.4927847  8   -2.66E-04   0   0   0.031505    -0.028662   0   0   255 0   0   1   0   -1.5062454  0.024833083 7.337884    -1.5073864  0.029565454
-1.5041572  18.78   0.005060006 8   8   0   0   -0.023542   -0.027803   5.926271    0   0   255 0   -1.5276097  0.030635118 91.725334   -1.527528   0.038933158
-1.5143325  -1.08   8   8   5.33E-04    0   0   0   0   -0.027872   0.04729855  85.258766   -1.529908   0   255 -1.5293596  0.009041548 -1.5280322  0.033451796
-1.4993688  14.52   8   8   0   -0.023884   -0.026326   0   0   255 0   0   0   0   -1.5211747  0.03198123  93.13916    -1.526189   0.013652086
-0.9816227  18.48   -1.32   8   8   0   0   0   -0.020971   -0.0265 -1.526189   0.5559387   7.78904 255 -1.0139774  0.030559063 85.279945   -1.0111967  0.031968236
-0.9756372  18.6    -1.2    8   8   0   0   -0.006156   -0.011322   0   0   255 0   1   -0.9895226  -0.0034725666   11.263685   -0.9939272  0.0069175363
-0.9923966  18.54   8   8   -0.0037284256   0   -0.010102   -0.010804   0   0   0   0   255 0   -1.011731   0.015144587 95.325294   -1.0129408  0.02712822
-0.7445967  0.12    8   8   0   -0.007972   -0.010841   0   0   255 0   0   0   0   -0.76289475 0.030269027 99.85943    -0.7639039  0.028285444
-0.18794483 19.62   -0.18   8   0   0   0.029863    0.031101    0   0   255 0   0   0   -0.19251534 0.0069647133    22.254642   -0.19720303 0.021827757

1 个答案:

答案 0 :(得分:0)

使用我的三星Galaxy S5(G900I)时,屏幕方向传感器会在设备方向已知时返回设备在[0,3](含)范围内的方向。当方向不确定时,它返回255.

例如,如果设备的正面或背面是平的,则传感器会报告255.同样,如果设备位于两个方向(纵向和横向)之间,传感器会报告255.

这完全基于我自己的观察而不是文档,因为屏幕方向传感器似乎不是标准的。 (我不记得在Android开发者文档中看到过对这个传感器的任何引用,并且SDK似乎也没有引用它。)