1
00:00:01,090 --> 00:00:06,290
To incorporate obstacle navigation to the Board Motion Planning class, you first need to add a few

2
00:00:06,290 --> 00:00:11,240
sets of instance variables inside of an entered function, so we head over to the ADD function.

3
00:00:11,300 --> 00:00:17,180
Scroll down and then add the full set of instance variables that are basically containers, the stores,

4
00:00:17,180 --> 00:00:21,200
the previous angle to tune, distance to go, and the port iteration.

5
00:00:21,890 --> 00:00:27,380
By storing this previous information about these particular values, we now have the information of

6
00:00:27,380 --> 00:00:32,060
whether these particular values has changed from the previous iteration to the current migration.

7
00:00:32,390 --> 00:00:37,700
And if they haven't changed, then we can be sure that we need to perform obstacle navigation because

8
00:00:37,700 --> 00:00:40,340
our robot is stuck somewhere on the map.

9
00:00:41,180 --> 00:00:46,910
Then we head on over to the next instance we're able that are basically outrageous and these are great

10
00:00:46,910 --> 00:00:52,910
as basically keeps track of how many iterations has elapsed since one of these values has not changed.

11
00:00:53,090 --> 00:00:59,120
That includes the angle, the distance, the goal, and then we have the counter that tells how much

12
00:00:59,120 --> 00:01:01,490
time has elapsed since we have backpedalling.

13
00:01:02,360 --> 00:01:06,710
And then we are the last set of instance variable that are basically state variables.

14
00:01:06,890 --> 00:01:08,570
The first is the trigger backpedalling.

15
00:01:08,780 --> 00:01:14,030
That is for the case when we are stuck on a world and we need to backpedal to try to reach the next

16
00:01:14,030 --> 00:01:14,540
meaning goal.

17
00:01:14,900 --> 00:01:17,810
And then the next step is basically the trigger next point.

18
00:01:18,020 --> 00:01:23,450
If we cannot reach a particular angle, then we need to activate the stick on next point to try to reach

19
00:01:23,450 --> 00:01:27,980
the next winning goal because that is reachable and both of these initialize to false.

20
00:01:28,520 --> 00:01:33,620
Then we head on over to the go to go function where we need to add in the functionality to check the

21
00:01:33,620 --> 00:01:34,610
go to assert us.

22
00:01:35,120 --> 00:01:38,660
To do that, we need to add a new function before the go to go function.

23
00:01:39,490 --> 00:01:40,300
And that would be.

24
00:01:42,340 --> 00:01:43,720
The check go to Google status.

25
00:01:43,870 --> 00:01:45,580
This takes it to input arguments.

26
00:01:45,580 --> 00:01:48,970
The first is the angle to tone, and the second is a distance to what?

27
00:01:50,470 --> 00:01:50,800
Here.

28
00:01:51,130 --> 00:01:55,630
The first thing that we do is basically compute the change in the angle to turn.

29
00:01:56,200 --> 00:02:01,480
And this can be done by simply taking the current angle to turn and subtracting it with the previous

30
00:02:01,480 --> 00:02:04,150
angle to turn datastore inside the instance variable.

31
00:02:04,600 --> 00:02:09,460
This gives us the change in the angle to turn, and if the angle has not changed, it is large and it

32
00:02:09,460 --> 00:02:13,540
does not change for a long time and we haven't performed the back panel.

33
00:02:13,840 --> 00:02:18,580
Then what we need to do, we are to simply increment the angle, not change our data.

34
00:02:19,390 --> 00:02:25,180
So once the angle of change reaches 200, we aim to trigger the backpedaling because the angle has not

35
00:02:25,180 --> 00:02:30,490
changed for a significant amount of time, indicating that the robot is stuck on a ball and it needs

36
00:02:30,490 --> 00:02:32,800
to backpedal to try to reach the next minute goal.

37
00:02:33,460 --> 00:02:38,680
Otherwise, we simply reset the angle, not change, and set the previous angle to turn to the current

38
00:02:38,680 --> 00:02:39,340
angle to turn.

39
00:02:40,000 --> 00:02:45,610
Then we address the case for where we have the change in distance, and that can be computed by simply

40
00:02:45,610 --> 00:02:48,640
subtracting the distance to go and the previous distance to go.

