磁场旋转矩阵全局坐标 [英] Magnetic Fields, Rotation Matrix And global coordinates

查看:153
本文介绍了磁场旋转矩阵全局坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得我读过所有关于此主题的帖子,但我仍然无法理解的几件事情:

I think that i've read all the posts about this subject, but still i cant understand a few things:

Q1: 为了获得在全球坐标中磁场矢量我需要乘以反转旋转矩阵和磁场矢量,为什么我需要反转旋转矩阵?

Q1: To get the magnetic field vector in global coords i need to multiply the inverted rotation matrix and the magnetic field vector, why do i need to invert the rotation matrix?

Q2: 比方说,我有一个设备,我可以根据沿用getOrientation(...)方法的Z轴的旋转计算方位角。 我可以用旋转矩阵或计算方位角到磁北,无论在手机的态度一些其他的方法? 所以,如果我将旋转手机我和磁北之间的角度将保持不变?

Q2: Lets say that i have a device and i can calculate the azimuth based on the rotation along the Z-axis using getOrientation(...) method. can i use the rotation matrix or some other method to calculate the azimuth to magnetic north regardless to the phone attitude? So if i will rotate the phone the angle between me and the magnetic north will remain the same?

Q3: 当我乘以磁性载体(第四栏是零)与倒置旋转矩阵我得到x是非常接近零。我知道,这是其他职位确定,但我无法理解,为什么?

Q3: When i multiply the magnetic vector(4th col is zero) with the inverted rotation matrix i get that x is very close to zero. i know that this is o.k from other posts but i cant understand why?

Q4: 从理论上讲,可以说,我有位于1米彼此两个设备,是有可能使仅根据其磁场的两个设备的空间位置(全球COORDS)

Q4: In theory, lets say that i have two devices located 1 meter from each other, is it possible to make a spatial position of the two devices based only on their magnetic fields (in global coords)

在先进的感谢。

P.S 我已经阅读这些文章: <一href="http://stackoverflow.com/questions/11772923/how-can-i-get-the-magnetic-field-vector-independent-of-the-device-rotation">Getting在全球坐标系磁场值, <一href="http://stackoverflow.com/questions/11772923/how-can-i-get-the-magnetic-field-vector-independent-of-the-device-rotation">How我可以得到磁场矢量,独立于设备的旋转?

P.S I've already read these posts: Getting magnetic field values in global coordinates, How can I get the magnetic field vector, independent of the device rotation?

<一个href="http://stackoverflow.com/questions/15315129/convert-magnetic-field-x-y-z-values-from-device-into-global-reference-frame">Convert磁场的X,Y,Z值从设备到全球参考帧的

推荐答案

如果你在读我的答案<一href="http://stackoverflow.com/questions/15315129/convert-magnetic-field-x-y-z-values-from-device-into-global-reference-frame">Convert磁场的X,Y,从设备的Z值进入全球参照系你还是不明白。

If you read my answer at Convert magnetic field X, Y, Z values from device into global reference frame You still do not understand it.

A1 。你乘在旋转矩阵磁场矢量的设备坐标系的坐标来获得的磁场矢量坐标世界坐标系。

A1. You multiply the Rotation matrix with the coordinates of the magnetic field vector in device coordinate system to get the coordinates of the magnetic field vector in the world coordinate system.

我要强调的是:上面说的旋转矩阵,而不是反转旋转矩阵

旋转矩阵通过调用获得 getRotationMatrix 是基础矩阵的从设备的基础上向世界基础的变化。是给予任何载体的 v 与设备坐标的坐标系统正,在世界坐标坐标相同的载体系统的 v 可以得到由乘以旋转矩阵与设备系统中的坐标,坐标。

The Rotation matrix obtained by calling getRotationMatrix is the change of basis matrix from the device basis to the world basis. That is given any vector v with coordinates in device coordinate sytem, the coordinates in world coordinate system of the same vector v can be obtained by multiply the rotation matrix with the coordinates in device system coordinate.

