1
00:00:01,770 --> 00:00:08,240
We left at the point that a robot was able to send us the pores of its look because it's spores from

2
00:00:08,250 --> 00:00:09,840
Gazi was a relation to the script.

3
00:00:10,200 --> 00:00:11,160
Let's move on.

4
00:00:12,150 --> 00:00:16,680
Previously in the go to function we just wrote a minus which is equal to one meaning.

5
00:00:17,070 --> 00:00:17,880
Do something.

6
00:00:18,090 --> 00:00:20,190
Don't give me a syntax.

7
00:00:20,190 --> 00:00:20,900
Added a no.

8
00:00:20,910 --> 00:00:23,280
I am going to write certain things.

9
00:00:23,820 --> 00:00:27,180
The first thing is going to be related to the equations.

10
00:00:28,080 --> 00:00:29,280
What were the equations?

11
00:00:29,580 --> 00:00:41,010
The equations were distance at a distance that was equal to the square root of something like a square

12
00:00:41,010 --> 00:00:41,400
root.

13
00:00:41,400 --> 00:00:54,540
And then within there was a square for x2 minus from x2, minus x1 and then there was a again a square

14
00:00:54,540 --> 00:01:02,790
of y2 minus y1 and it's square x2, minus x1 and x squared.

15
00:01:04,290 --> 00:01:07,800
That's how you write the squares for all the force.

16
00:01:08,250 --> 00:01:18,210
So we have a distance error being calculated and then we have an what was the name, eight and do an

17
00:01:18,210 --> 00:01:20,190
optimized function for our contingent.

18
00:01:20,760 --> 00:01:32,160
And that was containing y two minus y one and that was divided by x2 minus x one, if I remember correctly.

19
00:01:32,460 --> 00:01:39,570
So these are the equations that we need to fill and now we are going to be filling them with the proper

20
00:01:39,570 --> 00:01:39,870
value.

21
00:01:39,870 --> 00:01:46,410
So x2 is basically good and Google contains x and y two values.

22
00:01:47,970 --> 00:01:54,120
The next thing for Robot Boy is Robot Pose contains three values X, Y, and Z.

23
00:01:54,870 --> 00:01:59,850
Previously, when we saw that there was orientations, Z was changing into values.

24
00:01:59,850 --> 00:02:02,040
I came across very interesting information.

25
00:02:02,040 --> 00:02:03,240
Let me share it with you.

26
00:02:03,250 --> 00:02:07,920
When I got into the cross to show Interface.

27
00:02:09,630 --> 00:02:12,420
Show me the interface of NAV messages.

28
00:02:12,930 --> 00:02:16,830
Again, there is a messages and then there is our dormitory.

29
00:02:17,040 --> 00:02:24,330
Now, if I get information about it, when I see geometric message post covariance with force that was

30
00:02:24,330 --> 00:02:26,400
added straight, that was containing the board.

31
00:02:26,400 --> 00:02:31,710
So I have to get the information about this specific message across to interface.

32
00:02:32,100 --> 00:02:32,650
Sure.

33
00:02:33,150 --> 00:02:36,720
Geometric message with Bose.

34
00:02:36,720 --> 00:02:37,770
Covariance.

35
00:02:37,770 --> 00:02:39,270
Bose with covariance.

36
00:02:41,040 --> 00:02:44,280
Bose with covariance.

37
00:02:45,380 --> 00:02:49,140
And yes, show me this specific message state.

38
00:02:49,150 --> 00:02:50,250
What does it contains?

39
00:02:50,730 --> 00:02:54,260
It shows it contains Bose, Bose and some variances.

40
00:02:54,270 --> 00:02:55,770
So what is Bose eight?

41
00:02:55,770 --> 00:02:59,760
I think the Bose's geometric message was.

42
00:03:00,150 --> 00:03:01,780
And what does this Bose contain?

