1
00:00:00,780 --> 00:00:06,240
In this lecture, we will go over how to build Ros to humble from source on a bone to 22.4.

2
00:00:06,450 --> 00:00:11,820
This is simply a different way to install ROS two humble compared to installing binaries which may be

3
00:00:11,820 --> 00:00:17,700
necessary for installing particular distributions on different versions of a bone to or Linux as well.

4
00:00:17,700 --> 00:00:23,520
If you want to contribute to ROS two and are actively developing code for it, building ROS two from

5
00:00:23,520 --> 00:00:28,770
source does take a lot of time, so realistically leave yourself at least an hour to complete this lecture

6
00:00:28,770 --> 00:00:33,600
as it will also take up about 20 gigabytes of storage space should you choose to follow along.

7
00:00:34,380 --> 00:00:39,390
Again, this is not needed to utilize any of the other main ROS features if you are already using the

8
00:00:39,390 --> 00:00:41,220
ROS to binary installation.

9
00:00:41,220 --> 00:00:43,800
So by all means feel free to skip this lecture.

10
00:00:44,910 --> 00:00:50,820
So the first thing I will do is open up a browser and head over to the installation page for Ros to

11
00:00:50,820 --> 00:00:51,320
humble.

12
00:00:51,330 --> 00:00:56,160
Now instead of installing the Debian package like we did in section two, we're going to scroll down

13
00:00:56,160 --> 00:01:01,010
a little bit and build from source following the Ubuntu Linux guide.

14
00:01:01,020 --> 00:01:04,890
So go ahead and click on that link and here are the steps we will be following.

15
00:01:04,890 --> 00:01:10,560
So we'll be setting up our locale, adding the ROS to repository, downloading all the source code for

16
00:01:10,560 --> 00:01:15,810
us two from GitHub where we will be manually installing dependencies and then building it.

17
00:01:15,810 --> 00:01:17,070
So let's jump in.

18
00:01:17,070 --> 00:01:21,540
So scrolling down you can see some of the system requirements, so you can see some of the distributions

19
00:01:21,540 --> 00:01:24,120
which are supported for building from source.

20
00:01:24,120 --> 00:01:33,180
So in this case we are building on Ubuntu Linux 22.4 but these builds will also work for focal and Debian

21
00:01:33,180 --> 00:01:33,930
bullseye.

22
00:01:34,020 --> 00:01:40,620
Granted, these are tier three systems, so there may not be as much support compared to 22.4.

23
00:01:40,830 --> 00:01:41,220
All right.

24
00:01:41,220 --> 00:01:43,680
So first up is setting up our locale.

25
00:01:43,830 --> 00:01:48,900
Now, unless you're using a special Linux operating system version, your locale settings should already

26
00:01:48,900 --> 00:01:55,830
be correctly set to UTF eight US, which we can verify by opening up a terminal and simply typing in

27
00:01:55,830 --> 00:01:56,880
the locale command.

28
00:01:56,880 --> 00:01:58,200
So our current setup is fine.

29
00:01:58,200 --> 00:02:02,310
We can see the US UTF eight so I can go ahead and add the roster repo.

30
00:02:02,310 --> 00:02:08,250
If you see something different on your output, feel free to run these commands in your terminal to

31
00:02:08,250 --> 00:02:10,800
make sure that you are set to that UTF eight setting.

32
00:02:10,800 --> 00:02:13,130
So let's go ahead and add the RAS to repo.

33
00:02:13,140 --> 00:02:17,520
So the first thing is going to ask us to do is make sure that our APS repository system is allowed to

34
00:02:17,520 --> 00:02:19,890
utilize universal packages.

35
00:02:19,890 --> 00:02:23,490
So again, by default, unless you're doing something special, they should already be set and we can

36
00:02:23,490 --> 00:02:24,450
actually go ahead and check that.

37
00:02:24,450 --> 00:02:29,610
If I go ahead and reopen this terminal and we get that 500 code that we're actually looking for, which

38
00:02:29,610 --> 00:02:30,450
it shows the output of.

39
00:02:30,450 --> 00:02:36,870
So I'm going to go ahead and split the screens so that we can easily see these commands being run.

40
00:02:38,510 --> 00:02:43,340
So like I said, we get this 500 command, which we saw earlier for Ubuntu 2204.

41
00:02:43,370 --> 00:02:48,500
If you don't see that output, then again you'll be running these commands to be able to set your repository

42
00:02:48,500 --> 00:02:51,680
to install the universal group of app repositories.

43
00:02:51,710 --> 00:02:55,060
Now we're going to be adding the RAS to app repository to our system.

44
00:02:55,070 --> 00:02:59,300
So first we're going to be adding our GPG key with APT.

