Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

ROBOTICS LABSHEET-5

NAME: SAHANA S. ROLL NO.: AM.EN.U4AIE22146

1)Explore the function in Matlab eul2r


R= eul2r(0.1,0.2,0.3)
ANS)
%eulerian angles to rotational matrix
R = eul2r(0.1,0.2,0.3)
disp("Convert eulerian angles to rotaional matrix:")
disp(R)

2)Explore the function in Matlab tr2eul


tr2eul(R)
ANS)
%Convert back to orthogonal angles
angles = tr2eul(R)
disp("Convert back to orthogonal angles:")
disp(angles)
3) Check the orthogonality of R
ANS)
% Calculate R * R'
orthogonality_check = R * R';
rounded_check = round(orthogonality_check, 10);
is_orthogonal = isequal(rounded_check, eye(3));
disp(is_orthogonal);

4)Find R = eul2r(0.1,-0.2,0.3)
Find tr2eul(R)
ANS)
R = eul2r(0.1,-0.2,0.3)
disp("Convert eulerian angles to rotational matrix:")
disp(R)
angles = tr2eul(R)
disp("Convert back to orthogonal angles");
disp(R);

orthogonality_check = R * R';
rounded_check = round(orthogonality_check, 10);
is_orthogonal = isequal(rounded_check, eye(3));
disp(is_orthogonal);
Observation:
The `eul2r` function in MATLAB converts a set of Euler angles into a
rotation matrix \( R \). This matrix \( R \) represents the same
rotation described by the Euler angles. The `tr2eul` function takes the
rotation matrix \( R \) and converts it back into Euler angles. To verify
the orthogonality of \( R \), one checks if \( R \cdot R^T \) equals the
identity matrix \( I \).
An interesting observation is that when one of the Euler angles is
changed to a negative value, the resulting rotation matrix is different.
Furthermore, when using `tr2eul` to convert this new rotation matrix
back into Euler angles, the regenerated angles may not match the
original ones. This discrepancy arises due to the periodic nature of
Euler angles and the fact that the `tr2eul` function restricts its output
to the range from \(-\pi\) to \(\pi\). As a result, different sets of Euler
angles can correspond to the same physical rotation. This means that
although the numerical values of the angles may differ, they still
represent the same orientation in space.

This behavior highlights the nature of Euler angles and their


representation of rotations. Despite the potential differences in angle
values, the physical rotation they describe remains consistent. The
conversion functions `eul2r` and `tr2eul` thus demonstrate both the
versatility and complexity of working with Euler angles and rotation
matrices in 3D space.

You might also like