43
00:03:01,800 --> 00:03:09,400
It contains a point position, which is three values point position, X, Y, Z and a good turning orientation.

44
00:03:10,590 --> 00:03:15,940
Now the to orientation is very important thing, but that really is basically a representation of a

45
00:03:15,990 --> 00:03:22,740
rotation in 3D space, a more appropriate method to represent orientation in 3D space.

46
00:03:23,070 --> 00:03:26,490
In our case, we need to convert it into way that I get from Atomic.

47
00:03:26,490 --> 00:03:26,910
I listen.

48
00:03:27,090 --> 00:03:33,880
I obtained this code in which our goal was actually converting or turning orientation into a letter

49
00:03:33,880 --> 00:03:35,640
and that can be read in in degrees.

50
00:03:36,960 --> 00:03:37,860
We need this.

51
00:03:38,250 --> 00:03:40,170
So how can we utilize it?

52
00:03:40,710 --> 00:03:41,940
We can utilize it here.

53
00:03:41,940 --> 00:03:47,940
Like the point that I just emphasized that from the Bose Bose orientation part, which is a quarterly

54
00:03:47,940 --> 00:03:55,990
endpoint, we are going to make it as ten year ops.

55
00:03:56,610 --> 00:04:03,360
We are going to write its name as quite dead, and yet I'm going to say it's which molecule.

56
00:04:03,360 --> 00:04:06,660
And then we are going to say call this specific function.

57
00:04:09,000 --> 00:04:11,670
This specific function is going to give all three values.

58
00:04:11,880 --> 00:04:22,260
The role, the role, pitch angle, three different angles of when we call this function and this function

59
00:04:22,260 --> 00:04:24,210
is class function.

60
00:04:24,330 --> 00:04:25,650
And what does it requires?

61
00:04:26,460 --> 00:04:30,030
It requires X, Y, Z and Omega W.

62
00:04:30,750 --> 00:04:36,720
We'll give that in this manner, which is quarterly text.

63
00:04:37,890 --> 00:04:42,210
We're going to give it as quarterly invite, but again, let it go to the Omega.

64
00:04:43,620 --> 00:04:48,780
These are all values that are being obtained by the message that we are dealing with Z and Y.

65
00:04:49,380 --> 00:04:55,740
So it is going to give us role by role picture and we are only interested in Java.

66
00:04:56,190 --> 00:04:59,860
So I'm going to just write something very.

67
00:04:59,950 --> 00:05:06,830
Interesting related to the robot was I'm going to utilize this where it is point position.

68
00:05:07,420 --> 00:05:17,380
If I'm going to use this message type, if I write it geometric message point, what does it contain?

69
00:05:17,380 --> 00:05:22,060
It contains three values flawed six four, three values x, y, z.

70
00:05:22,060 --> 00:05:28,080
And that's what I need to make it more object oriented.

71
00:05:28,090 --> 00:05:34,990
I am going to utilize the class and write a variable and that is going to be a robot force.

72
00:05:36,580 --> 00:05:42,280
That is going to be all point type Y and robot for Z's job.

73
00:05:42,610 --> 00:05:44,380
So you understand what I did.

74
00:05:44,380 --> 00:05:51,970
I utilize the rise functionality, loss medicine, step into my robot for saving you.

75
00:05:51,970 --> 00:05:54,760
So what are you know, you understand what I did?

76
00:05:54,970 --> 00:05:58,390
I obtained the boards in a very different manner.

77
00:05:58,390 --> 00:06:05,010
I converted into I let go of the orientation part only I'm submitting to a specific data type into a

78
00:06:05,080 --> 00:06:08,410
flow data type that it is that is robust based data.

79
00:06:08,410 --> 00:06:10,300
David I don't want to create a custom one.

80
00:06:10,570 --> 00:06:15,240
So point contains three float values and I have float values to store in it.

81
00:06:15,490 --> 00:06:18,310
So the robot poses of point type.