45
00:02:59,330 --> 00:03:04,550
Now notice you may get depreciation warnings when running these commands just because the latest releases

46
00:03:04,550 --> 00:03:07,520
of Ubuntu are trying to get away from the key systems.

47
00:03:07,520 --> 00:03:09,950
But again, we're just going to follow along with the guide.

48
00:03:12,090 --> 00:03:13,710
So you'll be asked to put in your password.

49
00:03:17,720 --> 00:03:17,960
All right.

50
00:03:17,960 --> 00:03:19,220
I'm going to go ahead and clear the screen.

51
00:03:21,910 --> 00:03:27,490
And then run the second command here, which is actually grabbing the keys from their GitHub repository.

52
00:03:31,380 --> 00:03:32,840
And then we are good to go.

53
00:03:32,850 --> 00:03:35,760
So let's go ahead and add the repository to our sources list.

54
00:03:38,700 --> 00:03:42,210
And now we can go ahead and install our development tools.

55
00:03:42,990 --> 00:03:44,580
So just go ahead and copy this.

56
00:03:47,030 --> 00:03:53,010
And so most of these are going to be Python three related dependencies, but also things like git C

57
00:03:53,030 --> 00:03:55,940
make our build essentials and w get.

58
00:04:00,200 --> 00:04:00,410
Okay.

59
00:04:00,410 --> 00:04:01,610
I'm going to go ahead and clear the screen.

60
00:04:02,270 --> 00:04:07,070
And now we're actually going to get the RAS to code from GitHub and download it to our machine.

61
00:04:07,100 --> 00:04:11,900
Keep in mind that the rest of this guide uses a workspace folder called Ras Humble, which is located

62
00:04:11,900 --> 00:04:13,040
in your home directory.

63
00:04:13,040 --> 00:04:15,770
So it's completely up to you how you want to organize this as you could.

64
00:04:15,770 --> 00:04:20,210
Alternatively, keep this organized within the Workspaces folder we have been using, but to keep things

65
00:04:20,210 --> 00:04:25,250
simple so I can easily copy and paste the commands from this guide, I will just follow along with their

66
00:04:25,250 --> 00:04:29,120
convention of just putting this ROS to humble workspace in the home directory.

67
00:04:29,120 --> 00:04:31,880
So let's go ahead and create the workspace and source folders.

68
00:04:33,440 --> 00:04:38,870
So now I can actually go ahead and open up my file Explorer and we now see this RAS two humble directory

69
00:04:38,870 --> 00:04:40,970
with the source directory.

70
00:04:44,100 --> 00:04:47,130
Then we'll change into the to humble directory in our terminal.

71
00:04:49,130 --> 00:04:50,360
And go ahead.

72
00:04:51,810 --> 00:04:55,050
And begin downloading our raw repo.

73
00:05:07,520 --> 00:05:07,700
Okay.

74
00:05:07,760 --> 00:05:09,830
And after a while, we get this output spit out.

75
00:05:10,100 --> 00:05:15,930
So this just shows all the packages which were included when we were downloading our rosti repos.

76
00:05:15,950 --> 00:05:22,280
So now if we go into that source folder, we will see all of these individual RAR dependencies and packages.

77
00:05:25,120 --> 00:05:28,180
Now, keep in mind, I already have Ross two installed on this machine.

78
00:05:28,180 --> 00:05:28,390
Right.

79
00:05:28,390 --> 00:05:36,070
So if I go ahead and do echo Ross distro, right, I get my humble distribution which I installed utilizing

80
00:05:36,070 --> 00:05:37,190
the Debian binaries.

81
00:05:37,210 --> 00:05:42,460
Now we're going to want to make sure that when we're building this package there are no existing Ross

82
00:05:42,460 --> 00:05:46,000
instances source as it may mess up our build process.

83
00:05:46,000 --> 00:05:49,750
So the thing that sourcing our current binary is our bash RC files.

84
00:05:49,750 --> 00:05:53,620
So if I go ahead and open up our bash RC file in V's code.

85
00:05:57,320 --> 00:05:58,940
I'll go ahead and scroll down to the bottom.

86
00:05:59,150 --> 00:06:04,070
And here we see a lot of the environment set up functionality which we implemented when we installed

87
00:06:04,070 --> 00:06:05,570
our RAS two binary instances.

88
00:06:05,570 --> 00:06:10,160
So all we have to do is highlight these and comment them out using the pound symbol.

89
00:06:10,160 --> 00:06:15,830
Or in this case I just hit control forward slash to automatically comment them out, save the file,

90
00:06:15,830 --> 00:06:21,560
which I'll do with control s And now we should no longer have our instances sourced when we open up

91
00:06:21,560 --> 00:06:22,610
a new terminal.