41
00:02:48,910 --> 00:02:53,530
This gives us the change in the distance and the same way as we were doing for the angle.

42
00:02:54,040 --> 00:03:00,400
We check if the distance is large enough and not changing and the figure backpedaling has not been set.

43
00:03:00,730 --> 00:03:04,150
Then we increment the distance, not change to what?

44
00:03:04,570 --> 00:03:09,370
And if the this is not change is greater than 200, that arbitrator has reached 200.

45
00:03:09,550 --> 00:03:14,560
Basically, a long time has elapsed since the distance between the court and the winning goal has not

46
00:03:14,560 --> 00:03:14,920
changed.

47
00:03:15,190 --> 00:03:20,200
Then we triggered the backpedaling because the car is stuck on a ball again and it needs to backpedal

48
00:03:20,260 --> 00:03:21,730
to try to reach the next main goal.

49
00:03:21,970 --> 00:03:26,410
Otherwise, we set the distance, start change and set the previous distance to go to the current,

50
00:03:27,010 --> 00:03:28,240
the current distance to go.

51
00:03:28,990 --> 00:03:34,160
Then we address that last case that can occur, and that is basically check if the goal or the winning

52
00:03:34,210 --> 00:03:39,760
goal has not changed for the last duration, and that can be done by simply subtracting the previous

53
00:03:39,760 --> 00:03:41,770
fourth alteration with the current iteration.

54
00:03:42,640 --> 00:03:44,230
And this gives us the change in goal.

55
00:03:44,530 --> 00:03:51,070
And if the changing goal of the goal has not changed and the distance to go is basically less than 30,

56
00:03:51,070 --> 00:03:57,610
indicating that it is very relatively close to the car, then we implement the goal, not change outright.

57
00:03:58,000 --> 00:04:00,940
And if the goal not change is less is greater than 500.

58
00:04:01,180 --> 00:04:02,680
Basically a time has elapsed.

59
00:04:02,740 --> 00:04:06,250
Then we trigger the next point because we cannot reach the winning goal.

60
00:04:06,640 --> 00:04:11,980
And if the goal has not changed for a very long time, then we also trigger the next point because we

61
00:04:11,980 --> 00:04:13,450
cannot reach that particular goal.

62
00:04:13,630 --> 00:04:18,700
Otherwise we reset what these variables and then set the previous path over to the current path.

63
00:04:19,510 --> 00:04:22,840
And this way we have incorporated the check go to world status.

64
00:04:23,230 --> 00:04:26,260
So all we need to do is head on over to the go to goal function.

65
00:04:27,610 --> 00:04:30,760
We're computing the speed and angle printed out.

66
00:04:31,060 --> 00:04:31,870
We now check.

67
00:04:34,150 --> 00:04:39,880
Whether if served or Google not reflect.

68
00:04:40,150 --> 00:04:45,490
So if you haven't reached the final winning goal or basically have not reached the exit, then we can

69
00:04:45,490 --> 00:04:48,010
check by calling the self check.

70
00:04:48,160 --> 00:04:48,700
Go to go.

71
00:04:49,360 --> 00:04:54,220
This takes in doing what argument the first is angled to doing, and the second is a distance to go.

72
00:04:54,670 --> 00:05:00,280
So we check the go to goal status and if we have found a case where we need to perform obstacle navigation,

73
00:05:00,490 --> 00:05:04,540
either backpedalling or to the next point, then we need to address that particular case.

74
00:05:04,780 --> 00:05:08,620
So we need to define what should happen or how would backpedaling occur.

75
00:05:08,920 --> 00:05:14,650
So we scroll down where you are publishing the velocity before this, publishing the velocity that we

76
00:05:14,770 --> 00:05:18,160
updated, we need to perform the backpedaling definition.

77
00:05:18,610 --> 00:05:23,560
That is basically if the trigger backpedaling has been activated, what should we do?

78
00:05:23,890 --> 00:05:29,050
What we need to do is simply check if the seller backpedaling article is equal to zero, then we say

79
00:05:29,050 --> 00:05:30,550
that we need to go to the next point.

80
00:05:31,390 --> 00:05:34,120
This means that we need to load the next winning goal.

