简体   繁体   English

定向点(XYZ +偏航/俯仰/滚动)帧间转换

[英]Oriented point (XYZ+Yaw/Pitch/Roll) frame to frame transform

I have a 3D oriented point (XYZ + Yaw/Pitch/Roll). 我有一个3D定向点(XYZ +偏航/俯仰/滚动)。 Lets say this point is based on "user frame 1" (UF1)(the frame is defined in relation to the world frame (WF)). 可以说这是基于“用户框架1”(UF1)(该框架是相对于世界框架(WF)定义的)。

I also have another "user frame", lets call it "user frame 2" (UF2) that is also defined in reference to the world frame. 我还有另一个“用户框架”,我们称它为“用户框架2”(UF2),它也是参照世界框架定义的。

How would I take my 3d oriented point (6 coordinates; 3 location + 3 rotation) from one frame to another ? 如何将3d定向点(6个坐标; 3个位置+ 3个旋转)从一帧移到另一帧?

For example; 例如; Since all user frame are related to the world frame, How would I calculate (transform) my 3d oriented point from UF1 to WF ? 由于所有用户框架都与世界框架相关,我该如何计算从UF1到WF的3d定向点? Or vice-versa or from any combination ? 或反之亦然或任意组合? (UF1->WF, WF->UF2, etc.) (UF1-> WF,WF-> UF2等)

The resulting point must have the 6 coordinates (3 location + 3 rotation) in relation to the destination frame. 结果点必须相对于目标框架具有6个坐标(3个位置+ 3个旋转)。

PS: I'm mainly working in C#, so if possible code sample or pseudo-code to accomplish this would be appreciated. PS:我主要在C#中工作,因此,如果可能的话,请样例代码或伪代码来完成此工作。

What you are looking for is the transition matrix from one coordinate system to an other. 您正在寻找的是从一个坐标系到另一个坐标系的过渡矩阵。

It is a 4x4 matrix fully determined by the 3 parameters of translation and the 6 angles of ratotion between the 2 coordinate system. 它是一个4x4矩阵,完全由3个平移参数和2个坐标系之间的6个比例角确定。

The 9 coefficients depend on the rotation angles (Euler angles or quaternion depending on what you are using). 这9个系数取决于旋转角度(欧拉角或四元数取决于您所使用的)。 Be aware that if you are using Euler angles, the order is important : a vector of rotation (rx, ry, rz) does not describe the same rotation if you turn around X axis first then Y then Z or if you turn first around Z, then Y then X for example. 请注意,如果您使用的是欧拉角, 则顺序很重要 :如果先绕X轴然后绕Y轴然后绕Z轴,或者先绕Z轴旋转,则旋转向量(rx,ry,rz)不会描述相同的旋转,例如Y然后X。

在此处输入图片说明

I suggest you read this, it will help you compute the matrix: http://brainvoyager.com/bv/doc/UsersGuide/CoordsAndTransforms/SpatialTransformationMatrices.html 我建议您阅读此书,它将帮助您计算矩阵: http : //brainvoyager.com/bv/doc/UsersGuide/CoordsAndTransforms/SpatialTransformationMatrices.html

Note that all this is using homogenous coordinate. 注意,所有这些都是使用同质坐标。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM