Well, gay people, I have decided to do a small project, OK, which is which I think which will be
fun to do in order to understand forward kinematics more better and also put them into practice.
And also how useful is for the kinematics shirtless for candidates will be much more useful than that.
But it is, I think, is a pretty example to do.
Pretty interesting project anyway.
No need to do to speak up on this early and start to see what we will do.
We will try to create our robot simulator.
OK, but not the sophisticated one.
So it will be just this stick.
You know, there is some people can grow human rather can draw just stick humans.
Yeah, like very simple and we will do exactly the same.
We will not simulate robot, but we will try to simulate stick robot attempts.
I mean, in this way, you can see to stick robots.
Yes.
So how do will do that?
So our purpose is to create stick robots simulator.
OK.
This is our purpose.
So what we have to do this one, I will say the steps to you.
OK, so then we will see exactly how to this has been implemented in the code.
OK.
First, we have to write joint centers with respect to base frame.
Why?
So in order to plot them, yes.
Because as you can see what are drawn centers, these are the joint centers.
This is this is this is the joint center.
This is the joint center.
And this is the joint center.
And this is a joint center.
OK?
These are the joint centers.
Yeah, this is not joint about this and the factor center, OK?
And we will try to write them with respect to base frame.
Base frame is which one base frame is this one?
OK?
With respect to base frame, why?
In order to be able to put them in mutlak.
OK.
So when we try to plot them in three dimension, we will just give them plot and like X coordinates
XCOR and let's include this X coordinate, you know, include not only one x comunemente x coordinate
for first center x one x two x three four x five OK and x six pull x coordinate of these centers.
We will plot them.
We will write y coordinate.
This will be y one again up to the the the device six and Z coordinate, which will also be Z one to
the Z six.
OK.
So what will then not we'll do what?
What will we take all these points and it will just it will just connect them with each other.
So if the points are like that, OK, let's see in 3D space one two, three four, five and again six.
Now let me do it in this way.
OK, up, up up.
Excuse me like that.
Like that, like that.
Like that and like that, OK?
And this will be our end affected here.
Then if we, for example, say, OK, if we change the angle, Tatooine or for example, here, let's
change.
For example, it change this angle.
Peter, I don't know.
Four or 03:52 then the position of points surely will change if, for example, they will be like that,
like that, like that, like that, for example.
And then we can connect and get another robot configuration.
So we have to first be right.
These joint centers with respect to the base frame so club can plot them OK easily.
So however, in order to obtain these, I mean the center, the points of how, how we will provide
them with respect to the base frame.
First, we will write them in joint centers with respect to their own frame because it's easier for
us to see because we know the link lengths.
Yes, we know this is L1, this is L2.
Yes, we know this.
This is L3, OK, this is L4 or killed four and five and L six.
OK, we know this and this is L6, so we can.
Right, all these center points with respect to each frame is because it will be very easy.
For example, it's still for the first one.
What will be the center points for this center point coordinate?
OK.
With respect, it's on frame zero.
Surely it will be zero zero zero.
OK.
Because it's a concern.
It's frame.
And what's going to happen for the second one?
Surely it will also be zero zero zero?
Yes.
What will happen for the soon?
Also, the center coincides with its own fair frame.
It will be zero zero zero.
And what will happen?
OK, let me say that one.
First, we have to assign surely the coordinate frames based on the date frame assignment.
I have done this lot to explain this to you.
You have to know this already.
So you can practice.
Also, I will give this to you that you see that and you can try to validate it that that this is correct.
OK.
So what I will say, I was saying yes.
What about for the for this joint?
OK?
This is an interesting it's simple point is here is you can see this is the center point hole.
Where is its frame?
Its frame is here.
So there is an offset and offset is in which direction is in three direction.
Perfect, then it will be zero zero in the tree direction.
But we will ride.
The offset is illusory, so it will be illusory.
OK, perfect.
So what about this frame for this?
What about for this joint?
This joint center coincides with its frame, so it will be zero zero zero.
What about this joint?
Its center is here, but where is its frame?
Its frame is these five and it is here.
There is an offset.
Yes, between its center and its own frame.
And how much is that?
It is L5 amount.
So we will ride zero zero l five amount.
OK, that's perfect.
And for the last one, the last one, for the last one, for the end effector, OK, its frame and center
to coincide.
So it will be zero zero zero.
Yes.
Perfect.
So no, these are nothing.
But let me write for, for example, this is p one one.
OK, p one one.
Because it's on, it's it's on its own three year.
This is P so.
Second point with its own frame.
Second frame.
Yes, indeed.
Let me just not p one one, but p zero zero zero zero.
This is one one.
This is P2 or two.
This is P three three.
Yes, P 44 P five five PS six six.
However, in order to draw, we cannot use these coordinates right?
You cannot use these coordinates because think about that as you can see, if you're right with respect
to its own frame, even the robot moves, the joints will move and they, as their own frame is, stick
in a hard way to it's joined.
The joint joints will move with their frame with their frame.
Yes.
So if with the right points, with respect to their frame, then these coordinates will not change even
if the robot moves.
Yes.
Think about it in this way.
OK, this is our joint.
This is our second joint.
Yes, there is a frame here and there is a frame here.
This is these frames.
Stick to these joints, OK, in a hard way, so it will move with their joint.
OK.
So you might descend to the point of these coordinates, the center point coordinates with respect to
this frame and for this joint, you will right with the expected this frame, which will happen either
after this moves into one, for example, it became like that, OK, it became like that in this way.
OK.
And this joint is here.
OK.
How will be the frames?
Again, the frames will be in the same way, OK, because they stick to their.
They stick to their joints.
OK?
In the hallway.
So they move with respect to them.
Moving with them with joints.
OK.
So if you try to again express the joint center with respect to its own frame, the curtains will look
change.
OK?
Because the joints moved with their own frames.
OK, so we have.
But they will change.
When, if we would, if.
Express these center points with respect to the base frame, because these frames will change their
orientation or position with respect to base frame at each motion.
OK.
So that's why we have to express them in base frame.
OK.
Harvey will do that then.
OK.
We will just have to multiply these points.
We have to take these points, for example, and multiply it with what age six zero times p zero zero
in order to obtain what piece six zero?
Did you see that we fund and the fact that a position with respect to the base frame?
We can do the same for this one Page Six one times p one firm.
OK, one one cause we get we got word piece six one.
That's perfect.
OK.
As you can see, we have to calculate these at each iteration in order to to be able to express them.
OK.
That's perfect.
Then what we have to do?
Okay.
So that this is for the oh, excuse me.
OK.
We understood how people express OK and why we have the express with respect to the base frame.
And also consider that this one if, for example, we have to calculate so the motion of this joint,
OK, for example, this joint, let's take this joint again.
The motion of this joint will affect the joints.
It will this affect the base joint?
Surely not because it is not after this joint, but before this joint.
So if this joint moves, it will not affect the joints or leanings before itself.
It will affect only the ones after itself.
So that's why we have to update homogeneous transformation mattress.
If, for example, moving this joint, we have to update only the ones after to it, not the ones before
it's OK.
But also consider this in your mind.
Perfect.
I will make it in this way so you can see everything.
As you can see, this is nothing but our the edge table.
You can again verify that it is correct for yourself.
OK.
Um, so and then one last thing to explain to you.
So you will understand in the code how we will draw.
Let me show you how we will draw the end effector, OK, in the fact that it is easy indeed in order
to drive it.
So in order to drive this shape, how we will drive it, how we will plot in MATLAB.
So what we are doing for this one in order to do this one, I wrote it here.
Also here first, we have to choose an offset.
What does it mean by the offset?
Is this one, for example, how much do you want this offset to be here?
For example, this is all offset.
This is our offset.
OK, offset.
OK.
And this is our offset, and this is our offset.
Why this is called offset, I will show it because this is our end effector center.
Yes, this is the center point.
This is this point.
OK, we know this, OK.
We know it's card in it.
This is nothing but P6.
Zero.
OK.
So if we want to calculate it.
So in order to plot this, we can create four different points.
Let's call these points C.
Let's call this point a let's call this point B, and let's call this point.
Now we can put this in MATLAB.
By using this, we applaud a b.
Yes, this will draw this line.
Then we will do a plot, a c it.
This will draw this line and we will see plot b d, which we applaud this line.
Yes, that's perfect.
So how we will calculate a c b d, it's indeed very easy.
What is there?
Let's first try to express the a point with respect to their sixth frame, OK, its own frame.
So in order to find it, let's write it over the right.
It was offset.
Offset A.
OK.
With respect to which?
Six.
OK.
So in this one, six is enough.
I think, OK, we write it into its own frame.
I mean, the frame of the last point, OK?
Six.
So let's do that.
Let's do that.
How people write this.
If you can see a e um doesn't move in the direct.
OK.
Look at that, look at that.
It is here it moves only in which direction in the direction you're from, right, Andrew.
You can move the direction of why.
Let me throw it for you at the direction of why it is in this way.
Why?
Six You can know it from what?
By using right hand.
OK, as you can see a move upward, which is opposite to devise six.
Which is negative right now.
How much it moves as an offset?
OK, but it doesn't move in the direction of X, or does it?
So what will be its coordinate with respect to the last?
It doesn't move in X.
It did move in as offset on Y, but minus offset.
But it also didn't move in it.
OK.
We can ride for B.
Also, let's check what's b how much be moved.
As you can see, b move to exactly opposite to their A..
It also didn't move in exit, but it moved in positive y direction as an offset amount a offset and
zero, excuse me, zero offset and zero.
What will be about C.
OK?
What about C about C?
You can see it both moved in upward, which is in negative y direction.
And also it moved in the direction of Z six.
How much as an offset again.
OK.
So what we've tried for X is zero, but for in the direction of why it's minus offset in the direction
of is it?
It is offset.
We can ride the same for D, which is the exact opposite of this one.
It moved as an offset to the double.
OK.
As you can see, the first move like that then moved like that.
Both of them are offset among offset amount down in the bi directional offset amount in this positive
Za'atari action.
OK, we have found these points also.
But again, these are with respect to this sixth frame.
So if the robot moves as the last joint will move it its own frame, these cardinals really don't change,
so we have to take into account updates.
We will take this into account by expressing all of these offsets with respect to base frame so that
we will just do this will just take Page Six zero and multiply it with a six.
We will get, excuse me, offset.
OK.
A in zero.
OK.
As you can see now, we can plotted OK.
And now we will take into account the motion of all the joints.
OK.
All these joints will affect the robot manipulator because we take each six zero, which include all
of these points, homogeneous corners of transformation.
We will do the same for this one.
We will do the same for this one and for this one, and we'll just plop them.
And this is the stick simulation of our robot and I make it in this way so you can clearly see everything
from this.
OK.
This is like that.
Let me just put it in this way.
This our robot.
This is our, um uh, homogeneous transfer.
Excuse me, say that the H matrix and this is for the end effector.
OK, no.
I think result we have almost we lose time in way, but we can go to the MATLAB and to see what's happening.
This is our muscle, of course.
So we will use.
Let me see.
We will use what we will use at designers.
OK.
Um, designers, um, for my club, how you can get up designer just right here up designer, designer
and press enter.
You will get up.
Designer, OK, you will get this design view.
Just take and access and put it here.
Drag and drop.
OK.
If you work this, we programming.
OK.
You have to know this.
OK.
Because it's very easy and it's very easy.
Grip programming is at least dragging and dropping section is easy.
Yeah, and you just it.
And then you have to take a slider here, as you can see where it's like, OK, this slider and put
them all here.
OK?
Slide them.
Now, after doing this one, you can go to the code section.
This will be automatically created.
This great sections are automatically created and you cannot change them.
The MATLAB doesn't allow for this one in the way of the blah blah.
Let's go to the code and see what we will do.
First, we will add some, uh, some.
Callbacks, OK, let me make it OK, I can make it bigger, OK, let me make it bigger for you, OK?
We will add callbacks.
What are callbacks?
Callbacks is this one, for example, you tried to take this slider zero and slide it to its slider.
OK?
How you will know that this changed.
OK?
You want to grab this change and read the slide there as well?
You will be.
You will do this using sliders.
So you just come to the code view.
You choose your slider from here.
OK, competent browser Cube zero slider.
You come, you just right click OK and callbacks.
And there you are, adding go, you are adding here's shows go to about a because I have already added,
but you will see add value changing, not value changed because you want to have a callback while the
value is changing in order to change the robot in real time manner.
OK, go to zero slider changing.
You will have add value changing callback OK, and add this for each of these joints in for each of
these sliders of these sliders will control the joint of the robot manipulator.
OK, joins a little bit manipulated.
So and in each slider value changing callback what we will do even read the value of the slider.
OK, then the four in each of them, and we will then draw our robot.
OK.
Because we have changed joined, we have to update the plot of the robot.
We will draw robot again and again.
The robot takes what function drone robot takes for.
First of all, the joint value because we changed and get new joint value.
I am sorry and we then pass from which, no, the joint, which joint changed.
But we know this half by looking at, for example, choose zero controls the first joint.
Yes.
So if it changes cues zero slider change, then we know that joint one is change.
So the pass, it's no this will help us in order to do some calculations, OK?
As you can see, we are doing the same for each of this slider.
OK, now let's see.
What's our draw robot function?
OK?
This is our start-up function, OK?
We will seat, as you can see.
Let me explain this one for an example.
This is in order to put the limits for the to put the limits for the robot manipulator.
OK.
Excuse me for this slide.
This, you know, because it has to change between what a minus p or p or minus two p i.
Just say that because its angle OK generally change from minus P2P.
So we we can put only the integer for the slide that it limits.
So I put minus three.
OK.
In order to be as much, you know, how can I say as much?
Uh, close to a pi lets.
You can do also.
You can do a minus four to four, but not eat to the minus three point minus PI two Pi.
OK?
By mapping, you can do this.
But I didn't do that because I want to do that just simply to withdraw the robot.
The other things are just accessories, and you can do it by yourself.
It's very easy to do these kind of things.
OK?
You can even look for the limits of the robot on the blade rocket, for example, I didn't take into
account the limits of the joint.
I just write minus pipeline.
OK, you can move it if it's minus Pi Pi, the robot, the manipulator, even though it's links or joints
are cold anyway.
Um, we we change it in this way.
OK.
And then we just put the limits for the axis OK x limited by the Medsafe limit for our this graph.
OK.
Then what we are doing?
OK, let's go to the code section, which is Draw Robot.
OK.
OK, let me just show you this one.
Also, this is this is link lengths, OK?
We have seen for the robot manipulator this link lengths.
You can change link legs here, OK?
These are emitters.
OK, just put arbitrary numbers.
Don't judge me because of this, then this is nothing.
But these are initial values for our, um, joint centers.
OK?
I mean, these are our joint centers.
As we have said before, these are our joints.
With respect to its own flame, OK, we have seen this.
These are the joint centers with respect to their own reference frame.
This will, however, this will take this will.
This P will stop the joint values with respect, not with respect to its own frame, but each joint
center calls with respect to the base frame.
But first, I will make it equal to the be equal to this one, but we will update it.
Yes.
Okay.
This is our homogeneous transformation mattresses, OK?
This is a four by four because homogeneous transformation matrix is four by four and four six because
for each of the joints.
OK.
It will hold a homogeneous transformation between two subsequent.
OK.
Be careful between two subsequent frames, not between the base frame and the given frame.
OK.
And this is all your did node heartwarming parameter table.
OK, well then what we are doing, we have to first.
At the first time, we have to draw.
Um, we have to draw the robot moments later.
Yes.
At initial time versus startup, we have to draw the robot because if you don't draw, then we will
see the robot.
We will throw the robot on the after moving the slide sliders.
And we don't want this, OK?
We have to we want to know the robot in initial position first, OK?
And we are doing what in order to do that we are, we have to create a homogeneous transformation.
Methodists, we send it there.
This is nothing.
This is this is abbreviated since OK.
I will not go deep into this one.
But if you know C++ because the here classes are used, you know you have to know this easily.
OK.
These are language related things.
So I have a lot go into these details.
OK, your vpas.
First of all the teacher angle, I will assume the teacher angle at zero, OK, because at first we
are zero.
OK?
The slider will be in zero position, so it will read zero.
Then we I have said I send a D and I four parameters in order to calculate homogeneous transformation
matrix for each of the joints, and I stored the tommasini homogeneous transformation mattresses.
OK, then I'm doing what I'm doing just after I have initialized this adjacency mattresses, I draw
my robot manipulator.
Don't I just say zero here?
Zero, because this is our joint value.
One is the joint number.
But this is not needed actually, because this draw robot draw the whole robot's structure.
Because as I assign parameter input parameters like that for the draw robot, I have to send some value
and I just send zero and one.
But for now, I mean, for this step, it is not important what you have put inside because you didn't
even changed the slider.
However, this shows how much is the slider changed, how its value and which slider is changed.
But we didn't change even any slider, so I just put random numbers zero and one.
OK.
And there's no need
to stick that here to make it the problem.
OK, if we do our robot now, let's see what's our true robot function?
OK.
Here is our draw.
First of all, this is calculate homogeneous transformation matrix, which return homogeneous transformation
matrix.
I just put the formula of this.
I will make it like that.
OK, as you can see, this is nothing but the formula for the calculation of homogeneous transformation
matrix from the given the parameters and in the draw robot, we get the teeter angle.
OK, Hall, what if the fear, if we change, for example, a slider tool?
What's its key to now?
OK.
Because we have to know what it's T to yes.
Um, then which slider is changed and the changing slider is number two.
OK, then we are calculating the homogeneous transformation matrix.
OK for this joint only.
OK, because this join changed.
OK?
These joints join changed.
So it's a homogeneous transformation matrix has to change also, because for others, it doesn't change.
D doesn't change.
It doesn't change all photos and changed anyway.
There is, therefore the homogeneity is homogeneous.
Photo with a homogeneous transformation matters.
In this case, the only changing available will be theta, and this variable is changed for only.
MS joins, OK.
The M.S. here, for example, if this is the second slider, then for the second joint it is changed.
OK?
It's for the searching joint because we started from two zero, then we will just update this and homogeneous
transformation matrix in our mattresses of homogeneous transformation matrix.
OK, then what we are doing, we are just initializing our values again.
I mean, you know, you know what I have said, I have said that during the was we were watching the
picture of the robot manipulator.
We have said that if ends joined changes, then which links has to change, not the previous ones,
because they are not affected, but after a while.
So we are starting from an up to the end.
Six.
And we update the positions of all the if a phrase.
First of all, we are not updating but resetting the positions of these points.
OK.
Then after we have done this, OK, uh, what we are doing, we are just
taking this.
OK?
Because below you can see why we are doing this one.
Because if we don't do it in this way, then this the links lengths will be increase increase increase
because this will save as this is global variable.
I mean, global.
This is not global.
It's not correct term in terms of programming, but as it is the parameter for the know, not parodied
this class property.
OK, it's a private variable and belong to the class and of what will be its value will be will be the
same throughout the class instance.
OK.
So that's why it's value as we multiply it with the homogeneous transformation matrix, it will be always
updated and it will always increase.
So we have to reset it at each iteration in order to avoid this.
Then what we are doing again, we are starting.
As we have said, the changes happen.
If the endpoint is changed, the change must be done for the for the joints after the change.
The joint.
OK.
So what we are doing first, we are calculating, uh, the H.
For example, if the force joined is change.
If we are calculating what is the transformation matrix h four zero?
Well, OK with respect to the base frame.
And then we apply this to our um point.
OK.
Because our transformation mattresses in mattresses, sheets of our all the uh, they are multiplication.
We also change.
Uh, so the so that we are, then we when we applied this homogeneous transformation matrix to the UM
to the each point in order to obtain it to each of the joint centers in order to obtain new points.
OK?
After the angle has been changed, if you will get the updated values for the Joint Centers, OK, then
this this.
This is nothing.
But this is for just in order to obtain the joint, um, central values.
OK, because we will draw, uh, this is by this way, we are just obtaining the joint values, OK,
because we will plot them in.
You can do without this one.
Also by making note making this x y z body, it is make life.
It makes life easier during the plot using plot three function because plot summary function weights
all the X in one vector, all the YS in one vector add all the assets in one vector.
OK, and if you say that y we have started from two and seven because as you can see, I have we have
six points, OK, including the in the affected.
But in order to take into account the Bayes joint, OK?
The base one, which is zero, which is always zero zero zero, doesn't change.
I have made it the seven and I started to apply changes only after only, including second and the joints
after the second.
OK, because base preview will never change.
It will be always position will be zero zero zero.
OK, so it will be the first one will be always zero zero zero.
So.
When we applaud, the robots will be corrected, never will be plotted correctly, then we are doing
the joint positions as a circle.
We are throwing for the first joint, OK, which is zero zero zero b's joint.
OK, and we are then dropping the other joints also.
OK.
Here, as the last joint is as the last frame is not joint, but in the fact that I have stopped at
51, OK?
And doesn't.
They didn't throw a circle in the last joint.
OK, because it is not a joint, it's in the filter and then we throw gripper.
And this is our true gripper function.
OK?
Here is the gripper.
We choose our offset.
Then we calculated again, as I have said, H6 zero.
OK, then what we are doing, we just apply transformation to our point.
This is our homogeneous transformation matrix.
This is our offset values.
OK, what is a b c d in its own frame?
But we are converted to them using this h matrix to base frame?
OK, and then we just plotted them.
OK.
This is transfer point function.
It is nothing but takes the transformation matrix.
This homogeneous transformation metric takes point.
OK.
The coordinates point.
OK.
This is three by one x y z.
But we have to make it in homogeneous coordinates point.
OK, so we add one in order to transform it using a homogeneous transformation matrix.
Because homogeneous transformation matrix is four by four, but petty when it's four, it was given
is three by one.
So we add one in order to make it homogeneous.
OK, coordinate.
Then we multiply it v.
So by this way, we are transforming it, and then we take the first three ones.
OK, because this is x y z and the last one was one v.
We threw out the one convert a homogeneous corner to the normal coordinates and sent them back.
OK, perfect.
You know the plot in MATLAB.
So let's run this after so much time.
OK, now first of all, let me say to you that when I make this go like this meager, I don't know why
I couldn't figure go to how it has been done.
But the last one, this fifth one is separated from these others and I don't care about it too much
because the robot is working as intended as a robot.
It seems very small because you can correct it by changing these limits.
OK?
I will not do that, but you can.
Maybe let's do that.
Let me just.
No, let me just to run.
OK, go one.
Okay.
Uh, one and one.
Let me see what will happen.
No.
It should show it a bit bigger.
No.
Yeah.
As our robot is small, it again shows it like that.
But you can see it's a bit bigger.
Yeah, you can buy a, uh, your mouse.
You can make it closer and I will use this one.
No need to make it to change the limits, but you can change a game to 0.5.
It will, I think, show much better way.
OK.
Let's now, as you can see, these these are our joints.
OK.
These are our joints, these circles and this are in the sector at the end.
And these are all realistic robots.
So let's change the first journal and see what's happening.
As you can see, it rotates.
Oh, OK.
It rotates as expected.
Let's change this joint, OK?
This is the same way it goes out because of this one.
If you make it like that, OK?
Zoom out, we will see the robot again.
OK, it moves as expected.
Perfect.
Then let's change this joint.
OK?
This also moves as expected.
OK, then let's change this.
As you can see, look at the end effector see and the factor is rotating.
OK.
This is also working correctly.
OK.
Let's change this one.
Also, OK, if this works correctly, and let's change this one.
Also, as you can see the amount of play that rotates again and the factor?
OK.
I think we have finished with our robot manipulator and you can see how you can create your robot manipulator.
Uh, OK.
In 3D.
Here is your 3D robot manipulator.
That's perfect.