我需要制作一个应用程序来找到手机的定位。我想测试的一些用例是
我想我应该能从方位传感器那里得到所有这些。我需要在这里提到,我最近已经开始了andriod的开发,所以我更希望该解决方案假设来自传感器的原始数据,以便以后可以在Matlab中进行处理。事实上,一位同事正在帮助我开发andriod。
我用的是标准的方法。方法:1
if (SensorManager.getRotationMatrix(rotationMatrix, null, accelerationValues, geoMagnetValues)) {
SensorManager.getOrientation(rotationMatrix, orientation);滚动和方位角在-pi到pi的范围内没有问题,但正如Android Compass that can Compensate for Tilt and Pitch所指出的,俯仰在-pi/2到pi/2的范围内,而我在处理这方面有问题。所以我在Android Compass that can Compensate for Tilt and Pitch碰到了代码。我刚用过它,没有屏幕旋转调整。我有一些疑问。Android Compass that can Compensate for Tilt and Pitch中定义的音调与我通过方法得到的不同:1当我向右倾斜手机时,音高值会发生变化,而不应该改变。实际上,它与方法1的滚动值相对应。然而,当我把手机转左时,Android Compass that can Compensate for Tilt and Pitch中的方法给出了滚动值,但有一个不同的符号。方位没问题。最后,m_pitch_axis_radians我完全无法理解。我知道我在解释这个不同的坐标系时遇到了一些问题,但如果我能对方法中的俯仰、滚转和方位角有一个提示:1与Android Compass that can Compensate for Tilt and Pitch中的方法有关,我将感激。
发布于 2014-07-16 10:52:32
如果你想到一架飞机,俯仰是指飞机的机头在水平或水平以下的角度。所以看下面的图片,取决于你是在肖像还是风景中,取决于“鼻子”是长边还是短边。因此,根据设备的方向(即纵向和横向),俯仰和滚动的定义可以切换。

对于m_pitch_axis_radians,Android Compass that can Compensate for Tilt and Pitch中的代码使用的是由方位、俯仰和俯仰轴定义的坐标系,而不是标准的方位、俯仰和滚动。我建议你学习相应的数学文章What's the best 3D angular co-ordinate system for working with smartphone apps。
https://stackoverflow.com/questions/24681350
复制相似问题