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