82
00:06:18,610 --> 00:06:24,280
There is another point variable I will be using and that is goal posts.

83
00:06:25,510 --> 00:06:33,460
I will not be making the robot move towards the goal post with the specific orientation, but I should

84
00:06:33,730 --> 00:06:35,770
just write goal position.

85
00:06:35,920 --> 00:06:39,130
But I'll write goal posts as I like it.

86
00:06:39,760 --> 00:06:43,690
I'll do a robotics time if I save both both content position and orientation.

87
00:06:43,690 --> 00:06:49,660
But I'm not dealing with orientation specific goal because it is going to make the code very complex

88
00:06:49,660 --> 00:06:51,700
and I'm not in the favor of that right now.

89
00:06:52,660 --> 00:07:01,590
So here when we call go to goal function, we are going to initialize three different values goal force

90
00:07:01,610 --> 00:07:02,170
X

91
00:07:04,490 --> 00:07:11,530
and then we are going to how we are going to define we are going to take value from the user from the

92
00:07:11,530 --> 00:07:13,510
terminal system.

93
00:07:14,170 --> 00:07:22,120
DOT are we whenever we run through the terminal we can utilize the arguments of it as well and we are

94
00:07:22,120 --> 00:07:26,980
using the service function assist library, so import sets as well.

95
00:07:28,270 --> 00:07:35,620
And similarly for the X Park for the Y part as well, although it contains a Z part, but we are not

96
00:07:35,620 --> 00:07:36,880
going to be utilizing it.

97
00:07:36,880 --> 00:07:37,240
Okay.

98
00:07:39,670 --> 00:07:41,770
And it returns a string.

99
00:07:41,770 --> 00:07:45,670
So I will convert it into a float to make it more understandable.

100
00:07:45,670 --> 00:07:50,380
Everything else is are dealing with floats or converted to to float.

101
00:07:50,920 --> 00:07:57,970
Now coming to the real part, how these equations are going to make sense x2 is going to be the goal

102
00:07:57,970 --> 00:08:06,610
for is x okay goal pose x minus the robot pose x.

103
00:08:07,210 --> 00:08:07,600
Okay.

104
00:08:07,960 --> 00:08:14,530
This is going to be the turning point of our code where things are going to be get technical and both

105
00:08:14,530 --> 00:08:17,650
of them are dealing with X right now.

106
00:08:18,370 --> 00:08:26,380
And similarly, we are going to copy it and we are going to be based it for the Y part here.

107
00:08:26,380 --> 00:08:38,650
I'm going to do right y y it is stacking goalpost y could pose x and both goalposts vital, which is

108
00:08:38,650 --> 00:08:40,900
why it was like minus robot pose.

109
00:08:40,900 --> 00:08:41,140
Right?

110
00:08:41,380 --> 00:08:43,890
So the equation is now set a square.

111
00:08:43,900 --> 00:08:45,070
It is not yet imported.

112
00:08:45,070 --> 00:08:46,090
I will import that.

113
00:08:46,660 --> 00:08:48,670
Let me complete the equations first.

114
00:08:50,200 --> 00:08:55,540
Goalpost X was y and here y and here.

115
00:08:55,540 --> 00:08:55,840
Right.

116
00:08:55,840 --> 00:09:03,550
So you can see we have arranged things in a manner that we have defined in the structure.

117
00:09:03,940 --> 00:09:11,500
We are utilizing raw structures that are going to make a useful code out of it and more presentable

118
00:09:11,500 --> 00:09:11,760
code.

119
00:09:11,770 --> 00:09:13,240
That's very important.

120
00:09:13,600 --> 00:09:23,890
I'm going to utilize this self-taught, self-taught angle to cool a very class variable is going to

121
00:09:23,890 --> 00:09:29,080
be created self taught distance to call.

122
00:09:29,410 --> 00:09:34,000
Both of these variables are going to be initialized in the class as well.

