rotation matrix with Euler angles(peter corke 'robotics tool box')

I have some question about different answer from me to professor (I'm student and i just follow professor's source)
My answer is
eul2r(10, 0, 30)
ans=-0.6669 -0.7451 0
0.7451 -0.6669 0
0 0 1.
My professor is
eul2r(10, 0, 30)
ans=0 -0.3420 0.9397
0 0.9397 0.3420
-1 0 0
what's wrong of me... pleae let me know

4 件のコメント

James Tursa
James Tursa 2020 年 3 月 26 日
You need to give us the details about the assignment and show us your code. As it is we have no way of knowing what the problem might be.
SUNGWOON YOON
SUNGWOON YOON 2020 年 3 月 26 日
sorry about that..
I learn about euler angle to use peter corke robot toolbox.
the code is just R=eul2r(10,0,30)
there was no other codes.
but the answer is different for professors and mine.
I thinks my answer is wrong because I solve it with my hand, but it is wrong.
left is prof's answer and right is mine
Ameer Hamza
Ameer Hamza 2020 年 3 月 26 日
As far as I can see, your code and the professor's code are not same
SUNGWOON YOON
SUNGWOON YOON 2020 年 3 月 27 日
Oh... I think I'm out of my mind...
I capture another page... sorry
here is result with same condition.

サインインしてコメントする。

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 3 月 27 日
編集済み: Ameer Hamza 2020 年 3 月 27 日

2 投票

You code is correct. You can also verify your own answer using MATLAB's builtin function. Note that these functions take input in radians.
x1 = eul2r(10, 20, 30);
x2 = eul2rotm([10,20,30], 'ZYZ');
Result:
>> x1
x1 =
-0.5903 -0.2544 -0.7660
0.7948 -0.3488 -0.4967
-0.1408 -0.9020 0.4081
>> x2
x2 =
-0.5903 -0.2544 -0.7660
0.7948 -0.3488 -0.4967
-0.1408 -0.9020 0.4081
You professor is getting that answer, either because he is using an older version of the toolbox which takes input in degrees or he has modified the function definition itself by commenting out the following condition
% optionally convert from degrees
% if opt.deg % <---- maybe the professor commented this condition
d2r = pi/180.0;
phi = phi * d2r;
theta = theta * d2r;
psi = psi * d2r;
% end
You will get his answer if you convert the input from degress to radians
eul2r(deg2rad(10), deg2rad(20), deg2rad(30))
ans =
0.7146 -0.6131 0.3368
0.6337 0.7713 0.0594
-0.2962 0.1710 0.9397

2 件のコメント

SUNGWOON YOON
SUNGWOON YOON 2020 年 3 月 30 日
Oh.. thank you so much
Ameer Hamza
Ameer Hamza 2020 年 3 月 30 日
Glad to be of help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by