92
00:06:22,640 --> 00:06:24,500
So I'll have to go ahead and.

93
00:06:25,350 --> 00:06:26,370
Close this terminal.

94
00:06:28,770 --> 00:06:34,560
And now if I do something like Ross to Node list, we see Ross to command not found because Ross too

95
00:06:34,560 --> 00:06:38,430
binary installation is not sourced to these terminal environments.

96
00:06:38,610 --> 00:06:41,640
So let's go ahead and continue following along with the guide.

97
00:06:41,670 --> 00:06:48,570
So here it says we're going to be running apt upgrade and then using Ross DEP to install some dependencies.

98
00:06:48,570 --> 00:06:49,800
So I'll go ahead and do that.

99
00:06:50,010 --> 00:06:51,150
Put in your password.

100
00:06:54,910 --> 00:06:57,100
And then we'll go ahead and run raw, step in it.

101
00:06:59,800 --> 00:07:05,180
And since we already installed ROS before, it'll actually say default sources file already exist.

102
00:07:05,200 --> 00:07:05,980
Don't worry about that.

103
00:07:05,980 --> 00:07:06,760
That's fine.

104
00:07:06,760 --> 00:07:08,680
If we want to re initialize it, we could delete it.

105
00:07:08,680 --> 00:07:13,570
But I'm just going to go ahead and leave it as is since I'm working with the same distribution and I

106
00:07:13,570 --> 00:07:14,560
can go ahead and run.

107
00:07:14,560 --> 00:07:15,760
Raw step update.

108
00:07:27,150 --> 00:07:27,530
All right.

109
00:07:27,540 --> 00:07:30,150
I'm not sure why we're getting this error message.

110
00:07:30,390 --> 00:07:35,280
I actually tried this earlier and this didn't occur, but it seems we were able to add our distributions

111
00:07:35,280 --> 00:07:36,840
just fine when running Rasta updates.

112
00:07:36,840 --> 00:07:38,700
So I'm just going to go ahead and ignore that for now.

113
00:07:41,230 --> 00:07:47,860
And we can go ahead and run the step install and we're going to be essentially pointing it to the source

114
00:07:47,860 --> 00:07:49,170
directory from PATH.

115
00:07:49,180 --> 00:07:52,690
So one thing to keep in mind is we're actually supposed to be changed into our workspace directory because

116
00:07:52,690 --> 00:07:53,590
I close out our terminal.

117
00:07:53,590 --> 00:07:54,880
So let's go ahead and do that now.

118
00:07:59,350 --> 00:08:00,690
Workspace directory.

119
00:08:00,700 --> 00:08:05,590
I can go ahead and run the raw step, install command, which points to our source directory.

120
00:08:12,160 --> 00:08:12,490
All right.

121
00:08:12,490 --> 00:08:13,570
So that took about 2 minutes.

122
00:08:13,570 --> 00:08:20,190
So I'll just go ahead and clear the screen and now we can move on to installing additional DDA implementations.

123
00:08:20,200 --> 00:08:25,120
So if you wanted to use different communication protocols other than the default fast IDs, you can

124
00:08:25,120 --> 00:08:27,760
click on the link to install your preferred communication protocol.

125
00:08:27,760 --> 00:08:33,190
But that's an advanced topic which you will most likely never have to go over in most robotics applications.

126
00:08:33,460 --> 00:08:36,090
Now it's time to actually begin building.

127
00:08:36,100 --> 00:08:39,820
Now here you can see the message that we must build this in an environment that does not have another

128
00:08:39,820 --> 00:08:40,750
ROS instant source.

129
00:08:40,750 --> 00:08:42,550
So we already took care of that earlier.

130
00:08:42,550 --> 00:08:47,710
So again, we can double check that by doing ROS to node list or some other ROS do command and we see

131
00:08:47,710 --> 00:08:48,820
the command is not found.

132
00:08:48,820 --> 00:08:50,860
So we're already in our ROS two humble directory.

133
00:08:50,860 --> 00:08:52,450
So let's go ahead and run.

134
00:08:52,450 --> 00:08:57,880
Our code can build Simulink install like we have with our packages that we created in section four.

135
00:08:57,880 --> 00:09:04,240
But this time we're going to be building all of the ROS packages that we have in our source directory,

136
00:09:04,240 --> 00:09:06,220
including ROS itself.

137
00:09:06,760 --> 00:09:11,290
All right, so this is going to take a long time, so feel free to pause the video here and I'll go

138
00:09:11,290 --> 00:09:14,710
ahead and fast forward and I'll see you when the build is finished.

139
00:09:21,370 --> 00:09:21,700
All right.

140
00:09:21,700 --> 00:09:23,110
So that's gone ahead and built.