81
00:05:34,390 --> 00:05:39,430
And then we simply said the linear component of our willingness to object to negative, to indicate

82
00:05:39,430 --> 00:05:41,830
to our card that it needs to move in reverse.

83
00:05:42,310 --> 00:05:47,620
And then we set the angle to angle and then we increment the back pedaling our greater by one.

84
00:05:48,370 --> 00:05:54,730
So if this backpedaling goes on for a significant amount of time until just backpedaling after two 100,

85
00:05:55,000 --> 00:06:00,850
then we reset the trigger backpedaling with 72 falls, and we reset the backpedaling outright to zero.

86
00:06:01,090 --> 00:06:04,690
And the backpedaling has done, and the car can now reach the next winning goal.

87
00:06:05,200 --> 00:06:10,120
So once we have defined the case for the backpedaling, we need to define the case for what should happen

88
00:06:10,120 --> 00:06:12,070
when the trigger next point has been activated.

89
00:06:12,460 --> 00:06:16,870
So when the trigger next is activated, we don't need to reach the current winning goal.

90
00:06:17,020 --> 00:06:19,570
We can simply try to reach the next winning goal.

91
00:06:19,810 --> 00:06:25,690
So this condition where we are simply checking if the company goal is within the reach and we have reached

92
00:06:25,690 --> 00:06:28,240
that particular meaning goal can simply be added with.

93
00:06:29,760 --> 00:06:31,170
If self-taught.

94
00:06:32,550 --> 00:06:35,010
Trigger point has been activated or not.

95
00:06:35,250 --> 00:06:37,230
So the trigger next point is activated.

96
00:06:37,410 --> 00:06:43,410
Then we don't need to use that current meaning we can simply activate the next memory go so we can simply

97
00:06:43,410 --> 00:06:48,600
incorporate the next condition or simply incorporate the condition to trigger the next point before

98
00:06:48,600 --> 00:06:51,480
encountering that particular condition or calling that political function.

99
00:06:51,660 --> 00:06:57,180
We need to define the function that triggers the next point so we can scroll up and for the go to go

100
00:06:57,180 --> 00:06:59,340
function and adding that functionality.

101
00:07:01,130 --> 00:07:02,300
That is to get suitable.

102
00:07:02,300 --> 00:07:02,870
Next point.

103
00:07:03,230 --> 00:07:07,350
So once we have defined this functionality of getting the next suitable next point for the kids, we

104
00:07:07,370 --> 00:07:08,360
are stuck behind the wheel.

105
00:07:08,600 --> 00:07:14,360
You can now call this functionality inside the case where we were approaching the next meaning goal.

106
00:07:15,080 --> 00:07:21,290
So we defined that functionality of where if we have set the trigger next point activated and if we

107
00:07:21,300 --> 00:07:25,880
were backpedaling indicating that we are stuck on a goal and we cannot reach that particular meaning,

108
00:07:26,240 --> 00:07:33,500
then we need to get the suitable next point because the next closest next point might not be accessible

109
00:07:33,500 --> 00:07:34,070
anymore.

110
00:07:34,280 --> 00:07:39,070
So we need to get the suitable next point by calling in the function, by providing the current board

111
00:07:39,110 --> 00:07:43,160
location and the current path that we have computed in the planning stage.

112
00:07:43,760 --> 00:07:49,260
So this means that we have completely incorporated the obstacle navigation to our board motion planner

113
00:07:49,280 --> 00:07:54,620
class and hopefully our missile board will be able to solve the more complex means to.

114
00:07:55,650 --> 00:07:57,630
All right, guys, it's the moment of truth.

115
00:07:58,110 --> 00:08:01,560
Will our Minnesota board be able to solve the more complex maze, too?

116
00:08:01,740 --> 00:08:08,550
After adding an obstacle navigation feature to aid in the analysis in the view of the missile robot

117
00:08:08,550 --> 00:08:09,990
is seen in front of it.

118
00:08:10,830 --> 00:08:16,980
This will give us the on site information of what kind of obstacles our Mr. Robot is navigating around.

119
00:08:18,020 --> 00:08:23,410
What we can be added by just getting a new subscriber to subscribe to the bot camera slash image roll

120
00:08:23,510 --> 00:08:28,460
and passes on this information to the process data more function than inside the process data about