123
00:09:34,390 --> 00:09:40,150
Self taught angle to goal and set of distance to void.

124
00:09:40,780 --> 00:09:48,250
Our version of these variables are initialized ID and matched related property that here.

125
00:09:48,250 --> 00:09:51,640
So I'm going to say import map.

126
00:09:53,340 --> 00:09:54,810
And four square root beer.

127
00:09:54,810 --> 00:09:57,090
Was it Matt Doherty?

128
00:09:57,090 --> 00:09:57,810
Square Root.

129
00:09:58,050 --> 00:09:59,960
Matt Doherty Thank you.

130
00:10:01,110 --> 00:10:03,580
I hope everything is good right here.

131
00:10:03,600 --> 00:10:12,600
We just need to publish our message and see if things are working in our favor or not.

132
00:10:12,960 --> 00:10:18,930
As this function is going to recall, this go to call function is going to be called every half a second.

133
00:10:18,930 --> 00:10:24,480
I'm going to change it to 0.2 of a second every 0.2 seconds.

134
00:10:24,690 --> 00:10:31,800
It is going to call this go to go function and I'm going to print out the message, hit the log in message

135
00:10:31,800 --> 00:10:33,870
what it is going to be ex-wife.

136
00:10:34,350 --> 00:10:35,690
And I don't need that.

137
00:10:37,560 --> 00:10:39,060
I don't need this anymore.

138
00:10:39,300 --> 00:10:45,840
I am going to write self taught distance to go and self doubt.

139
00:10:46,230 --> 00:10:50,100
I'm going to put both of these are going to be utilized here.

140
00:10:50,100 --> 00:10:57,420
I'm going to say distance to goal and angle to do it and it is going to be logged in.

141
00:10:57,420 --> 00:11:01,680
Let's build it if we can.

142
00:11:03,390 --> 00:11:05,100
And where is our simulation?

143
00:11:07,110 --> 00:11:12,000
We are going to bring our robot back to the point where it was.

144
00:11:13,410 --> 00:11:22,250
Let me bring it here and we've created a little bit to make it more look like that it has yet going

145
00:11:22,440 --> 00:11:23,880
to move from the origin.

146
00:11:23,880 --> 00:11:27,630
I am going to run my node that we need to do before running it.

147
00:11:27,630 --> 00:11:29,790
We have to give these arguments as well.

148
00:11:30,300 --> 00:11:35,220
Several effects sinks away as the arguments are in the code.

149
00:11:35,610 --> 00:11:37,890
Let's take a look what is going to be the output.

150
00:11:38,580 --> 00:11:44,820
So it says that you have a distance to go line booted and angle equals 0.7.

151
00:11:44,970 --> 00:11:46,380
I have given seven six.

152
00:11:46,380 --> 00:11:46,710
Right.

153
00:11:46,710 --> 00:11:51,090
I'm going to rotate that order and see if it changes a little bit.

154
00:11:51,090 --> 00:11:56,100
If I rotated totally, does it changes very little?

155
00:11:57,420 --> 00:12:00,210
There is some sort of a problem with the robot, I think.

156
00:12:00,570 --> 00:12:01,920
No, that is not the case.

157
00:12:01,920 --> 00:12:03,330
My robot is not moving.

158
00:12:03,330 --> 00:12:08,910
If I put it here, then the values change as all of the values are dependent on x and y.

159
00:12:08,910 --> 00:12:09,300
Okay.

160
00:12:09,360 --> 00:12:12,180
It is not taking the force of the robot directly.

161
00:12:12,480 --> 00:12:18,480
So angle to call 0.6 as I move the robot angle to voltages and the distance towards changes as well.

162
00:12:19,140 --> 00:12:27,090
So to some extent our code is ready, but we need to give control commands to a robot and see what is

163
00:12:27,090 --> 00:12:31,230
the difference that we can do create that is going to make the robot move.