反向旋转矩阵是基础矩阵的世界基础设备基础的变化。因此,当你multitply此矩阵与一个坐标,它是作为PTED乘以矩阵在世界的矢量的坐标系的坐标,以获得相同的载体中的设备中的坐标系的坐标间$ P $。因此,如果你乘在反向旋转矩阵磁场矢量坐标作为返回的磁传感器。那么坐标是PTED作为载体在世界坐标系的坐标,从而不要再present在磁场矢量除$ P $所得产品不是在磁场矢量在世界坐标坐标系。实际上它是一个载体在设备中的坐标系的坐标。

The inverted rotation matrix is the change of basis matrix from the world basis to the device basis. Thus when you multitply this matrix with a coordinates, it is interpreted as multiply the matrix with the coordinates of a vector in world coordinate system to obtain the coordinates of the same vector in device coordinate system. Therefore if you multiply the inverted rotation matrix with the coordinates of the magnetic field vector as returned by the magnetic sensor. Then the coordinates is interpreted as the coordinates of a vector in the world coordinate system and thus do not represent the magnetic field vector and the resulting product is not the coordinates of the magnetic field vector in the world coordinates system. Actually it is the coordinates of a vector in device coordinate system.

A2。 getOrientation 才有意义,如果该设备是。对我来说,它只是一堆的角度计算。我在看什么,我试图做的几何,然后使用旋转矩阵来计算我想要什么。例如,计算,这里的后摄像头指明了方向,我把它看作方向的 -z (向量的正交的对着屏幕)。因此,要找到这个方向,我预计 -z 以世界的东 - 北面,然后计算该投影向量之间的角度和<强>北轴。现在,如果你这样想那么该设备的旋转不会改变方向的 -z ,从而在投影向量是一样的,你旋转设备。如果你使用 getOrientation ,那么你必须preCALL remapCoordinateSystem(INR,AXIS_X,AXIS_Z,OUTR) getOrientation 给你的正确的结果

A2. getOrientation is meaningful only if the device is flat. For me it just a bunch of angle calculations. I look at what I try to do geometrically and then use the rotation matrix to calculate what I want. For example, to calculate the direction where the back camera pointed, I look at it as the direction of -z (the opposite of the vector orthogonal to the screen). Thus to find this direction, I projected -z to the world East-North plane and calculate the angle between this projection vector and the North axis. Now if you think this way then rotation of the device will not change the direction of -z, thus the projection vectors are the same as you rotate the device. If you use getOrientation then you have to precall remapCoordinateSystem(inR, AXIS_X, AXIS_Z, outR) for getOrientation to give you the correct result.

A3。 getRotationMatrix 假定的地磁参数是一个向量的坐标,说谎完全是在< STRONG>北天上的飞机。那么任何载体卧在这架飞机必须有 X 坐标等于 0 。这仅仅是基本线性代数。

A3. The getRotationMatrix assumes that the geomagnetic parameter is the coordinates of a vector lying entirely in the North-Sky plane. Well any vector lying in this plane has to have x coordinate equal to 0. This is just basic linear algebra.

A4。答案是否定的。要获得空间位置你必须是前preSS这些载体相对于固定的坐标系。用这些载体的设备坐标系统唯一的坐标,也没有办法,你可以找到一个固定基础,让您计算基础矩阵从设备基础以变更这个固定基础。在2个条件在我的上述需求的链接表示要满足计算基础的变化。

A4. The answer is no. To get the spatial position you have to be to express these vectors relative to a fixed coordinate system. with only coordinates of these vectors in device coordinate system, there is no way you can find a fixed basis that allow you to calculate the change of basis matrix from the device basis to this fixed basis. The 2 conditions stated in my link above need to be satisfied to calculate the change of basis.

这篇关于磁场旋转矩阵全局坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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