In robotics, one of the most important features that everyone requires is we ordered the robot to go
to a certain location and it X-Y to replayed meeting on the ground and the robot reaches that from that
specific point on the ground that is known as go to goal.
In this technique, there are two things.
One is the distance and the second is the angle that we have to take it off.
What do I mean by that?
Let's understand it with a representation and then we will have a better understanding.
Suppose we have this to display an x and y know when we have these coordinates and x and y we are in
a 2D.
Okay.
And we are supposing that our robot was at Origin at first.
Now we say that our robot is at this specific location.
We can see at this specific location.
Okay.
And this is the middle point.
We are not right now explaining the orientation of the robot.
We are just finding the angle and the distance.
And we will come back to the orientation point to according to the x y i robot is x one or two of x
and one of why.
Okay.
The goal position that we want specifically is this specific position we want for our robot.
This is the goal position.
This is the initial position.
Now goal position is three in X and three Y.
We want the robot to move from initial position to goal position and that three three is our goal position.
What is the process of making the robot go to that specific point?
That's the main question.
Coming to the answer is, first, we need to calculate the distance between these two points that is
applied to this formula, which is known as including distance.
You can Google about it.
It's really interesting, including distance.
And I think we should first calculate that due to distance online, I have all opened up the would be
calculated match distance can that distance that's the other only calculator is the the page that is
providing us this facility.
So the first point is two of X and one of Y three affects entry of right is the second one.
So in our specific example, the distance is equal to a distance, one that we are calculating is
2.23.
And what's the angle for our first reading?
Because we are now applying the angle formula as well to calculate the angle.
We just you know, we can see and find that we need to apply y2 minus y one in our case y2 three minus
y1 one is equal to two, so that becomes two and for x it becomes three minus two, one, three by one
and arch ten or tangent inverse of three that is going to be one of 71.56, 71.56 and in radians it
becomes 1.24.
So our robot what this is actually represent if I draw the axis here a robot is saying that the angle
to this goal keeping the X on the horizontal axis and Y on the vertical axis and putting the robot on
the origin, it makes an angle of 71.56 and if we visually see it, it is convincing that this calculation
is correct.
So when we want to calculate the distance, so when we want to make the robot go to the distance, you
first calculate the distance and the angle to it.
Then we apply some control algorithms to make it move.
Let's do one more example.
In this specific case, it is now one in X and three in Y, and this is going to number two.
Now, this is the goal and we are saying that initial position is still the same.
So what is going to be the distance and the angle let's compute?
In our case, we are now at a point that let me compute the distance first to it, going to the initial
position and
the now second position for the X is one and for Y is three.
Okay.
It is saying the distance is again 2.236.
Fair enough.
Because visually you can.
The nation is in the middle, 2.3 on this side, 2.3 on this side.
Coming to the angle thing, what is going to be the angle for why to make this vibrant?
Why is actually why two is three.
So three minus one, it becomes two.
And why one?
And for the x part, it is one minus two, which is minus one.
So argent of minus one is required.
Our tangent of minus one is the required calculation we want.
So are tangent minus three minus two.
Let's calculate and it is saying you need to apply -63 degrees.
This is making -63 degrees with this specific goal.
Number two.
My calculation can go wrong.
I've made some mistakes.
But the point is, this is how you calculate distance and angle.
Okay?
And when we talk about the distance and angle, the next thing that we need to do in general specific
is of for the linear of X, the command velocity, linear x is going to be given the distance, the
distance that we have calculated from one point to the goal point and Angular Z is going to be the angle.
That's what it is going to be simple, but we have to apply some major conditions to keep in mind that
if it is negative, what is the initial point?
Because we were just assuming the initial point is at Origin for for first example, in reality that's
not the case and we have to take care of a lot of things.
And you'll see in the court that there are a lot of things to think about and we will solve it in a
very simple manner.