1
00:00:01,470 --> 00:00:03,030
Our goal is almost complete.

2
00:00:03,060 --> 00:00:09,000
We need to do the last, final step and that contains multiple parties.

3
00:00:09,720 --> 00:00:15,270
The first thing is we need to make the robot take action on the values we have obtained.

4
00:00:16,620 --> 00:00:18,810
And that includes anger.

5
00:00:18,810 --> 00:00:25,230
To goal is going to be just a simple continual calculation that this is the goal to the goal.

6
00:00:25,320 --> 00:00:28,140
But how to make the robot take action?

7
00:00:28,620 --> 00:00:30,030
That is the real question.

8
00:00:30,450 --> 00:00:36,680
And that is angle what I call angle to turn.

9
00:00:36,930 --> 00:00:47,520
That's the best lead that I can come up with, which is basically equal to angle to goal minus robot

10
00:00:47,520 --> 00:00:56,070
pause towards the rotational part of the robot is going to be subtracted from the remaining angle and

11
00:00:56,070 --> 00:01:01,650
we will get the value that that is going to be the actual angle error we have to reduce.

12
00:01:01,870 --> 00:01:02,170
Okay.

13
00:01:02,430 --> 00:01:07,560
We have the angle to the goal 30 degree and we are currently at ten degrees.

14
00:01:07,560 --> 00:01:14,880
So we get the actual error 20 degree and we have to rotate 20 degrees to get to the desired position

15
00:01:15,270 --> 00:01:16,680
desired at this angle to.

16
00:01:17,250 --> 00:01:20,430
Now we have to make the robotic action or do it right.

17
00:01:20,670 --> 00:01:23,730
So if angle to turn.

18
00:01:25,890 --> 00:01:35,220
If angle to turn, we don't need these because if angle to turn is greater than 0.1, which is set to

19
00:01:35,220 --> 00:01:45,570
be the angle tolerance, you can see the if it reaches 0.1, then the if it is greater than that, you

20
00:01:45,570 --> 00:01:52,350
are going to be continuously making the robot rotate until unless it is less than the defined tolerance.

21
00:01:53,580 --> 00:01:54,870
What are you going to do?

22
00:01:55,350 --> 00:01:58,480
We are going to be needing a velocity, miss.

23
00:01:58,500 --> 00:01:59,410
Do we have that?

24
00:01:59,460 --> 00:02:00,750
No, we don't have that.

25
00:02:02,010 --> 00:02:04,760
Okay, let's define it here.

26
00:02:04,770 --> 00:02:13,260
The place where we defined the order, other messages as one self-talk velocity message.

27
00:02:13,410 --> 00:02:17,490
And that velocity message is off going to be obviously data type.

28
00:02:18,180 --> 00:02:22,230
Now let's utilize that message, self-talk, velocity, message.

29
00:02:22,740 --> 00:02:33,930
And that message is going to be the velocity message dot angular of Z because we are going to be treating

30
00:02:33,960 --> 00:02:37,290
Z and you can understand that this is a twist message type.

31
00:02:37,290 --> 00:02:39,960
So linear and annular X, Y, Z, all of them.

32
00:02:40,320 --> 00:02:44,010
And yet you're just utilizing Angular and angular z.

33
00:02:44,010 --> 00:02:48,960
We are going to say take the value angle to turn and do the rotation.

34
00:02:49,710 --> 00:02:55,020
And for this specific time, you are not going to be moving right now.

35
00:02:55,230 --> 00:02:55,660
Okay.

36
00:02:57,110 --> 00:02:58,860
And 0.0.

37
00:02:58,860 --> 00:03:03,510
Meaning first you need to fixed your angle to the goal.

38
00:03:03,750 --> 00:03:05,490
You want to move and then you will move.

39
00:03:05,670 --> 00:03:06,030
Okay.

40
00:03:07,290 --> 00:03:18,570
Else there is only one simple condition to the EZ and that is when your face towards the angle is correct,

41
00:03:18,570 --> 00:03:21,030
meaning your angle error has been reduced.

42
00:03:21,540 --> 00:03:29,250
You are going to start moving at a velocity of distance toward whatever the distance to goal value is.

43
00:03:29,250 --> 00:03:35,010
You are going to start moving with that error value because distance to go is basically distance at

44
00:03:35,010 --> 00:03:40,200
it and we are going to give it to the velocity, linear velocity as the distance reduces the velocity

45
00:03:40,200 --> 00:03:41,670
of the robot is going to reduce.

46
00:03:42,360 --> 00:03:44,850
That is how it is going to move.

47
00:03:44,850 --> 00:03:52,770
And now what we are interested in looking at is angle to go in and distance to go.

48
00:03:54,120 --> 00:03:55,500
I think it is already written.

49
00:03:55,500 --> 00:04:03,120
I just need to write distance to go ahead and angle to cool, angle to angle to turn and see how much

50
00:04:03,120 --> 00:04:07,550
angle I have to turn so I can see if my cord is running correctly or not.

51
00:04:07,550 --> 00:04:09,240
That is what is required.

52
00:04:09,900 --> 00:04:12,120
Last thing with you to publish this as well.

53
00:04:12,120 --> 00:04:20,040
Publish this velocity message into our velocity publisher that is going to make the robot move and that

54
00:04:20,040 --> 00:04:21,840
is the self-talk, the last message.

55
00:04:21,900 --> 00:04:24,870
And that's it I take towards the goal thing.

56
00:04:25,320 --> 00:04:27,510
Go to go robotic movement.

57
00:04:27,510 --> 00:04:29,520
Let's bring it back here.

