In this lecture we will be learning how to install ROS 2 2 2
Foxy on Windows 10. 3 3
This is a fresh install of Windows 10, so I have nothing 4 4
except the default programs installed. With a browser open, 5 5
I will navigate to the ROS Foxy Installation page. 6 6
Once here I will Select the Windows option under the Binary 7 7
Packages section. 8 8
Please be careful as to not Select the Windows option in 9 9
the Build from Source section, as building rows two from Source 10 10
can take several hours to compile. 11 11
There are three main steps to installing ROS 2 on our 12 12
Windows machine, installing prerequisites, installing ROS2 13 13
and setting up our environment. 14 14
The first is installing our prerequisites. 15 15
The first prerequisite is a package manager called Choco. 16 16
We can head over to the website. 17 17
In this case I will right click on it and open the link in 18 18
a new tab. 19 19
Navigate to the Install Now button, and then we will need 20 20
to run commands in Windows PowerShell with administrative 21 21
privileges, so I'll go ahead and right click on the Windows 22 22
logo in the bottom left of the screen and hit Windows PowerShell 23 23
admin. You will be prompted to allow the app to make changes 24 24
to your device. 25 25
Hit Yes. Now this part is optional, but the blue background 26 26
of the Power shell with the white text can be hard to look 27 27
at. I'll right click on the top bar of the Power Shell. 28 28
Select Properties... 29 29
Go to the Color tab and with screen background selected I 30 30
will choose the black background color and Hit OK. Now for 31 31
this to take effect, I will clear the screen, and now we can 32 32
see our new PowerShell color, which is now a black background 33 33
with white text which is generally easier to see for students. 34 34
Now we will run this command to install our Choco Package 35 35
Manager, so I'll hit the copy to Clipboard button and then 36 36
to paste it into our PowerShell simply right click and it 37 37
pastes the command into it. 38 38
You can go ahead and hit Enter. 39 39
For the most part we can disregard most of the warning messages 40 40
which appear you can check to see if it is installed by running 41 41
the Choco command and here in green text we can see we are 42 42
running Choco version 10.15. 43 43
Don't worry if your version is slightly different than mine. 44 44
Next we'll move on to installing Python. 45 45
So within our Power shell we will now run this command to 46 46
use our Choco Package Manager, which we just installed to 47 47
install version 3.83 of Python. 48 48
First, I'll just clear the screen and we will right click 49 49
to paste the command. 50 50
Hit Enter and we can see that it's now installing Python. 51 51
Please note that if you have another version of Python or 52 52
an Environment Manager like Anaconda installed, these installation 53 53
versions may conflict with each other. 54 54
Alright, our Python 3 has been installed and we can double 55 55
check by closing this PowerShell and opening a new one and 56 56
typing in Python --version. 57 57
And here we can see our Python is version 3.83. 58 58
You can also verify that Python was installed in the correct 59 59
directory by opening our File Explorer going to this PC going 60 60
into our C drive and we can see our Python 38 folder. 61 61
Now we will install our C redistributable with this command, 62 62
so I'll right click in our Power shell and enter and after 63 63
a while we can see it has downloaded and installed next we 64 64
will move on to installing Open SSL. 65 65
I'll right click on the link here and head over to that tab. 66 66
Scroll down to the download section. 67 67
Do not download the light version. 68 68
Make sure to get the full version of Open SSL, which is here 69 69
is the second entry so I will Select the link to download. 70 70
Once the EXE is downloaded, we can go ahead and run it by 71 71
clicking on it. 72 72
I will be prompted to allow this app to make changes to our 73 73
device will hit. 74 74
Yes, we will go ahead and accept the license agreement and 75 75
then leave the destination folder as a default. 76 76
Hit next. 77 77
Hit next and we will hit install. 78 78
Okay, great. 79 79
So we finished installing Open SSL. 80 80
I'll Uncheck the donation tab and Hit finish and so now that 81 81
it is installed, we have to set up our environment and path 82 82
variables. To set up our Environment variable. 83 83
I will run this command here. 84 84
Control C and I will go ahead and clear the terminal so you 85 85
can see what I'm currently doing. Then right click, hit Enter, 86 86
and it's a success. 87 87
Our specified value is saved. 88 88
Then in the Windows Search bar search for Environment variables 89 89
in the Advanced tab, click the Environment Variables button 90 90
towards the bottom 91 91
right 92 92
Then in the System Variable section we will click on our 93 93
path and we will click on Edit. 94 94
We will create a new entry within our Environment valuable 95 95
list and we will copy our installation of our Open SSL, which 96 96
is right here. 97 97
We can copy it using Control C, and under our new tab, Control 98 98
V and we paste it in. In case you need to confirm that this 99 99
is indeed the location of our Open SSL can open a File Explorer, 100 100
go to this PC local disk program files Open SSL and we can 101 101
indeed see that the file locations match. 102 102
I'll go ahead and hit 103 103
Okay on both Windows... or all three Windows. 104 104
Next we will install Visual Studio 2019. 105 105
I will not be using Visual Studio as a code editor, but ROS 106 106
needs all the Visual C features that come with it so we will 107 107
head over to the download page. 108 108
I can go ahead and close our Open SSL web page and we will 109 109
download the free community edition of Visual Studio 2019. 110 110
So click on the download button and we can see that it begins 111 111
downloading. Once it finishes downloading, we can go ahead 112 112
and launch. Allow the app to make changes. 113 113
Hit continue and it will begin downloading. When we get to 114 114
the workload section, 115 115
you will Select the desktop development with C++ 116 116
option in the right. 117 117
We can configure what gets installed to go along with this 118 118
desktop development. 119 119
We will Uncheck the C Make tools for Windows as we will 120 120
be installing CMake later on manually. 121 121
With that I will go ahead and Hit install and Visual Studio 122 122
will begin downloading and installing our packages. 123 123
This installation will take a while, so feel free to pause 124 124
the video and come back once it finishes installing on your 125 125
machine. Okay with that, our Visual Studio is installed. 126 126
I'll go ahead and close this. 127 127
Go ahead and exit Visual Studio. 128 128
We close the download tab and go on to the next step. 129 129
We will not use other DDS implementations in this course 130 130
so we can skip this step and move on to installing Open CV. 131 131
Opencv is a popular computer vision framework, and we will 132 132
be using it in the Services project. 133 133
We will go ahead and download the pre compiled version of 134 134
Open CV from the provided link. 135 135
This download may take a while, depending on your Internet 136 136
speed. All right, with that we can go ahead and click on 137 137
it show and folder and so here we can see it in our Downloads 138 138
folder so we'll have to unzip. Open ... which we can do 139 139
by right clicking on the file and selecting the Extract All 140 140
option. We will extract it here in our Downloads folder so 141 141
I'll just hit extract. 142 142
Once it finishes extracting, we will take the Open CV folder 143 143
and copy it over to our C drive directory so I'll click on 144 144
the folder, copy it with Control C then in the left pane 145 145
under my PC, click on my local disk C drive and simply paste 146 146
it right here so that now we have our Open CV folder in our 147 147
directory which is mentioned within the install directions. 148 148
Now we will have to set our environment variable, so we'll 149 149
go ahead and copy this command and I will paste it into our 150 150
power shell by right clicking. 151 151
We can see that our specified value is safe and then we will 152 152
again have to go into our environment variables, select Path 153 153
and System Variables edit and this time we will add our Open 154 154
CV bin directory to our path environment variable. 155 155
So I hit new and paste this in like So and hit OK on all 156 156
the Windows. 157 157
Now we can go ahead and install other ROS dependencies, 158 158
so the first one we'll be installing is our Cmake, so we will 159 159
do Choco install Cmake, which I can do by pasting into this power 160 160
shell, then hit enter. If you end up with an error stating that 161 161
CMake can not be found, 162 162
That simply means you need to restart your power shell, so 163 163
I'll go ahead and close this one that we have. 164 164
I'll right click on Windows, 165 165
Click Windows PowerShell Admin. 166 166
Move this over to the right... and we will re run 167 167
the same command: Choco install CMake. 168 168
We will paste it in it: right click and hit enter... and here 169 169
we can see now it is downloading. 170 170
Okay. 171 171
And now just as we did with Open SSL and open CV, you'll 172 172
have to go in and change our environment variables. 173 173
Go into our path, click Edit and here we will go ahead and 174 174
copy the location to our CMake Bin folder. 175 175
So I'll go ahead and copy this back to our environment variables. 176 176
You paste it in and as usual we can check to make sure this 177 177
is the proper file path. 178 178
By opening our File Explorer like this PC, C, program files. 179 179
here we can see our CMake and Bin folder. 180 180
So hit okay on all of these windows now into installing the 181 181
other dependencies, we'll navigate to the link and download 182 182
the seven packages listed so I will go ahead and install 183 183
- 184 184
packages. 185 185
I show folder. 186 186
We should have (counting) 1, 2, 3, 4, 5, 6, 7 packages which are the ones listed 187 187
here. Once these packages are downloaded, we'll open our 188 188
Power shell, which we have here. 189 189
I'll go ahead and clear the screen and we will use Choco 190 190
to install these packages. 191 191
So go ahead and copy this command. 192 192
We will paste it into our PowerShell and before we run it 193 193
we need to change our path to our Downloads folder right 194 194
here. And to get your path to your downloads folder, 195 195
simply using your File Explorer... 196 196
Click on one of the files you just downloaded. 197 197
Right click on it... 198 198
Select Properties... and here under the location section you 199 199
can see the file path to this file. So I go ahead and copy 200 200
this and we can paste it here in this portion of the command 201 201
and now we can go ahead and run this. Once it is finished 202 202
installing we will also need to install our Python dependencies. 203 203
So I'll go ahead and close this Power shell because we will 204 204
need to refresh it. 205 205
Since changes have been made to our environment variables. 206 206
I'll go ahead and close the Downloads folder. 207 207
For now we will open a new Power shell is admin and we will 208 208
run this Python installation command. 209 209
Hit enter. 210 210
All right... The 211 211
Command ran with errors, so I will go ahead and try to upgrade 212 212
my pip to see if this solves my issue using the command here: 213 213
control shift C... and then paste it in with the right mouse 214 214
button. Don't include the apostrophes. 215 215
We will go ahead and hit enter. 216 216
Alright, now that we are using a newer version of Pip, I'll 217 217
go ahead and clear the screen, and I will try to rerun our 218 218
installation command. 219 219
So I'll just simply hit the up arrow three times and hit 220 220
enter... and here we can see this time it successfully ran without 221 221
any errors. So we'll go ahead and clear the screen. 222 222
We will also need to install the RQT dependencies, so I will 223 223
copy those as well here. 224 224
So control C and paste it in using the right click... Hit enter. 225 225
Alright. 226 226
And now I'll go ahead and install graph by using Choco 227 227
I will go ahead and hit y enter. 228 228
Alright, now we need to include graph to our environment 229 229
variables as we've done before we go ahead and open them 230 230
up. Go to our path. 231 231
Edit and we'll use this as our path. 232 232
Oh it looks like it depends on our version of graph is so 233 233
I'll go ahead and open up our File Explorer. 234 234
I go to this PC or C drive. 235 235
So here it's installed in our program files directory. 236 236
So I'll go ahead and click on this. 237 237
Click on our bin folder and I'll just click on any file here. 238 238
Click on properties and I'll just get the location. 239 239
So this is the location of our graph is so I hit control C 240 240
to copy. 241 241
Okay, I'll minimize this and go back to our environment variables, 242 242
create a new path and paste it in and there you see we have 243 243
included our graph is so I'll go ahead and hit 244 244
"Okay" on all three windows. 245 245
Now with all these steps finally out of the way, Let's get 246 246
to actually installing ROS Foxy. 247 247
We will head over to the Releases page and Select the most 248 248
recent version of ROS 2 Foxy Fitzroy. 249 249
In this case, for me it is patch Release four, so I'll go 250 250
ahead and click under the assets 251 251
drop down and I will Select the Windows Release version. 252 252
Don't download the Windows Debug version. Depending on your 253 253
internet, this may take some time to download, so feel free 254 254
to pause the video here and come back once you finish your 255 255
download. Alright, our download has finished. 256 256
Now we have to extract the files so go to 257 257
I will right click and it extract all now rather than extracting 258 258
it here, I'll actually extract it into a folder called 'dev' 259 259
in our C file directory. 260 260
I'll go ahead and hit extract... and this will take a while 261 261
since the folder is very large so feel free to pause the 262 262
video and come back. 263 263
Once yours is finished extracting. 264 264
Once it is finished extracting we can see our extracted folder. 265 265
We will go ahead and change the name of our folder from ROS 266 266
Windows, to ROS 2 underscore Foxy. 267 267
Great. 268 268
We have finally installed ROS. 269 269
I'm going to go ahead and close all these windows. 270 270
Now we'll close our power shell. 271 271
I will close this last window and now to run ROS, we can 272 272
go ahead and open up a command prompt to make CMD and we 273 273
can source it using this command here. 274 274
So this allows our command prompt the cross installation. 275 275
Alright, we get a warning message but we can just ignore 276 276
it for now. 277 277
So I'll go ahead and clear the screen. 278 278
One sourced, 279 279
we can try to run example nodes. Here's the command for running 280 280
an example publisher node called Talker. 281 281
You will go ahead and run this Node in the command prompt, 282 282
and here we see messages being published titled Hello World. 283 283
We can then open a second command prompt and run 284 284
a second subscriber node called Listener, as shown here, and 285 285
says ROS is unable to recognize this command. 286 286
That is because we need to source our terminal environment 287 287
every time we open a new command prompt. 288 288
So I'll go ahead and rerun this command right here... 289 289
Clear the screen, and I will try to run my listener again. 290 290
And this time we see our listener receiving the messages 291 291
from our publisher node 292 292
here, up above. 293 293
Here, you can see this matching and the correlating topics. 294 294
Congratulations. 295 295
With that, you have successfully configured your windows 296 296
machine to be able to run ROS 2. As a side note, to stop 297 297
running the nodes that are currently running in these terminals, 298 298
you can simply click on the terminal and hit control C, which 299 299
will take us back to our prompt, and you can go ahead and 300 300
close these windows. 301 301
Congratulations. 302 302
You have successfully installed ROS. 303 303
Feel free to look over the ROS 2 documentation website 304 304
pages for more information if you are interested. 305 305
But with that, Let's move on to installing our Code editor.