121
00:08:28,460 --> 00:08:28,940
function.

122
00:08:28,940 --> 00:08:35,000
We take that data and convert it to save it to image format and save it inside the body variable.

123
00:08:35,480 --> 00:08:40,790
Then we head on over to the misfolding function where we simply overlay our bot view on the left hand

124
00:08:40,790 --> 00:08:45,140
side of the frame display to have both the top view and the bar view on the same screen.

125
00:08:45,710 --> 00:08:49,430
So we head on over to the terminal, build the project.

126
00:08:50,700 --> 00:08:54,840
And then launch the maze to simulation and once the mate to simulation starts up.

127
00:08:55,790 --> 00:08:57,140
It will run the Mets solver.

128
00:09:01,740 --> 00:09:06,450
So the first output that we get is basically the output of the localization state, that is the MES

129
00:09:06,480 --> 00:09:09,030
occupancy grid shown on top of the screen.

130
00:09:09,420 --> 00:09:12,630
Then you press spacebar and we get the final output.

131
00:09:12,780 --> 00:09:16,140
That is the maze being solved live by our main robot.

132
00:09:16,710 --> 00:09:22,440
And on the left hand side of the screen we have the board view being displayed on on in front of us

133
00:09:23,010 --> 00:09:28,860
and we can also display on the right hand side of the screen the maze reference image that basically

134
00:09:28,860 --> 00:09:34,410
displays the maze in the form reference there that is basically oriented having the maze entry right

135
00:09:34,410 --> 00:09:34,890
on top.

136
00:09:35,370 --> 00:09:40,590
Then the shortest path is this being displayed on this maze reference image in the form of a color line.

137
00:09:41,040 --> 00:09:46,830
And we also have the board location being displayed on the red circle, on the maze reference image.

138
00:09:47,070 --> 00:09:52,170
And the green circle represents the many goals that have already been completed and the audience represents

139
00:09:52,170 --> 00:09:54,960
the winning goal that the board is currently trying to navigate.

140
00:09:55,530 --> 00:10:00,780
So you can see the board is trying to solve this particular maze and it is orienting itself to the next

141
00:10:00,780 --> 00:10:04,110
mini goal that is very far from it and this is why it is moving very fast.

142
00:10:04,740 --> 00:10:10,980
So as it approaches the first of its major obstacle, that is basically a very narrow corridor and this

143
00:10:10,980 --> 00:10:16,560
is a position where it got stuck earlier and let's see if it is able to navigate this time around after

144
00:10:16,560 --> 00:10:18,510
adding an obstacle navigation feature.

145
00:10:19,440 --> 00:10:25,140
So it is approaching the mini goal and this mini Google approach more and more closer to the wall.

146
00:10:25,770 --> 00:10:31,230
So finally, you will see that one of these mini goals is right on top of the wall, and this is why

147
00:10:31,440 --> 00:10:34,230
our may solve board might get stuck at this position.

148
00:10:34,710 --> 00:10:39,300
So you can see the board is turning towards the wall in the left hand side of the screen where you can

149
00:10:39,300 --> 00:10:41,760
see the board view is just seeing the wall at this moment.

150
00:10:42,150 --> 00:10:47,220
And if you look at our simulation, you can see the car is stuck in this particular location.

151
00:10:48,710 --> 00:10:51,590
And it is stuck right over here and it is trying to approach that.

152
00:10:51,700 --> 00:10:52,070
You go.

153
00:10:52,580 --> 00:10:59,600
So let's see if one of our check what Google status is being triggered and the car navigates around

154
00:10:59,600 --> 00:11:01,730
this condition, but it is stuck behind the wheel.

155
00:11:02,090 --> 00:11:07,790
So you can see that a distance of this particular goal is not changing and it is going from 0 to 200.

156
00:11:07,970 --> 00:11:13,360
And if it reaches a 200 counter, then it will simply backpedal and then try to reach the next minute

157
00:11:13,370 --> 00:11:13,600
goal.

158
00:11:14,030 --> 00:11:15,170
Let's see if it does that.

159
00:11:16,010 --> 00:11:22,910
So if it reaches the 200 and you can see the backpedaling starts and the car back pedals until the backpedaling

