In this lecture we will be learning how to install ROS Foxy 2 2
on Ubuntu 20.04. 3 3
These installation steps will be similar for all Debian based 4 4
Linux distributions, but just note for this course I will 5 5
be using Ubuntu 20.04 as my operating system. 6 6
With the browser open, 7 7
I will navigate to the ROS 2 Foxy installation page. 8 8
Once here I will Select Debian packages under the binary 9 9
packages section. 10 10
Please be careful as to not select the Linux option in the 11 11
build from Source section. 12 12
As building ROS 2 from Source can take several hours to 13 13
compile. There are four main steps to installing ROS 2 14 14
on our open to machine setting our local, Setting our sources, 15 15
installing our ROS 2 packages and setting up our environment. 16 16
The local is generally correctly set up for Utf eight in 17 17
Ubuntu in order to check, we can open up a terminal and we 18 18
will run the local command here. 19 19
We can see that the local is already set to Utf eight so 20 20
I can leave it as is if your machine does not say UTF 8 follow 21 21
along with the installation instructions on setting up 22 22
our sources. 23 23
We only need to set up our sources for our app repository 24 24
manager to include ROS 2 and its dependencies. 25 25
I will copy this command which will run the app update command 26 26
and install the following dependencies. Careful not to copy 27 27
both lines as you may need to enter your password. 28 28
After running the first command, I will put in our password 29 29
which of course does not show to the terminal for security 30 30
reasons. Go ahead and hit Y and enter. 31 31
Then copy the second part of the setup sources. 32 32
Alright then we will add the repository to our sources list. 33 33
Now that we have set up our sources, Let's install the ROS 34 34
package. First we will update our app repository. 35 35
Then we will go ahead and install ROS Foxy desktop, which 36 36
will include all of our ROS features and tools. 37 37
This will take some time depending on your Internet connection 38 38
and your computer processor. 39 39
I will go ahead and speed up the video to when the installation 40 40
finishes. Okay with that, we now have ROS installed onto 41 41
our computer. 42 42
Before we can use it, we need to set up our terminal environment 43 43
to be able to use ROS. 44 44
In order to use ROS and terminal, we must first source our 45 45
terminal. The ROS is setup bash file so we can go ahead 46 46
and source it. 47 47
Now with this command it is worth noting we will have to 48 48
run this command every time we open a new terminal. 49 49
In order to use ROS, we will set up our environment so it 50 50
automatically sources in a bit. 51 51
But before I do that we will finish the installation instructions 52 52
by installing or complete. 53 53
This will allow us to type ROS commands in and then hit 54 54
the tab key to allow it to auto complete the command or show 55 55
available arguments we can use. 56 56
Alright with that we can actually use ROS. 57 57
We can test that ROS works in the terminal by running the 58 58
example code ROS provides. 59 59
We will go over how these commands were later in the course. 60 60
For now, we can run our talker publisher node in this terminal. 61 61
Then I can open a new terminal using Control alt resource 62 62
the terminal, and run our listener node, which is a subscriber. 63 63
And here we can see this terminal is subscribing to the messages 64 64
sent by our publisher node above. 65 65
To stop these nodes, we can click on the corresponding terminal 66 66
and hit Control C now to make it so that all of our terminals 67 67
we open are able to use raw terminal commands. 68 68
Without having to run this source command, we will have to 69 69
modify our Bash RC file, which the documentation goes over 70 70
in the next tutorial, which we can get to by clicking on 71 71
the tutorials and demo link and clicking on configure your 72 72
ROS 2 environment. 73 73
I will Scroll over to the second section where it goes over 74 74
adding sourcing to your shell startup script. 75 75
Essentially, it is just using the same source command we 76 76
used earlier place at the end of our batch RC file. 77 77
In this case, our distribution we are using is ROS Foxy, 78 78
so we will change the command to reflect that we can also 79 79
go down to Section three to the Add Colon CD command. 80 80
We will go over this command later in this course. 81 81
Do not worry about running the second line, which exports 82 82
a colon root directory. 83 83
This is mainly used if you built the ROS from source. 84 84
Lastly, if you ever wanted to check that you are properly 85 85
source and what version of ROS you are running, you can 86 86
use the Linux command print Env. 87 87
We can sort through the environment list by using the Grep 88 88
command to only look for the fields which include ROS underscore. 89 89
After running it, we can see our ROS version ROS Python 90 90
version, and that we are using the Foxy ROS distribution. 91 91
Congratulations. 92 92
With that, you have successfully installed ROS. 93 93
Feel free to look over the ROS 2 documentation website 94 94
pages for more information if you are interested. 95 95
But with that, Let's move on to installing our Code editor.