1
00:00:00,870 --> 00:00:03,380
Welcome to the Robotics Simulation project.

2
00:00:03,390 --> 00:00:06,270
It's time to sum up everything we've learned in this section.

3
00:00:06,300 --> 00:00:11,820
Now, I hope you have a good memory because the robot we are creating in this project is the example

4
00:00:11,820 --> 00:00:16,530
robot I used in my animations to help you understand what Ros is.

5
00:00:16,800 --> 00:00:23,520
The robot had a rectangular base with four wheels and a rod which protruded upward to hold up a camera.

6
00:00:23,550 --> 00:00:29,040
So in this project you are tasked with recreating this robot in a simulation so that you can drive it

7
00:00:29,040 --> 00:00:33,960
around the virtual environment and look at images coming in from the camera.

8
00:00:34,320 --> 00:00:40,020
Your final result should be a single launch file, which, when launched, will open up Ignition gazebo

9
00:00:40,020 --> 00:00:43,950
with this robot model, which you can then control over Ros.

10
00:00:44,400 --> 00:00:46,050
Let's break down this project.

11
00:00:47,650 --> 00:00:52,150
In this project, you will be creating a world and model SDF files.

12
00:00:52,240 --> 00:00:58,030
This model PSD file will contain everything needed to create the robot for this project, which is the

13
00:00:58,030 --> 00:00:59,710
wheeled robot with a camera.

14
00:01:00,250 --> 00:01:05,020
Remember that you can create the general model of the robot within Gazebo Classics Model Editor.

15
00:01:05,630 --> 00:01:11,990
Now your file should be configured such that the camera is a sensor which can transmit an image stream

16
00:01:11,990 --> 00:01:17,270
and that we are able to control the wheels of the robot so we can drive it around within the simulation.

17
00:01:17,940 --> 00:01:23,250
Then of course, you should create a launch file which starts up the ignition simulation with your world

18
00:01:23,250 --> 00:01:30,720
SDF file and then bridges the topics between ignition and Ros, too, so we can control the simulation

19
00:01:30,720 --> 00:01:31,740
over Ros.

20
00:01:32,350 --> 00:01:38,530
So essentially, when you run your launch file in terminal, you should see the simulation open up with

21
00:01:38,530 --> 00:01:40,420
your world and robot model.

22
00:01:40,570 --> 00:01:46,840
We then should be able to interact with it over ROS so we can create our ROS nodes or use tools like

23
00:01:46,850 --> 00:01:51,760
RCT to easily control the robot and process the image data.

24
00:01:53,800 --> 00:01:54,160
All right.

25
00:01:54,160 --> 00:01:55,810
This project is going to take some time.

26
00:01:55,840 --> 00:02:01,120
Simulations are complex and tedious, so don't get impatient with yourself if it feels like it's taken

27
00:02:01,120 --> 00:02:01,840
a while.

28
00:02:01,930 --> 00:02:02,560
Of course.

29
00:02:02,560 --> 00:02:07,930
Be sure to leverage all the code we've created in the previous lectures as we've created all the functionality

30
00:02:07,930 --> 00:02:11,020
needed for this project in chunks throughout this course.

31
00:02:11,290 --> 00:02:14,980
And feel free to rewatch some of those lectures if you are feeling lost.

32
00:02:15,400 --> 00:02:17,830
But with that, give this project a go.

33
00:02:26,620 --> 00:02:27,040
All right.

34
00:02:27,040 --> 00:02:27,790
How'd it go?

35
00:02:27,940 --> 00:02:33,040
Hopefully it was exciting to create a robot, which you could interact with in your simulation, which

36
00:02:33,040 --> 00:02:38,080
also sent back simulated data from the simulation as if it was a real robot.

37
00:02:38,380 --> 00:02:41,800
I'm going to go ahead and show you my approach in this walkthrough.

38
00:02:43,370 --> 00:02:46,610
So the first thing I need to do is create the robot model.

39
00:02:46,610 --> 00:02:49,880
So I will do this in Gazebo Classics Model editor.

40
00:02:53,560 --> 00:03:01,000
Once here I will create the chassis, which will be a cube that I will size to be x equals 1y0 point

41
00:03:01,000 --> 00:03:06,670
5z0 .25 metres and I'll place it near the origin like so.

42
00:03:16,780 --> 00:03:19,000
Then I'll go ahead and create my wheel.

43
00:03:47,820 --> 00:03:51,360
Which I can then duplicate to include each side.

44
00:04:24,340 --> 00:04:29,800
Now when I do my control for the wheels, rather than having two sets of driving wheels, I'm just going

45
00:04:29,800 --> 00:04:34,060
to have the front wheels be the ones which drive around.

46
00:04:34,090 --> 00:04:40,540
This means I should reduce the friction on the back wheels so that my robot can easily make turns.

47
00:04:40,540 --> 00:04:46,000
So I can do that by going into the back wheels, link descriptions and the collision model and setting

48
00:04:46,000 --> 00:04:50,410
mu one and mu two of the wheels 2.1.

49
00:04:53,370 --> 00:04:56,220
Then I will make the rod which holds the camera.

50
00:05:25,490 --> 00:05:30,680
Now I will make the box which goes on top of the rod that acts as the camera.

51
00:05:30,710 --> 00:05:33,320
It is worth noting by default, the camera plugin.

52
00:05:33,320 --> 00:05:39,590
I will be using faces towards the positive x axis, so I'll need to make sure the x axis of the cube

53
00:05:39,590 --> 00:05:41,840
faces towards the front of my robot.

54
00:05:57,550 --> 00:05:59,020
And now it's time for the joints.

55
00:05:59,020 --> 00:06:06,900
I will join together my front wheels first and go from left to right and choose the Z joint access.

56
00:06:06,910 --> 00:06:13,000
I could set the back wheels as fix since I lowered their friction and they will just be sliding on the

57
00:06:13,000 --> 00:06:13,540
ground.

58
00:06:13,540 --> 00:06:19,150
But I will leave them as resolute in case I want to change how I control this robot later in the future.

59
00:06:28,750 --> 00:06:30,490
Now I will join the camera.

60
00:06:30,490 --> 00:06:32,020
Rhod, to the base.

61
00:06:36,450 --> 00:06:42,900
And last but not least, I'll need to join this camera box to the camera rod as a fixed joint.

62
00:06:48,100 --> 00:06:51,460
With that out of the way, I can go ahead and save my model.

63
00:06:54,120 --> 00:06:59,070
I'll go ahead and save it as project robot model and exit the model editor.

64
00:07:03,250 --> 00:07:05,770
This will save the model in our home directory.

65
00:07:05,770 --> 00:07:12,820
So in the model editor models folder and here we have the project robot model that we just created with

66
00:07:12,820 --> 00:07:15,940
our corresponding model that SDF and config file.

67
00:07:16,030 --> 00:07:24,190
So I'm just going to go ahead and open up another tab and throw this into our package models folder.

68
00:07:28,740 --> 00:07:33,270
So now let's go ahead and continue editing this model within VTS code.

69
00:07:33,810 --> 00:07:40,470
So here under models, I have my project robot model, so we'll open up the model SDF file for it.

70
00:07:40,470 --> 00:07:46,980
And just a reminder that if you're getting this red text, you can instead set the HTML to XML syntax

71
00:07:46,980 --> 00:07:49,110
and that will fix it accordingly.

72
00:07:49,200 --> 00:07:55,410
For clarity sake, I'll rename link zero to chassis link, rename my wheels and joints so I know where

73
00:07:55,410 --> 00:08:00,960
they are on my robot chassis as well as name my camera rod link and camera link.

74
00:08:46,920 --> 00:08:51,390
So with the link renaming out of the way, I can go ahead and copy and configure the diff drive plugin

75
00:08:51,390 --> 00:08:54,630
from our wheeled model model on file.

76
00:08:54,630 --> 00:09:02,130
So here at the bottom of our model we had the diff drive plug in configuring our left and right wheel

77
00:09:02,130 --> 00:09:02,550
joints.

78
00:09:02,550 --> 00:09:04,380
So I'll just go ahead and copy that.

79
00:09:08,340 --> 00:09:11,790
And we will place it near the end of our robot model.

80
00:09:13,990 --> 00:09:17,350
And now I'll go ahead and rename these joints.

81
00:09:51,410 --> 00:09:51,540
Yeah.

82
00:10:06,510 --> 00:10:15,410
And for this case, I believe my wheel separation was 0.62 and my wheel radius was 0.25.

83
00:10:15,420 --> 00:10:21,360
And I'll go ahead and configure the topic to just be command velocity by default.

84
00:10:25,900 --> 00:10:31,770
Then I can go ahead and copy the camera plugin contents from our test world that we had done earlier.

85
00:10:34,140 --> 00:10:37,520
So here we have these sensor tags configuring our camera.

86
00:10:37,530 --> 00:10:44,610
So I'll just go ahead and copy this and place this within our camera link model.

87
00:10:46,920 --> 00:10:47,850
Which is right here.

88
00:10:47,850 --> 00:10:51,000
So I'll go ahead and plug this at the end of this link.

89
00:10:55,290 --> 00:10:55,650
All right.

90
00:10:55,650 --> 00:10:56,250
That should be good.

91
00:10:56,250 --> 00:11:01,560
Let's go ahead and save this and create a world file for this simulation.

92
00:11:01,950 --> 00:11:07,310
So I'll go ahead and call this simulation project World SDF.

93
00:11:10,220 --> 00:11:16,580
And I'll take our wheeled model world from earlier in the section and paste the contents here.

94
00:11:16,580 --> 00:11:23,660
And instead of including our wheeled model, we will be including our project robot model, which should

95
00:11:23,660 --> 00:11:28,020
match the name of this particular folder within our model's directory and our robots.

96
00:11:28,040 --> 00:11:33,230
A little bit shorter this time, so I'll set the post to 0.4 offset off the z axis.

97
00:11:33,380 --> 00:11:36,620
All right, let's save this file and test to see what we have so far.

98
00:11:36,710 --> 00:11:40,250
So go ahead and rebuild our workspace to include these new models.

99
00:11:44,220 --> 00:11:44,910
All right.

100
00:11:46,810 --> 00:11:51,370
Now I can go back to terminal and be sure to source my models directory.

101
00:11:59,530 --> 00:12:04,540
Then I can go ahead and launch the ignition gazebo simulation with this project world.

102
00:12:12,120 --> 00:12:12,450
All right.

103
00:12:12,450 --> 00:12:13,320
So let's go ahead and open.

104
00:12:13,320 --> 00:12:21,540
Then we can see our wheeled project model here on our blue ground plane, and then I can go ahead and

105
00:12:21,540 --> 00:12:23,970
double check that features like our camera are working.

106
00:12:23,970 --> 00:12:27,000
So go ahead and check the topics that are in ignition.

107
00:12:28,650 --> 00:12:35,520
And again, if you ever needed more information about a topic, you can do again, topic, info, topic

108
00:12:35,520 --> 00:12:38,010
and the name of the particular topic.

109
00:12:38,610 --> 00:12:45,030
So in this case, my camera ignition topic has a message type of ignition dot messages dot image which

110
00:12:45,030 --> 00:12:49,130
may be useful for us in a bit when we go to create our launch file.

111
00:12:49,140 --> 00:12:54,990
So let's go ahead and make that so that we can run this simulation using a single launch file instead

112
00:12:54,990 --> 00:13:02,220
of having to export our model environment and launch our simulation and any other nodes from scratch.

113
00:13:03,090 --> 00:13:10,260
So I'll create a new launch file and I'll just call this simulation underscore project launch dot pie,

114
00:13:11,850 --> 00:13:16,560
and we can just copy over our simulation launch file we made in the previous lecture.

115
00:13:18,040 --> 00:13:22,480
With the only difference being we all need to change the path of our world file.

116
00:13:22,480 --> 00:13:26,080
In this case, we're using this simulation project world that SDF.

117
00:13:35,290 --> 00:13:40,060
And then scrolling down further, I had simplified the name of the topic.

118
00:13:41,230 --> 00:13:45,480
In our project robot model to instead be just command velocity.

119
00:13:45,490 --> 00:13:46,870
So if I scroll all the way down.

120
00:13:47,710 --> 00:13:50,860
We see I changed the mapping to just be command.

121
00:13:50,860 --> 00:13:55,300
Vell, instead of that model's wheeled model type of format.

122
00:13:55,960 --> 00:13:57,850
So I actually don't need to do the remapping here.

123
00:13:57,850 --> 00:14:03,370
Instead, I do have to change the arguments here, so the ignition topic name should now be just command

124
00:14:03,370 --> 00:14:04,000
Vel.

125
00:14:04,870 --> 00:14:07,600
And then we don't need to remap anything here.

126
00:14:07,600 --> 00:14:09,730
So I'll just go ahead and delete those lines for now.