160
00:11:22,910 --> 00:11:23,990
counter reaches 100.

161
00:11:24,410 --> 00:11:30,320
So it backpedaled, moves in reverse with the same angle that was moving, and then tries to reach the

162
00:11:30,320 --> 00:11:31,010
next minute goal.

163
00:11:31,490 --> 00:11:37,250
So at this moment it is approaching backpedaling for 200 counter and it is backpedaling and then it

164
00:11:37,250 --> 00:11:38,750
will try to reach the next minute goal.

165
00:11:39,290 --> 00:11:42,950
So backpedaling finishes and then it will start approaching its next minute goal.

166
00:11:43,980 --> 00:11:46,380
Well, you can see it is approaching the next minute goal right now.

167
00:11:47,160 --> 00:11:48,530
So if I display them, live me.

168
00:11:48,540 --> 00:11:49,740
Is that what was happening?

169
00:11:50,880 --> 00:11:54,360
So you can see that it is approaching the next minute goal, which is in.

170
00:11:55,310 --> 00:11:56,000
In reverse.

171
00:11:56,150 --> 00:12:00,040
You can see it is making a 180 degree turn to try to approach that eagle.

172
00:12:00,050 --> 00:12:02,180
And you can also observe it on the left hand side.

173
00:12:02,180 --> 00:12:05,070
But you try to.

174
00:12:06,250 --> 00:12:09,750
Hurry, hurry, hurry, hurry, hurry.

175
00:12:09,830 --> 00:12:14,380
So at this moment, it is approaching another very difficult terrain, what it means to navigate around

176
00:12:14,380 --> 00:12:18,490
irregular objects, shark dunes, and not get stuck in this location.

177
00:12:18,910 --> 00:12:25,210
And even if it gets stuck, it needs to get itself free and try to reach the end of this particular

178
00:12:25,210 --> 00:12:25,540
maze.

179
00:12:26,590 --> 00:12:28,420
So it is stuck at this particular location.

180
00:12:28,690 --> 00:12:31,990
And if you what condition is being triggered at this moment?

181
00:12:32,380 --> 00:12:38,620
You can see that the car is stuck at this location and angle is being changing because the car is actually

182
00:12:38,620 --> 00:12:43,750
moving, but its distance is not changing for its incrementing and the goal is also not changing.

183
00:12:43,780 --> 00:12:46,930
So this counter is also going from 0 to 40 at this moment.

184
00:12:48,710 --> 00:12:54,290
So the mini Goulds are very close to the car at this moment and this is why they are being triggered.

185
00:12:54,410 --> 00:12:57,160
And then we try to approach the next to go to.

186
00:12:58,140 --> 00:13:02,080
So at this moment, you can see the car is stuck on this very tight turn and it's trying to approach

187
00:13:02,080 --> 00:13:02,850
to next to go.

188
00:13:03,690 --> 00:13:07,200
So it reorients itself and then tries to approach the next minute go.

189
00:13:08,390 --> 00:13:10,250
But turning towards that particular winning goal.

190
00:13:10,640 --> 00:13:15,440
So it is making a 360 degree turn to orient yourself in the direction of that winning goal.

191
00:13:19,770 --> 00:13:23,050
So you can see on the left hand side the guys approaching the next many goals.

192
00:13:23,340 --> 00:13:25,200
In our screen.

193
00:13:25,920 --> 00:13:26,250
Oops.

194
00:13:29,370 --> 00:13:29,770
She?

195
00:13:31,790 --> 00:13:32,150
She?

196
00:13:35,790 --> 00:13:36,160
I.

197
00:13:39,800 --> 00:13:51,230
Hurry, hurry, hurry, hurry, hurry, hurry, hurry, hurry, hurry, hurry, hurry, hurry, hurry,

198
00:13:51,380 --> 00:13:52,640
hurry, hurry.

199
00:13:54,290 --> 00:13:54,660
She?

200
00:13:55,980 --> 00:13:58,520
So this is the last major obstacle with our God.

201
00:13:58,530 --> 00:14:01,020
We find much difficulty in trying to navigate around.

202
00:14:01,380 --> 00:14:06,490
The problem is that in this particular ball, the winning goal are very close to the ball and it is

203
00:14:06,490 --> 00:14:09,420
a particular card that is on the outside of its structure.

