WEBVTT

00:00.300 --> 00:06.900
This brief digression into the mathematics that allows us to perform coordinate transformation between

00:06.900 --> 00:11.550
two reference frames has provided us with some very powerful tools.

00:11.580 --> 00:14.910
As we approach solving much more complex problems.

00:15.670 --> 00:22.540
The first one of these problem is how do I find how do I calculate the position of the robot gripper

00:22.540 --> 00:28.690
in the three dimensional space, knowing the angle so the position of each joint of the robot.

00:29.590 --> 00:34.780
The mathematics that is used to answer this question is called forward Kinematics.

00:35.590 --> 00:41.500
The second question we asked ourselves was how do I calculate the angle of each joint of the robot that

00:41.500 --> 00:44.680
has brought the gripper to its current position in space?

00:44.680 --> 00:50.710
Or how do I calculate the angles of the joints if I know the position and the orientation of the gripper

00:50.710 --> 00:51.550
in the space?

00:52.270 --> 00:53.140
The mathematics.

00:53.140 --> 00:53.650
Instead.

00:53.650 --> 00:57.340
That answer this question is called inverse kinematics.

00:57.670 --> 01:01.720
Let's see how to express and solve the first of these two problems.

01:01.720 --> 01:03.550
So the forward kinematics.

01:04.770 --> 01:08.160
Let's start by considering the architecture of our robot.

01:08.640 --> 01:15.270
As we know, it has three degrees of freedom, so it has three movable joints driven by three motors

01:15.270 --> 01:18.510
that allows us to move the robot's gripper in space.

01:19.020 --> 01:24.750
We need to focus on their movement and orientation to solve the forward kinematic problem.

01:25.640 --> 01:32.240
Let's consider a simplified version but still accurate representation of our robot architecture consisting

01:32.240 --> 01:38.810
of three cylinders representing the three rotational joints of the robot, connected by three links

01:38.810 --> 01:40.340
representing its arms.

01:40.940 --> 01:47.480
The problem of forward kinematics is nothing more than a different form of representing the same problem

01:47.480 --> 01:50.690
we have already faced and solved in previous lessons.

01:50.720 --> 01:57.470
That is, how do I express the position and the orientation of our reference frame with respect to one

01:57.470 --> 02:02.090
other after it has arbitrarily rotated and translated?

02:02.980 --> 02:09.940
Therefore, we define two reference frames, one that is fixed and is called word frame, which we call

02:09.970 --> 02:16.540
W in short, and the other one that is mobile and is attached to the robots and the link.

02:16.540 --> 02:24.220
So located at the gripper which we call R and which moves along with the robot gripper by rotating and

02:24.220 --> 02:27.790
translating as the angle of each joint of the robot change.

02:28.700 --> 02:34.670
The goal of the forward kinematics is to know at every moment in time the position of the reference

02:34.670 --> 02:35.120
frame.

02:35.120 --> 02:38.420
R with the respect to the reference frame W.

02:39.410 --> 02:45.500
In fact, since the reference frame R is connected to the robot's gripper and moves along with it.

02:45.530 --> 02:51.650
This implicitly means knowing at every moment in time the position and the orientation of the robot's

02:51.680 --> 02:53.060
gripper in the world.

02:54.160 --> 02:54.880
Correct.

02:55.120 --> 03:01.630
To solve the forward kinematics problem, it is enough to calculate a transformation matrix precisely

03:01.630 --> 03:07.600
the one that expresses how the reference frame, W and R are connected to each other.

03:08.360 --> 03:14.280
However, be aware that this calculation is not trivial, as it depends on three variables.

03:14.300 --> 03:17.540
The three angles of the three joints of the robot.

03:17.960 --> 03:24.110
A change in the position of any of these three joints affect the position and the orientation of the

03:24.110 --> 03:26.760
gripper and therefore of the reference frame.

03:26.780 --> 03:30.470
Ah, and so this change the transformation matrix.

03:31.600 --> 03:37.810
As always when dealing with a very complex problem, Let's try to break it down into many smaller and