58
00:04:30,690 --> 00:04:32,460
Let's zoom it a little bit.

59
00:04:32,460 --> 00:04:34,860
And where is the terminal Ted?

60
00:04:34,860 --> 00:04:41,670
We have it perform call can be let's give the values of a one way to the robot.

61
00:04:42,360 --> 00:04:44,640
And this should be at this specific point.

62
00:04:45,190 --> 00:04:46,500
Let's see what the robot says.

63
00:04:46,920 --> 00:04:51,150
What robot is rotated in the counter-clockwise direction.

64
00:04:51,600 --> 00:04:53,190
Distance to go is 1.3.

65
00:04:53,190 --> 00:04:55,260
Angle to goal is 0.68.

66
00:04:56,280 --> 00:04:57,300
Okay.

67
00:04:57,450 --> 00:04:58,350
What just happened?

68
00:04:59,940 --> 00:05:03,400
This disease is increasing and increasing and increasing.

69
00:05:04,270 --> 00:05:09,820
But there was one problem that the report is not even stopping.

70
00:05:11,770 --> 00:05:12,270
Whoa.

71
00:05:12,310 --> 00:05:16,540
Let me pause this evolution, and it is not even pause.

72
00:05:17,620 --> 00:05:19,830
So a robot has gone rampage.

73
00:05:19,840 --> 00:05:29,410
And the reason is the robot took a turn in the opposite direction and then it started to move.

74
00:05:29,410 --> 00:05:33,190
And as you can see, the distance to goal value started to increase.

75
00:05:33,610 --> 00:05:39,580
The robot motion started to increase as the robot has taken the turn in the opposite direction, in

76
00:05:39,580 --> 00:05:45,340
the distance to go increases and the robot moved towards that.

77
00:05:45,350 --> 00:05:46,840
Let me bring the robot back.

78
00:05:47,860 --> 00:05:57,310
One thing we need to look at is the angle to goal being very accurately solving the angle problem.

79
00:05:57,520 --> 00:06:01,480
But it is not working for the distance problem.

80
00:06:01,480 --> 00:06:08,980
The real thing was the orientation of the current robot state was at an offset and we are going to do

81
00:06:09,220 --> 00:06:11,110
that offset into angle to good.

82
00:06:11,440 --> 00:06:18,550
Whenever you calculate the tangent inverse after the result you are going to add 3.1 for a 360 degree

83
00:06:18,550 --> 00:06:22,540
rotation because you because you saw the robot started to move in the opposite direction.

84
00:06:22,540 --> 00:06:24,940
What it should not have been doing.

85
00:06:27,200 --> 00:06:35,120
So before moving to the final steps, I have made some changes and that is user input from the terminal

86
00:06:35,120 --> 00:06:36,360
as an angle offset.

87
00:06:36,380 --> 00:06:43,360
I made some changes, but this one is the major one so we can directly give an angle offset as we send

88
00:06:43,580 --> 00:06:51,170
commands as as an argument to the file we need to perform the collagen build and bring the simulation.

89
00:06:51,170 --> 00:06:53,000
This time the simulation has turned dark.

90
00:06:53,000 --> 00:06:58,610
My laptop has turned off the GPU, but we can still manage to see what the robot is doing.

91
00:06:59,630 --> 00:07:09,230
I am going to first give one one -3.14 as an angle offset -360 degree rotation.

92
00:07:09,230 --> 00:07:10,460
That basically means.

93
00:07:11,610 --> 00:07:17,630
So the robot has started to move towards the one one and you can see the angle.

94
00:07:18,770 --> 00:07:28,580
The angle got less than 1.0.1 and the robot is taking baby steps, the distance is decreasing and it

95
00:07:28,580 --> 00:07:31,490
is moving towards the goal location one one.

96
00:07:31,880 --> 00:07:39,470
The thing is that the robot moves a little bit and the angle to goal gets changed.

97
00:07:39,470 --> 00:07:48,530
This is because that the problem with the robot's physical properties and when it reaches the goal almost

98
00:07:48,530 --> 00:07:49,250
reaches the goal.

99
00:07:49,250 --> 00:07:56,780
The robot exit that my net had corrected said that the basic logic is rated at within a goal of ten.

100
00:07:56,780 --> 00:08:01,850
Then you can see it is taking some time and it is really trying to reach the goal.

101
00:08:03,680 --> 00:08:09,590
It fixes its orientation and then it gets a little off the F condition that we wrote.

102
00:08:09,670 --> 00:08:14,810
But still it is moving, taking baby steps and this distance is decreasing.

103
00:08:14,810 --> 00:08:16,160
It is going to take a lot of time.

104
00:08:16,160 --> 00:08:21,920
I have rated this based logic for you and because it is very easy to understand this basic event as

105
00:08:22,190 --> 00:08:23,390
it is controlling the robot.

106
00:08:23,900 --> 00:08:26,030
Now I want you to improve this.

107
00:08:26,450 --> 00:08:31,430
This is the boiler plate code, and I want you to improve it to a very good quality.

108
00:08:31,430 --> 00:08:34,130
You can write some basic conditions.

109
00:08:34,130 --> 00:08:41,890
Do not make this kind of behavior of taking baby steps and then stopping error, correcting that goal,

110
00:08:42,020 --> 00:08:44,120
then stopping and correcting that again.

111
00:08:44,660 --> 00:08:47,420
Okay, so that's good.

112
00:08:47,420 --> 00:08:52,010
The goal driving it is going to take a lot of time to reach that specific point.

113
00:08:52,010 --> 00:08:56,180
But for now, let's leave it and move to the next part.
