Ros2 is now installed, but before you can use it, you need to set up your environment.
To do that, we will just have to source one bash script that is placed in the installation directory
of Ros2.
And just to show you what I'm talking about.
So there is a Rose two command line tool.
We're going to come back to this in this course.
But if you just run Ros two like this you will see Ros two command not found.
Okay.
So that means that Ros two is installed but not set up in the environment.
Now I'm going to go to slash Opt.
And Ros is actually installed inside slash opt.
So you should find Ros like this.
And then you will have one directory that corresponds to the Ros two distribution you have just installed.
So in our case it's jazzy.
Inside this jazzy folder you see we have a setup dot bash script.
So if I want to run Ros two in this terminal I need to source that script.
So I need to do source slash opt slash Ross slash jazzy slash setup dot bash.
Now Ross two is sources in that environment.
And if I do Ross two again, you see we have a usage message because we cannot just run Ross two like
this.
But you see that the Ross two command has been found.
Okay, we have a different message.
So basically you will need to source that in every terminal.
You can see if I do Ross two here command not found.
If I source the setup dot bash script which is here, then it's working.
And that's going to be quite annoying if we have to source that script every time we open a terminal.
So for that we are going to add this line inside the bash RC.
So let's go back to our clear.
Let's go back to our home directory and let's open with git dot bash RC which is in your home directory.
Okay.
So it's going to open a file like this.
You should have that.
And what is the bash SC.
Well very basically that's a bash script that's going to be run every time you open a new session.
So basically if you open a new terminal all those commands here are going to be run.
So you go at the end of the file here at the very end, and you are going to add a new line, which
is basically that one.
So you just copy that one with Ctrl shift and C and then Ctrl V here.
Okay.
So at the end of your bash RC should be like this source setup bash script from the installation folder
of your roster distribution.
Now I'm going to save okay.
Close the file.
And then we'll just close all the terminals.
Let's open a new one.
And now if I do Ros2 you see that what Ros2 has already been sourced in that environment.