127
00:14:09,970 --> 00:14:13,470
But I will have to map my camera as well.

128
00:14:13,480 --> 00:14:16,600
So to do that, I'll simply add another entry to this list.

129
00:14:24,280 --> 00:14:24,640
All right.

130
00:14:24,640 --> 00:14:30,850
So again, this time we're taking the sensor messages image Ros message type, and we're bridging it

131
00:14:30,850 --> 00:14:38,110
from the ignition messages, image message type, which we saw was the message type of our particular

132
00:14:38,110 --> 00:14:39,550
camera topic here.

133
00:14:40,840 --> 00:14:44,260
And actually I will include the remapping argument for right now.

134
00:14:47,820 --> 00:14:53,460
And for this case, I'm actually going to remap the camera topic to match something more suitable towards

135
00:14:53,460 --> 00:14:58,860
what you would see in Ross, which would generally be camera slash, image underscore, raw to know

136
00:14:58,860 --> 00:15:02,820
that this should be the topic which the raw images are coming over.

137
00:15:03,150 --> 00:15:07,920
And of course, if I wanted to, I could have instead change the topic name within our model PSD file

138
00:15:07,920 --> 00:15:10,890
when we were working with our camera joint.

139
00:15:12,130 --> 00:15:16,450
So I could have changed the topic name here, but I'll just keep this in for now so that we have an

140
00:15:16,450 --> 00:15:21,130
example of remapping topics within this example launch file.

141
00:15:21,130 --> 00:15:26,080
So I'll go ahead and save this and rebuild it so that this new launch file gets included.

142
00:15:26,950 --> 00:15:27,610
All righty.

143
00:15:27,790 --> 00:15:30,400
So now let's run the simulation using the launch file.

144
00:15:31,510 --> 00:15:33,460
So I'll go ahead and clear some of these screens.

145
00:15:37,120 --> 00:15:39,400
Now, of course, first we have to source our workspace.

146
00:15:44,570 --> 00:15:47,240
And then run the simulation project launch file.

147
00:15:55,040 --> 00:15:55,340
All right.

148
00:15:55,340 --> 00:15:57,320
So this has gone ahead and started.

149
00:15:57,320 --> 00:16:01,640
And now if I go into my second window and do Ross two topic list.

150
00:16:03,430 --> 00:16:08,770
We will see our command velocity topic as well as the image raw camera stream coming out.

151
00:16:08,770 --> 00:16:11,950
So of course if we wanted to interact with this, I could open up our.

152
00:16:16,570 --> 00:16:19,660
And I'll keep this simulation window open here on the side.

153
00:16:24,610 --> 00:16:27,550
And I will open a new plugin for the image view.

154
00:16:30,540 --> 00:16:34,380
So here we can control the direction which our robot drives.

155
00:16:34,380 --> 00:16:38,220
And here we can see a camera view of what our robot is driving here.

156
00:16:38,220 --> 00:16:42,900
So I'll just add some things to our scene just to add a little bit of.

157
00:16:44,100 --> 00:16:46,200
Context as to where we are.

158
00:16:50,850 --> 00:16:56,820
And so now I can go ahead and drive around a bit and publish this by clicking the checkmark.

159
00:16:58,930 --> 00:17:00,370
Well, it's a bit too slow.

160
00:17:02,420 --> 00:17:03,830
And there we go.

161
00:17:03,830 --> 00:17:07,010
We now see our robot is turning slowly.

162
00:17:08,480 --> 00:17:15,830
Although notice this issue here where the robot chassis is spinning slowly, but our camera rod and

163
00:17:15,830 --> 00:17:19,550
camera link are actually keeping about the same position.

164
00:17:20,410 --> 00:17:25,990
So this is definitely a weird interaction that you probably weren't expecting, and this has to do with

165
00:17:25,990 --> 00:17:27,790
our physics simulation engine.

166
00:17:27,790 --> 00:17:33,310
So essentially this is a joint and we never really provided much friction elements for it or dampening.

167
00:17:33,310 --> 00:17:39,190
So it's just freely spinning around here, assuming that there is no type of normal friction or static

168
00:17:39,190 --> 00:17:42,750
connection like we might assume this robot might have.

169
00:17:42,760 --> 00:17:44,740
So I do want to keep this joint as a joint.

170
00:17:44,740 --> 00:17:46,810
I don't want to fix it and keep it static.