204
00:14:09,630 --> 00:14:11,130
Get stuck on this particular ball.

205
00:14:12,300 --> 00:14:14,710
So let's see which condition gets triggered first.

206
00:14:15,030 --> 00:14:20,220
So whether the goal has not changed for 200 iterations or the distance is not changed for that particular

207
00:14:20,430 --> 00:14:23,160
goal, but 200 iterations of the angle has not changed.

208
00:14:23,760 --> 00:14:28,830
So you can see the goal was not changed for 200 iterations and then it tries to reach the next winning

209
00:14:28,830 --> 00:14:29,100
goal.

210
00:14:29,460 --> 00:14:33,930
So the next trigger next point is being activated and it tries to meet the next minute goal.

211
00:14:34,140 --> 00:14:39,900
And on the right hand side of the screen, you can simply view of the car where the car is at its point

212
00:14:40,110 --> 00:14:41,280
in the shortest part as well.

213
00:14:41,820 --> 00:14:47,170
So it is approaching the shortest path to go and it is navigating around the shortest path, quite remarkably.

214
00:14:47,190 --> 00:14:47,820
I might say.

215
00:14:51,720 --> 00:14:54,690
So it is reorienting itself and then approaching the in goal.

216
00:14:56,550 --> 00:15:01,020
And then you can see its position on the right hand side of the screen and you can see on the left hand

217
00:15:01,020 --> 00:15:08,130
side of the screen, the board view is viewing the miss exit from this far away and it can see the goal

218
00:15:08,190 --> 00:15:08,880
in front of it.

219
00:15:09,240 --> 00:15:09,620
Right.

220
00:15:10,610 --> 00:15:10,940
Hi.

221
00:15:11,810 --> 00:15:12,220
Hi.

222
00:15:13,210 --> 00:15:13,660
Hurry.

223
00:15:14,440 --> 00:15:17,800
Hurry, hurry, hurry, hurry.

224
00:15:19,830 --> 00:15:20,220
Hurry.

225
00:15:20,820 --> 00:15:24,390
Hurry, hurry, hurry, hurry, hurry.

226
00:15:28,350 --> 00:15:28,760
She?

227
00:15:30,610 --> 00:15:30,980
I.

228
00:15:32,180 --> 00:15:34,450
Hurry, hurry, hurry, hurry.

229
00:15:34,760 --> 00:15:41,060
So you can see after the first few hurdles, everything else was a walk in the park for me and store

230
00:15:41,060 --> 00:15:41,360
bought.

231
00:15:41,690 --> 00:15:46,910
So it will just reach all those many goals and then approach the final few, many goals.

232
00:15:47,270 --> 00:15:52,880
And you can see at this moment the total many goals that the car had reached for 299 and it has already

233
00:15:52,880 --> 00:15:54,590
completed a total of eight many goals.

234
00:15:55,040 --> 00:15:59,360
So it is approaching the final few sets of many goals to reach the men's exit.

235
00:15:59,600 --> 00:16:01,130
And let's see if it does their job.

236
00:16:01,790 --> 00:16:03,410
Hurry, hurry, hurry.

237
00:16:04,040 --> 00:16:09,410
So it is approaching the men's exit and can see them is active right in front of it is orienting itself

238
00:16:09,710 --> 00:16:11,330
towards the exit right now.

239
00:16:11,540 --> 00:16:15,410
And you can see it looks a far into the void.

240
00:16:16,010 --> 00:16:19,170
So it is approaching the final minute goal and you can see.

241
00:16:19,820 --> 00:16:22,310
Hurry, hurry, hurry, hurry.

242
00:16:22,640 --> 00:16:25,730
And voila, it is reached the final minute goal.

243
00:16:26,630 --> 00:16:32,120
So indeed the obstacle navigation feature that we incorporated to our main solving what has made it

244
00:16:32,300 --> 00:16:39,110
solve the more complex me as to and made our may solver bought a much more reliable option for solving

245
00:16:39,110 --> 00:16:39,590
mazes.

246
00:16:39,980 --> 00:16:41,750
So that's it for today.

247
00:16:42,140 --> 00:16:42,710
Then, then.

248
00:16:43,220 --> 00:16:43,580
But.