03:37.810 --> 03:39.790
more easily solvable problems.

03:40.410 --> 03:44.580
We associate our reference frame to each movable joint.

03:45.030 --> 03:51.000
Although the position and the orientation of this intermediate reference frame are arbitrary, there

03:51.000 --> 03:57.420
are robotics convention, such as the Dynamic Artwork convention that allows us to arrange these frames

03:57.420 --> 04:00.990
in a way that minimize and facilitate calculations.

04:01.290 --> 04:08.370
In general, we position each reference frame so that it is translated and can rotate relative to the

04:08.370 --> 04:11.400
previous reference frame only around one axis.

04:11.640 --> 04:19.110
For example, in this case the frame too can rotate relative to the frame one only around the z axis

04:19.110 --> 04:24.180
and does this when the first rotational joint of the robot said one at the base rotates.

04:24.820 --> 04:31.030
If you recall from theoretical lesson on rotation matrices, this is a very useful result because we

04:31.030 --> 04:38.620
can easily determine the rotation matrix between the frames two and one using just an elementary rotation

04:38.620 --> 04:43.600
matrix around the Z axis that depends only on a single variable.

04:43.600 --> 04:49.420
So on a single angle that is namely the position of the joint at the base of the robot.

04:50.270 --> 04:56.720
At this point, it becomes very easy for us to calculate the intermediate transformation matrices between

04:56.720 --> 04:58.700
each of these reference frames.

04:58.850 --> 05:04.850
They will be composed of a certain translation vector that depends on the physical dimension of the

05:04.850 --> 05:11.900
robots links and ascertained rotation matrix that depends on the rotation angle of each of the movable

05:11.900 --> 05:12.590
joints.

05:13.130 --> 05:20.120
By simplifying the forward kinematics problem, we now only need to calculate four simple and elementary

05:20.120 --> 05:26.660
intermediate transformation matrices instead of dealing with a single complex transformation matrix.

05:28.110 --> 05:31.160
We just need to compose these transformation matrices.

05:31.170 --> 05:37.590
That is, we just need to multiply them to calculate the overall transformation matrix that connects

05:37.590 --> 05:41.870
the word reference frame to the gripper reference frame of the robot.

05:41.880 --> 05:46.410
And this is the matrix that solves the forward kinematic problem.

05:47.440 --> 05:51.220
When composing transformation matrices and calculating their product.

05:51.250 --> 05:55.840
Be aware of one thing The order of the multiplication is crucial.

05:56.530 --> 06:02.410
The transformation matrices must be composed and multiplied in the order that follows the entire chain

06:02.440 --> 06:03.700
of transformation.

06:03.700 --> 06:09.010
So the one that connects the initial frame to the final one in the order they appear.

06:09.850 --> 06:13.360
To better understand why the order of multiplication is crucial.

06:13.390 --> 06:15.430
Let's do a small example.

06:16.450 --> 06:23.770
Let's assume that we have a parallelepiped in a three dimensional reference frame and we apply two successive

06:23.800 --> 06:25.090
transformation to it.

06:25.390 --> 06:33.430
First, we rotate it by 90 degrees around its Z axis, and then we rotate it by another 90 degrees this

06:33.430 --> 06:35.620
time around the Y axis.

06:36.160 --> 06:38.980
Now let's perform the same transformation.

06:38.980 --> 06:45.580
So the same operation with the same parallelepiped in the same initial configuration simply by reversing

06:45.580 --> 06:47.310
the order of rotations.

06:47.320 --> 06:54.760
So first we rotate the parallelepiped 90 degrees around the y axis and then we rotate it around the

06:54.760 --> 06:57.160
Z axis by another 90 degrees.

06:57.640 --> 07:04.870
As you can see, even though we started with the same initial configuration and rotated both parallelepipeds

07:04.870 --> 07:11.410
by the same angle around the same axis, the result and therefore the final configuration of the parallelepiped

07:11.440 --> 07:12.490
is different.

07:13.150 --> 07:16.450
Keep this in mind when composing transformation matrices.