171
00:17:47,440 --> 00:17:52,930
So if I head back over to my Visual Studio code, I'll actually just search for damping.

172
00:17:54,430 --> 00:17:57,400
And here we see several of them pop up.

173
00:17:57,400 --> 00:18:00,160
And if we scroll down, we should find.

174
00:18:01,140 --> 00:18:08,190
Where our chassis connects to our camera rod link and I will just increase this dampening to something

175
00:18:08,220 --> 00:18:10,560
say along of 0.6.

176
00:18:11,100 --> 00:18:16,380
And of course you could set other dynamic settings such as the spring stiffness and you can even specify

177
00:18:16,380 --> 00:18:19,590
your coefficients of friction within the link itself.

178
00:18:19,590 --> 00:18:20,610
But this should do for now.

179
00:18:20,610 --> 00:18:22,740
So if I go ahead and save this.

180
00:18:25,580 --> 00:18:27,260
And we will close the simulation.

181
00:18:27,270 --> 00:18:32,240
And so the changes should have automatically taken effect since we've used Simulink install.

182
00:18:33,500 --> 00:18:35,780
So if I go ahead and rerun this.

183
00:18:38,630 --> 00:18:39,980
We're still publishing our message.

184
00:18:39,980 --> 00:18:46,310
So our robot begins spinning, but we see the camera head stays attached so I can put objects in my

185
00:18:46,310 --> 00:18:54,110
environment again, and we can see them in our field of view as the robot travels around.

186
00:18:59,860 --> 00:19:05,950
Oh, it does seem I made a mistake here in terms of which way is forward and which way is backwards.

187
00:19:06,520 --> 00:19:08,710
So I'll go ahead and fix that as well.

188
00:19:09,860 --> 00:19:15,680
So this most likely has to do with the fact that I switched the axis when I set my joints.

189
00:19:15,680 --> 00:19:18,290
I was supposed to set it to negative Z.

190
00:19:18,500 --> 00:19:21,130
But instead I had set it at positive Z.

191
00:19:21,140 --> 00:19:27,230
So if we actually look at the Axis for this joint, it says 001.

192
00:19:27,230 --> 00:19:32,810
And what I'm actually going to do here is set this to negative one for both the front left and front

193
00:19:32,810 --> 00:19:34,160
right wheel joint.

194
00:19:34,160 --> 00:19:39,380
So now if I go ahead and save this, we run our simulation.

195
00:19:43,700 --> 00:19:48,650
And now we're actually driving forward, as we expect that I'm turning a little bit here because I still

196
00:19:48,650 --> 00:19:52,400
have a Z attribute to our angular velocity.

197
00:19:59,810 --> 00:20:03,510
But here we see that our simulation is working properly.

198
00:20:03,530 --> 00:20:11,060
We have a world file which we built with our robot model that we created in Gazebo Classic and then

199
00:20:11,060 --> 00:20:13,820
placed into our ignition gazebo simulation.

200
00:20:13,850 --> 00:20:16,520
Now, I can actually take the simulation one step further.

201
00:20:16,520 --> 00:20:22,940
So remember, I created a joint here between our chassis and camera rod because I would be ideal if

202
00:20:22,940 --> 00:20:25,520
we could actually control this on our robot.

203
00:20:25,520 --> 00:20:28,880
So if we had a motorized base and the camera could turn.

204
00:20:28,880 --> 00:20:33,440
So let's take advantage of this joint using what's called the joint position controller.

205
00:20:33,440 --> 00:20:38,030
Joint controller plug ins are great as general purpose use cases to control your joints.

206
00:20:38,030 --> 00:20:44,600
Say if you had a motorized joint, we can get an example of this from the examples Ignition Gazebo provides.

207
00:20:44,600 --> 00:20:48,080
Specifically the joint position controller SDF file.

208
00:20:52,870 --> 00:20:56,650
You could check out this file in the simulation, but I think it will be easier just to show you how

209
00:20:56,650 --> 00:20:59,080
this plugin works in the context of this project.

210
00:20:59,470 --> 00:21:01,420
So I'm just going to head to the bottom of the file.

211
00:21:02,200 --> 00:21:05,910
And here we see a plugin before the closing model tag.

212
00:21:05,920 --> 00:21:12,460
The plugin takes in the joint, name a topic and then you can configure and put limits on a PID controller,

213
00:21:12,460 --> 00:21:17,950
which is a common controller in robots and automated machines to change the signal, which sends motion

