WEBVTT

00:00.110 --> 00:05.450
Ros2 is now installed, but before you can use it, you need to set up your environment.

00:05.480 --> 00:11.330
To do that, we will just have to source one bash script that is placed in the installation directory

00:11.330 --> 00:12.230
of Ros2.

00:12.260 --> 00:14.270
And just to show you what I'm talking about.

00:14.270 --> 00:16.250
So there is a Rose two command line tool.

00:16.250 --> 00:18.200
We're going to come back to this in this course.

00:18.200 --> 00:24.440
But if you just run Ros two like this you will see Ros two command not found.

00:24.470 --> 00:24.860
Okay.

00:24.890 --> 00:29.210
So that means that Ros two is installed but not set up in the environment.

00:29.240 --> 00:33.170
Now I'm going to go to slash Opt.

00:33.410 --> 00:36.740
And Ros is actually installed inside slash opt.

00:36.740 --> 00:39.500
So you should find Ros like this.

00:39.680 --> 00:46.250
And then you will have one directory that corresponds to the Ros two distribution you have just installed.

00:46.250 --> 00:49.130
So in our case it's jazzy.

00:49.160 --> 00:55.670
Inside this jazzy folder you see we have a setup dot bash script.

00:55.670 --> 01:01.490
So if I want to run Ros two in this terminal I need to source that script.

01:01.490 --> 01:11.060
So I need to do source slash opt slash Ross slash jazzy slash setup dot bash.

01:11.270 --> 01:14.090
Now Ross two is sources in that environment.

01:14.090 --> 01:21.080
And if I do Ross two again, you see we have a usage message because we cannot just run Ross two like

01:21.080 --> 01:21.530
this.

01:21.530 --> 01:24.620
But you see that the Ross two command has been found.

01:24.650 --> 01:26.090
Okay, we have a different message.

01:26.090 --> 01:30.380
So basically you will need to source that in every terminal.

01:30.380 --> 01:33.920
You can see if I do Ross two here command not found.

01:33.920 --> 01:41.630
If I source the setup dot bash script which is here, then it's working.

01:41.630 --> 01:46.790
And that's going to be quite annoying if we have to source that script every time we open a terminal.

01:46.790 --> 01:51.890
So for that we are going to add this line inside the bash RC.

01:51.890 --> 01:54.650
So let's go back to our clear.

01:54.680 --> 02:04.090
Let's go back to our home directory and let's open with git dot bash RC which is in your home directory.

02:04.120 --> 02:04.810
Okay.

02:05.620 --> 02:07.960
So it's going to open a file like this.

02:07.960 --> 02:09.070
You should have that.

02:09.070 --> 02:10.480
And what is the bash SC.

02:10.510 --> 02:15.820
Well very basically that's a bash script that's going to be run every time you open a new session.

02:15.820 --> 02:20.890
So basically if you open a new terminal all those commands here are going to be run.

02:21.010 --> 02:27.520
So you go at the end of the file here at the very end, and you are going to add a new line, which

02:27.520 --> 02:29.410
is basically that one.

02:29.410 --> 02:35.350
So you just copy that one with Ctrl shift and C and then Ctrl V here.

02:36.430 --> 02:36.610
Okay.

02:36.610 --> 02:43.690
So at the end of your bash RC should be like this source setup bash script from the installation folder

02:43.720 --> 02:45.970
of your roster distribution.

02:45.970 --> 02:49.630
Now I'm going to save okay.

02:49.660 --> 02:50.980
Close the file.

02:50.980 --> 02:53.500
And then we'll just close all the terminals.

02:53.500 --> 02:54.880
Let's open a new one.

02:55.300 --> 03:01.960
And now if I do Ros2 you see that what Ros2 has already been sourced in that environment.
