5

我的问题类似于在 android 中更改传感器坐标系

无论设备方向如何,我都希望能够相互比较用户的动作。因此,当用户以纵向方向伸出手机并弯曲手臂时,加速度读数与他横向伸出手机然后向同一方向弯曲手臂时的加速度读数相同。

这就是我所说的“用户”坐标系。它与世界坐标系不同,因为用户面对的风向无关紧要。它与设备坐标不同,因为用户如何握住他的设备并不重要。

在我的应用程序中,可以在每次移动之前执行校准步骤,以便确定基础/静止方向矩阵。是否可能只是将第一个运动的矩阵乘以第二个运动的逆矩阵(然后再乘以新值?)

提到的问题中的答案似乎是正确的,但我需要更具体的解释,实际的代码示例将是理想的。

注意 remapCoordinateSystem 是不够的,它只接受直角。我需要能够以小的偏差工作,因为该设备被绑在手腕上,这可能并不总是与手臂成直角。

4

1 回答 1

0

I'm currently working on this issue, and I think this might help: convert device coordinate system to world corrdinate system

We can assume that for the most of the time, people use the phone standing or walking or sitting, which means the user coordinate system share the same z-axis(gravity), and a fixed difference in degree between y-axis (user coordinate, front of user's face) and y-axis(world coordinate, north direction). The difference of degree can be obtained via TYPE_MAGNETIC_FIELD sensor. Thus we can transform from world coordinate to user coordinate.

What's about the user using the phone lying on the bed? I think for that kind of case, a pre-calibration is need by define y-axis of user coordinate, like a movement to tell the phone which direction is the front of user's face.

于 2014-04-24T06:58:32.093 回答