214
00:21:17,950 --> 00:21:20,080
commands in a fluid controlled manner.

215
00:21:20,260 --> 00:21:27,310
For now, I'm just going to copy and paste it into my robot model SDF file after my drive, plug in

216
00:21:27,310 --> 00:21:31,330
and change the joint name, which in this case mines is camera rod joint.

217
00:21:31,570 --> 00:21:35,470
And I'll just change the topic name to camera rod, position command.

218
00:21:35,950 --> 00:21:38,290
And I'll just leave the PID values as is.

219
00:21:39,460 --> 00:21:45,370
And let me just confirm that this is indeed the joint name camera, joint.

220
00:21:45,370 --> 00:21:47,620
So let's go ahead back into our joints and check.

221
00:21:47,620 --> 00:21:52,030
So here is where the chassis connects to the camera rod link.

222
00:21:52,030 --> 00:21:57,910
So I will change this joint name to make more sense to camera rod joint.

223
00:22:01,200 --> 00:22:01,650
All righty.

224
00:22:01,650 --> 00:22:02,580
So that things match up.

225
00:22:02,580 --> 00:22:04,650
So I'll go ahead and save this file.

226
00:22:05,490 --> 00:22:11,910
And now we need to bridge this camera rod position command topic from ignition gazebo to Ros.

227
00:22:11,910 --> 00:22:14,120
So I'll add it to my launch file.

228
00:22:14,130 --> 00:22:18,150
If we actually go back to the joint position controller, SDF all the way at the top.

229
00:22:18,150 --> 00:22:22,560
It has instructions for us, so it tells us what gazebo message type this plugin uses, which in this

230
00:22:22,560 --> 00:22:24,000
case is double.

231
00:22:24,000 --> 00:22:29,790
Now Ros does not have a double message type, but the equivalent is a float 64 message type from the

232
00:22:29,790 --> 00:22:31,320
standard messages package.

233
00:22:32,190 --> 00:22:34,560
So I'll just go ahead and copy this.

234
00:22:36,840 --> 00:22:42,840
And then in our launch file, we'll add one more argument to our ignition bridge.

235
00:22:46,530 --> 00:22:53,940
So this is the ignition topic name I specified here in our model that file camera, rod, position,

236
00:22:53,940 --> 00:23:00,180
command, and then we're going to convert this over to standard messages.

237
00:23:00,180 --> 00:23:06,510
Float 64 from the ignition messages, double message type.

238
00:23:06,510 --> 00:23:10,950
With that, I can save these files and restart the simulation.

239
00:23:19,730 --> 00:23:20,020
All right.

240
00:23:20,020 --> 00:23:22,250
So that's gone ahead and opened as normal.

241
00:23:22,430 --> 00:23:27,890
So I'll go ahead and place some objects again, just to add some variety.

242
00:23:32,210 --> 00:23:34,490
And I will stop our robot from turning.

243
00:23:36,020 --> 00:23:38,330
All right, so we're faced this way towards the sphere.

244
00:23:38,600 --> 00:23:42,500
And now I can go ahead and refresh my topics.

245
00:23:42,890 --> 00:23:46,880
Go down and let me expand this a little bit so we can see better.

246
00:23:47,420 --> 00:23:50,660
And we are interested in this camera rod position topic.

247
00:23:56,330 --> 00:23:57,800
Whoops, I made a typo here.

248
00:23:57,800 --> 00:23:59,540
This should be camera position command.

249
00:24:03,580 --> 00:24:05,500
Let's go ahead and save that.

250
00:24:05,710 --> 00:24:07,030
Try this one more time.

251
00:24:21,650 --> 00:24:21,980
All right.

252
00:24:21,980 --> 00:24:26,810
So I've added those objects and now we can go camera rod, position, command.

253
00:24:28,180 --> 00:24:30,040
And I'll go ahead and add that.

254
00:24:31,390 --> 00:24:33,910
And we just have this simple data attribute.

255
00:24:34,390 --> 00:24:39,910
So if I set that to a particular position in Radiance, so let's say I want to turn 90 degrees, that

256
00:24:39,910 --> 00:24:42,730
would be about 1.57 radiance.

257
00:24:43,900 --> 00:24:52,640
So if I publish this, we see the camera goes and turns towards this elliptical figure here.

258
00:24:52,660 --> 00:24:57,520
And of course, we could change that to -1.57 radians and it'll turn.

