2. Write a MATLAB program that takes a rotation matrix as its input, and produce
ID: 3888870 • Letter: 2
Question
2. Write a MATLAB program that takes a rotation matrix as its input, and produces the corresponding roll, pitch and yaw angles as its output. Your program should perform a check on input to make sure that it is a rotation matrix and it is able to handle all cases. Test your program with the following four rotation matrices:
RPY angles 2. Write a MATLAB program that takes a rotation matrix as its input, and produces the corresponding roll, pitch and yaw angles as its output. Your program should perform a check on input to make sure that it is a rotation matrix and it is able to handle all cases. Test your program with the following four rotation matrices: 0.933 0.067 0.354 R10.067 0.933-0.354 0.354 0.354 0.866 0.000 0.966 0.259 R2 =10.000 0.259-0.966 1-1 0.000 0.000 0.933 0.167 0.354 R30.067 0.933 -0.354 -0.354 0.354 0.866 0.000 0.866 0.259 R40.000 0.259 -0.966 1.000 0.428 0.000Explanation / Answer
if((det(a)!=1) && (a*transpose(a)!=eye(3)) && (transpose(a)*a!=eye(3)) %check if a is not
%rotational matrix. Det(A) should be one, A*AT and AT*A should be an identity matrix
disp("Invalid rotation matrix"); %display if its an invalid rotational matrix
else
disp("Roll Pitch and Yaw:");
disp(eul); %display the roll,pitch and yaw as calculated
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.