Any ideas ?
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
How to find the transformation matrix for a plat knowing the old and new coordinates of 3 points on it ?
12 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
Matt J
2019 年 6 月 14 日
You could use this FEX file
38 件のコメント
farzad
2019 年 6 月 17 日
Thank you very much
just a question about calling the function, should I nest this in my code, or I can call the function when it is in a separate file ?
and in the second case , how do I do that ?
Matt J
2019 年 6 月 17 日
You can call absor like any Matlab command. You can also obtain usage instructions using help or doc like in any Matlab command
>> doc absor
farzad
2019 年 6 月 17 日
Thank you , that was written also in the code.
and one thing : I needed to have the angles with the axes of reference system.
for 2D problems it gives
regParams.theta
is there something equivalent for 3D I could get from this code ?
Matt J
2019 年 6 月 17 日
Attached are some functions for decomposing a 3x3 rotation matrix into angles in various ways.
farzad
2019 年 6 月 27 日
Thank you !
is the following correct ?
rotm= regParams.R;
eulZYX = rotm2eul(rotm);
farzad
2019 年 6 月 27 日
I assumed that if I have a plate with 3 known points on it, and I have the initial and final position of them in a movement of the plate , I could know the angles of the normal of the plate with principal axes
Matt J
2019 年 6 月 27 日
You are welcome, but please accept-click the answer if it was what you were looking for.
The ~ tells Matlab that an ouput argument will not be used and that it need not assign it to any output variable.
farzad
2019 年 6 月 28 日
and another doubt :
if the initial vector is like [0,0,1] , then is the regParams.R gives the angles in the same order ?
XYZ ?
farzad
2019 年 6 月 28 日
also one thing , how do i force the angle results be smaller than 90° starting from 0 ° ?
Matt J
2019 年 6 月 28 日
By positioning the plate appropriately. Make sure that the normal to the plate makes the angles with the principal axes that you want.
farzad
2019 年 7 月 1 日
just one doubt :
should the point1 be a one row or one column matrix ?
P=[point1(:),point2(:),point3(:)].';
farzad
2019 年 7 月 1 日
Thank you , still sorry for the question : is the result of eulZYX in Radians or degrees ?
Jan
2019 年 7 月 2 日
@farzad: Do not assume, that the users of the forum have installed the same 3rd party tools or Matlab toolboxes as you have. Check the location of the functions by which . If it is not included in the standard toolboxes, post a link to the documentation or source of the function.
By the way: A simple test reveals, what the output is.
farzad
2019 年 9 月 20 日
Ok . I tried for this triangle, and it does not work !!
A1= [10 -70 0; 60 30 0; -40 50 0]
A2= [10 -61.812 -22.498; 60 26.491 9.642; -40 44.151 16.07]
these are the coordinates of a triangle that has rotated around the X axis for 20° , with no rotation around the other axes. the triangle is in XY plane by the way.
so when I use absor, I get :
>> Alfa= eulZYX(1)
Alfa =
-0.0371
>> Beta= eulZYX(2)
Beta =
-0.0198
>> gamma=eulZYX(3)
gamma =
-0.0345
farzad
2019 年 9 月 20 日
@Mat J
shall you please explain me kindly , why did you use this new way ? and why the previous suggestion was not working ?
Matt J
2019 年 9 月 20 日
I have not proposed anything different than before. I gave you the function rot2taitbryan back on Jun 17,
farzad
2019 年 9 月 20 日
ok, then what is the difference of this decomposition with the above ?
rotm= regParams.R;
eulZYX = rotm2eul(rotm);
farzad
2019 年 10 月 20 日
@Matt J Hi Mat. reading Wikipedia, I still have doubt about the roll angle.
cause what I need as Roll , is the rotation around the original X axis, Yaw , the rotation around the original Z axis, and pitch: the rotaion around the original Y axis
all of the Euler methods give the rotation around a new axis at some point
Matt J
2019 年 10 月 20 日
cause what I need as Roll , is the rotation around the original X axis, Yaw , the rotation around the original Z axis, and pitch: the rotaion around the original Y axis
That is what rot2taitbryan gives you.
farzad
2019 年 10 月 20 日
Thank you, exactly the script you wrote in the comments above? Intrinsic and extrinsic confuse me
There are six possibilities of choosing the rotation axes for Tait–Bryan angles. The six possible sequences are:
x-y′-z″ (intrinsic rotations) or z-y-x (extrinsic rotations) y-z′-x″ (intrinsic rotations) or x-z-y (extrinsic rotations) z-x'-y″ (intrinsic rotations) or y-x-z (extrinsic rotations) x-z′-y″ (intrinsic rotations) or y-z-x (extrinsic rotations) z-y′-x″ (intrinsic rotations) or x-y-z (extrinsic rotations): the intrinsic rotations are known as: yaw, pitch and roll y-x′-z″ (intrinsic rotations) or z-x-y (extrinsic rotations)
farzad
2019 年 10 月 20 日
@Mat J how does this code recognize what was the order of the rotations applied?
Cause the stste of a plane is different if you apply Rx first then Ry, then Rz With the case that you first apply Rz, then Rx and then Ry
Matt J
2019 年 10 月 21 日
As mentioned in the help doc, the code only does extrinsic rotations and the order of the rotations is specified by the second input argument:
>> help rot2taitbryan
Calculates extrinsic Tait-Bryan angles from rotation matrix
ang = rot2taitbryan(R,order)
* `R`: Rotation matrix (3x3)
* `order`: Order of angles to return; any of:
{'XYZ','XZY','YXZ','YZX','ZYX','ZXY'} %case insensitive
* `ANG`: Angles (degrees) in specified order
NOTE: order of application of these rotations is right-to-left, both as
indicated by `order` and `ANG'. So, as an example,
>> R=Rz(30)*Ry(20)*Rx(60)
R =
0.8138 0.0065 0.5811
0.4698 0.5811 -0.6645
-0.3420 0.8138 0.4698
>> rot2taitbryan(R,'zyx')
ans =
30.0000 20.0000 60.0000
farzad
2019 年 11 月 5 日
Dear Matt : thank you for the above answer : but what if I don't know the order of rotation ?? this command asks for the order actually
second question : Does Absor.m give me the rotation matrix ? how can I get it ?
Matt J
2019 年 11 月 5 日
but what if I don't know the order of rotation
The order is something you choose not something you determine. All 6 decompositions are equivalent - it just depends on your preference.
Does Absor.m give me the rotation matrix
Yes, it is in the regParams.R output.
その他の回答 (1 件)
Jan
2019 年 6 月 27 日
You can define the motion by a translation of the center of the 3 points and a rotation of the local coordinate system.
PointsA = [x1, y1, z1; ...
x2, y2, z2; ...
x3, y3, z3];
PointsB = ...
Translation = mean(PointsB, 1) - mean(PointsA, 1);
% For the local coordinate systems find an orthonormal tripod:
v1 = PointsA(1, :) - PointsA(2, :);
n1 = v1 ./ norm(v1);
v2 = PointsA(2, :) - PointsA(3, :);
n2 = v2 ./ norm(v2);
c2 = cross(n1, n2);
n12 = c2 ./ norm(c2);
CoorA = [n1, n12, cross(n1, n12)];
% The same for B...
Rotation = CoorA * CoorB'
Anotehr approach would be the "Helical Axis": Any motion can be defined by an axis and some rotation around it and translation along it. See http://www.kwon3d.com/theory/jkinem/helical.html
4 件のコメント
farzad
2019 年 6 月 27 日
thank you
my main question is the rotations. I was using something similar to your suggestion, but it was giving not satisfying results.
so you are saying that using absor and rcParams.R is not a good idea ?
Matt J
2019 年 6 月 27 日
so you are saying that using absor and rcParams.R is not a good idea ?
Jan's approach will be sub-optimal if you have non-neglible measurement errors in A and B. Also, if you decide to use more than 3 points (for data redundancy), absor will better accommodate that case.
Jan
2019 年 6 月 28 日
@farzad: Of course I did not say that "using adsor is not a good idea". Especially if you have more than 3 points on a rigid body, an optimization appraoch is the correct approach.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)