259
00:24:59,180 --> 00:25:00,860
He'll turn out 90 degrees from the normal.

260
00:25:00,860 --> 00:25:03,380
So it turns around and we can see the ball.

261
00:25:03,380 --> 00:25:06,200
And of course, you can have different degree measurements here.

262
00:25:06,200 --> 00:25:11,480
So we can do about 45 degrees, which is about 0.78 radians.

263
00:25:13,780 --> 00:25:17,680
And we see here our sphere next to our cylinder.

264
00:25:17,710 --> 00:25:22,330
Now notice it kind of wobbles a bit back and forth whenever I change these values.

265
00:25:22,330 --> 00:25:26,830
And that just has to do with your PID controller and how it's trying to do the dampening.

266
00:25:26,830 --> 00:25:33,820
So you can always change the dampening in the joint as well as play with your ID values of your controller

267
00:25:33,820 --> 00:25:35,880
to smooth that out if you want it to.

268
00:25:35,890 --> 00:25:41,410
But with that we've successfully created a simulation of a robot which utilizes plug ins to command

269
00:25:41,410 --> 00:25:45,640
our robot and receive simulated sensor data over ROS.

270
00:25:46,450 --> 00:25:51,310
Well, hopefully you got similar results than I did and were able to successfully interact with your

271
00:25:51,310 --> 00:25:53,530
robot and ignition gazebo using Ros.

272
00:25:53,530 --> 00:25:57,520
So congratulations on applying what you've learned in this section.

273
00:25:57,760 --> 00:26:03,640
Now, this was a relatively simple simulation and our robot clearly doesn't have much purpose in the

274
00:26:03,650 --> 00:26:08,560
simulation or any other ROS nodes to give it a higher level of autonomy.

275
00:26:08,920 --> 00:26:13,240
Well, believe it or not, we've been creating a lot of functionality throughout this course which could

276
00:26:13,240 --> 00:26:16,030
be incorporated into this simulated robot.

277
00:26:16,420 --> 00:26:22,000
We created a publisher to simulate a wheel encoder so we could calculate the robot's speed.

278
00:26:22,270 --> 00:26:27,220
We created service requests to have the robot return a picture after turning its head by the requested

279
00:26:27,220 --> 00:26:33,850
amount of degrees, and we even implemented in action server to take in to navigate to a point of interest.

280
00:26:34,330 --> 00:26:38,860
Also, if you remember in the ROS Framework animation video, I also mentioned the wheeled robot had

281
00:26:38,860 --> 00:26:40,870
an IMU and Jeep's sensor.

282
00:26:40,870 --> 00:26:45,820
So how could implementing these sensors within simulation help you out with your navigation?

283
00:26:46,780 --> 00:26:52,960
So as an extra credit and a potential project to show off to job recruiters, I encourage you to create

284
00:26:52,960 --> 00:26:58,930
an entirely new ROS package which will contain all the files needed for a simulation environment similar

285
00:26:58,930 --> 00:27:05,830
to the one we just created, but with additional sensors and ROS nodes to help add to the robot's autonomous

286
00:27:05,830 --> 00:27:06,730
functionality.

287
00:27:07,180 --> 00:27:12,850
You could send commands through RCT or implement your own terminal command line interface to have the

288
00:27:12,850 --> 00:27:15,430
robot execute customizable routines.

289
00:27:15,880 --> 00:27:21,190
If you decide to go down this route, I encourage you to check for ROS packages the community has developed,

290
00:27:21,190 --> 00:27:27,760
which may help, such as the robot localization package for using sensor data to more accurately determine

291
00:27:27,760 --> 00:27:34,300
where your robot is, as well as the navigation to set of ROS to packages for implementing complex path

292
00:27:34,300 --> 00:27:35,530
planning features.

293
00:27:36,100 --> 00:27:41,020
Now that you know how to create simulations, it's time for you to really start putting your robotics

294
00:27:41,020 --> 00:27:47,110
problem solving skills to the test, leveraging what you've learned in this course and from the amazing

295
00:27:47,110 --> 00:27:48,280
ROS community.

296
00:27:48,490 --> 00:27:55,150
So try to challenge yourself and see just how complicated creating robust robotic software in realistic

297
00:27:55,150 --> 00:27:56,830
scenarios can be.

298
00:27:57,340 --> 00:27:58,090
Good luck.