141
00:09:23,110 --> 00:09:26,140
And as you can see on my computer, it took just under 30 minutes.

142
00:09:26,170 --> 00:09:32,860
Now, you may be concerned that we see 340 packages finished, but 98 packages had standard error outputs.

143
00:09:32,890 --> 00:09:36,190
Now, you don't have to worry about this because sometimes this tracks anything that may have triggered

144
00:09:36,190 --> 00:09:36,910
warnings.

145
00:09:36,910 --> 00:09:42,610
And one of the issues that we've been seeing a lot in Ubuntu 22.4 is some of the depreciation of the

146
00:09:42,610 --> 00:09:45,170
Python tools or commands which are used.

147
00:09:45,190 --> 00:09:48,190
So this just leads to external depreciation warnings.

148
00:09:48,190 --> 00:09:53,200
So it's not necessarily errors which stopped it from building, but simply these warning messages.

149
00:09:53,200 --> 00:09:55,090
But for now, I'm going to go ahead and clear the screen.

150
00:09:56,200 --> 00:10:01,180
And again, just to show you that we're working with this new ROS two installation, if I do ROS two

151
00:10:01,180 --> 00:10:06,940
node list, right, we see Ros two command not found because I have no ROS instances source.

152
00:10:06,940 --> 00:10:12,730
So now what we can do is source the local setup bash file from our build just like we would with our

153
00:10:12,730 --> 00:10:14,140
normal ROS package.

154
00:10:14,260 --> 00:10:16,030
And I'm actually jumping a bit ahead of myself.

155
00:10:16,030 --> 00:10:18,880
This is actually covered in the next part of the documentation.

156
00:10:18,880 --> 00:10:21,610
So here we see they are sourcing the local setup.

157
00:10:21,760 --> 00:10:25,510
Bash period is the same command as source.

158
00:10:25,510 --> 00:10:31,240
So we just go ahead and source this, right?

159
00:10:31,300 --> 00:10:34,720
So our ROS to humble directory install local setup bash.

160
00:10:36,100 --> 00:10:39,070
And now if we try to run Ras to node list.

161
00:10:40,050 --> 00:10:43,700
We get no output because we currently don't have any nodes running, but we don't get this ROS to command

162
00:10:43,710 --> 00:10:49,680
not found because we are currently sourced to this installation which we built from source.

163
00:10:49,800 --> 00:10:51,810
So we see our build, install and log folders.

164
00:10:51,810 --> 00:10:58,200
So we built ROS to humble from source and we are now utilizing this installation for our ROS to tools

165
00:10:58,200 --> 00:11:01,080
so we can actually go ahead and try some examples.

166
00:11:01,620 --> 00:11:05,430
So you can go ahead and run the talker node, which we've run before many times.

167
00:11:06,360 --> 00:11:08,430
So here we see it publishing Hello World.

168
00:11:09,330 --> 00:11:17,040
And again, if I open a new terminal, if I do ROS two node list, you see command not found because

169
00:11:17,040 --> 00:11:24,130
we need to source our installation, which in this case is the one we built from source.

170
00:11:24,210 --> 00:11:26,160
And now if we run the listener, we see.

171
00:11:26,160 --> 00:11:27,060
I heard Hello World.

172
00:11:27,060 --> 00:11:29,100
So we see Ros is indeed working.

173
00:11:29,100 --> 00:11:34,500
But this time, instead of utilizing the binaries, we're utilizing all the code that we had built from

174
00:11:34,500 --> 00:11:35,340
source.

175
00:11:35,690 --> 00:11:36,900
I'll go ahead and stop these.

176
00:11:37,500 --> 00:11:42,510
All right, so here we see we have an operational ROS to humble installation by downloading the ROS

177
00:11:42,510 --> 00:11:45,270
to source code and building it from scratch.

178
00:11:45,270 --> 00:11:49,140
So again, there are only very limited cases which you would do this mainly if you're installing it

179
00:11:49,140 --> 00:11:55,350
on a special operating system or if you wanted to help contribute to the existing ROS two stack.

180
00:11:56,520 --> 00:11:56,910
All right.

181
00:11:56,910 --> 00:12:02,490
So here we see we have an operational ROS to Humble install, which we obtained by downloading the ROS

182
00:12:02,490 --> 00:12:06,810
to source code along with its dependencies and building it ourself.

183
00:12:06,840 --> 00:12:12,060
In most cases, using the ROS installation binaries will work just fine, but it's good to know how

184
00:12:12,060 --> 00:12:18,480
to build ROS from source in case you want to contribute to ROS or in case you are using specialty systems

185
00:12:18,480 --> 00:12:21,000
which Ros may not immediately support.
