Rotation matrices are a powerful tool, and their applications extend beyond robotics to include video
games, development, space exploration, animation, filmmaking and much more.
In this course, we will use rotation matrices to perform, coordinates, change and bring the position
and the orientation of a point from one reference frame to another.
For example, let's consider a point P located at the end of our robot arm.
It has coordinates x, p, y, P and z P in the mobile reference frame, which is the yellow frame that
is rotated and fixed to the robot arm.
Suppose that we are dealing with an obstacle avoidance algorithm for our robot that continuously check
whether any part of the robot is in contact with an obstacle.
We may need to transform the coordinates of the point p into the fixed reference frame, which is the
world frame.
So the one in black to check for collisions between the robot and any potential obstacles.
From the previous lesson, we remember that we can transform any point from one rotated reference frame
to another using a rotation matrix.
This matrix is done by three components, so three elemental rotations around the Z, y and x axis that
are also known as roll pitch and yaw angles.
Therefore, if we know the coordinates of the point P in the mobile reference frame, so the yellow
frame that is attached to the robot which are x, P, y, P and z, P, multiplying them by the rotation
matrix will give us the coordinates of the point P in the fixed reference frame of the world.
Let's use some numerical values to make this example more practical and intuitive.
Let's assume that we know the coordinates of the point P in the mobile reference frame, which are one,
four and two.
We also assume that we know the orientation angles of the mobile reference frames relative to the fixed
reference frame, which are ten degrees, 30 degrees and 20 degrees.
By rewriting the matrix equation with these numerical values.
The rotation matrix is composed of three elemental rotation matrices around the Z axis by 20 degrees.
The Y axis by 30 degrees and the x axis by ten degrees.
And to this we need to multiply the pose of P in the mobile reference frame so the vector one, four
and two.
The result of this matrix multiplication gives us the coordinates of point P in the fixed reference
frame.
In general, a similar calculation can be performed to compute any coordinate transformation between
two reference frame with the same origin but different orientation.