In this lecture we'll be learning how to install ROS to humble on Ubuntu 2204.
These installation steps will be similar for debian based Linux distributions, but just note for this
course I will be using ubuntu 2204 as my operating system.
Before we begin, I just want to note that in this course I will be using a terminal emulator called
Tilex, which allows me to easily open and access multiple tabs on the same screen to access the native
Ubuntu terminal.
You can either head over to the apps icon and type in terminal or alternatively you can hit control
alt rt on your keyboard to open one.
Then one of the things I like to do is right click on the terminal icon in my dock and favored it so
that I can easily access it for future use.
You can follow along through the rest of this course using this standard terminal.
But like I said, I will be installing the tile terminal emulator so you can install it through the
following commands so you'll be prompted for your password.
All right.
So we've gone ahead and updated our app repositories and I'll go ahead and install Tilex hit Y and enter.
All righty.
Once that's installed, I can go ahead and head back over to the apps icon and search up Title X and
there we see it.
So I'll go ahead and hit enter.
And so now this is my new terminal, which I will be using.
So as usual, I'll go ahead and right click on it, add it to favorites so that I can easily access
it later on.
Then I can go ahead and configure my terminal settings.
So it's this configuration issue detected.
Don't worry about this, we'll just hit OC and all we need to do is head over to the default tab at
over to command and then we will run the command as a login shell and I'll head over to color and you
can change this however you want, but I will go ahead and be using the Molokai Dark theme.
And by any means you can increase the terminal size if you want to.
So say increase how many default columns there are.
And Rose.
So I'll just make that a bit bigger.
And I can go ahead and close this.
So this is our old terminal.
So I'll be closing this and this will be the tile terminal, which I'll be using for now.
I'll close it.
We can reopen it and we can see this is the new size which we just set.
And you can open up new terminal tabs however you want, whether either on the right or on the bottom
using these buttons so you can get secondary terminals, which we'll be using throughout the course.
All right.
With that out of the way, you can open up a browser and head over to the Ross Humble Installation page.
I'll be using the Chrome browser, but it is completely fine to use the default Firefox browser or any
other browser of your choosing.
Please double check that you are on the Ross Humble installation page and not some other distribution
like Ross Fox.
Because this distribution is meant for Ubuntu 22.4.
For now, I'll go ahead and slide this terminal over to the left so that it expands accordingly.
Once here I will select the Debian package link under ubuntu linux jammy jellyfish 22.4.
Make sure not to accidentally click one of the other links below or the ubuntu linux building from source
as that will take much longer than just using the debian package for ubuntu.
So I'll go ahead and scroll down.
So first things first is setting up locale.
If you're on Ubuntu 22.4 desktop, you should be already set, but you can just double check by typing
in this locale command and you can pace either using control shift V or by right clicking and hit paste.
And then I'll go ahead and hit enter.
And as long as you see this UTF eight setting, then you're good to go.
If you don't see UTF eight, then you'd run the rest of these commands to make sure that you are set
to the UTF eight environment.
All right.
Next up, we'll go ahead and set up our sources.
So it says you'll need to add the RAR to app repository to your system.
So that's what allows us to install the ROS to APT package as well as install future ROS packages and
keep things updated.
So it says first make sure that the Ubuntu universal repository is enabled.
Again, this should be fine by default and you can check by copying this command in hitting enter.
And as long as you see this 500 message and we see ubuntu gemmy, you're fine.
Like I said, this is fine by default.
This is only for special installations of ubuntu that this may not apply to.
So if you don't see a message that looks something like this, you can run these lines to install the
software properties common and add universe repository sharing onto your system.
Next up, we can go ahead and add the ROS to app repository to our system so we can just go ahead and
hit this copy to clipboard button and I'll go ahead and paste it in as usual.
And you might get an error like this because we're calling sudo and I'll just hit paste anyway.
And I can hit enter.
Put in your password.
I'll hit y enter.
All right, so we've added the repository.
Now, let's add it to our sources list with this command.
And now we can actually go ahead and install ROS two.
So we can go ahead and do sudo apt update.
And here it actually recommends that you upgrade your Ubuntu system to make sure your system is up to
date before installing your ROS package.
So we can run that as well.
All right.
That's out of the way.
And now we can scroll down and finally we can actually get to installing the Ross Humble desktop app
repository.
I didn't run that.
And so here we see it's going to take about three gigabytes of additional disk space.
So just be wary of that.
So I'll hit Y and enter.
So as I mentioned, this will take some time depending on your Internet connection and your computer
processor.
So I will go ahead and speed up the video to when the installation finishes.
All right.
So that took about 15 minutes to finish.
So just expect this to take about 20 or 25 minutes or so, depending on your computer and internet speed
to download and install ROS.
Okay.
With that, we now have ROS installed onto our computer.
Before we can use it, we need to set up our terminal environment to be able to use ROS.
In order to use ROS in the terminal we must first source our terminal to ROS set up bash file so we
can go ahead and source it now with this command that we see here.
For now.
I'll go ahead and clear the screen and then I can paste in the command.
And so once we do this in our terminal, we can now use our Ross commands.
So it is worth noting we need to run this command every time we open a new terminal in order to use
ROS, we will set up our environment in a bit to automatically source.
We can test that Ros works in the terminal by running the example code provided down below.
So as we saw, we sourced our ROS instance using this line right here and then we can run a example
talker node by running this line right here.
And again, don't worry about the commands too much right now.
We'll explain them later in the course, but just know this is going to run an example node which publishes
some messages which we will see in a bit.
So I run it and it says Publishing.
Hello world.
One, two, three, and so on.
So I'll go ahead and open up a second terminal tab right below and we can run these two commands right
here.
So we'll have to source our Ros Humble installation and then we will be running a listener node which
subscribes to these messages coming in.
So go ahead and paste that.
And here we see I heard Hello World and the number corresponding to what was being published.
So here we can see it's receiving the published messages and printing them out as it subscribes.
And you can kind of see if I stop this first terminal here, I stopped the publisher.
It stops receiving the messages over us to stop running these notes.
You can just hit control C in each terminal.
So now, to make it so that all of our terminals we open are able to use the ROS terminal commands without
having to run the source command.
We will have to modify our bash, our C file, which the documentation goes over in the next tutorial.
So if I go ahead and scroll down, it's this next step after installing, continue with the tutorials
and demos.
So I'll just click on this and here we see a tutorial on configuring your ROS to environment so I can
go ahead and click on that.
You can read a little bit on the background, but essentially all we're going to be doing is modifying
our bash, our file to run this command on startup.
So we actually see right here.
Says Echo, and it has that same command and it points it to the end of our bash, our C file, so I
can just go ahead and copy that and I'll run it in our terminal.
And now this has been written to the end of our bash, our C file, which runs every time we open a
new terminal.
And so just to prove this, I can go ahead and close this terminal tab.
Open a new one.
And I can actually go ahead and rerun the Talker node without having to source our Ross installation.
And so we see it runs as normal.
So now we're able to use all of our commands within any new terminals that we open up.
Lastly, if you ever wanted to check your environment variables, if I actually go ahead and scroll
down, we can call this print and command, which will print our environment variables.
So I'll go ahead and clear the screen and paste this in.
And so here we see things such as the ROS version being version two, because this is Ros two and our
Ros Python version is three and our ROS distro is humble.
So this just goes to show that now our terminal environment is now sourced to our Ros Humble distribution
and so now our environment is fully set up to run all these ROS commands.
Congratulations.
With that you've successfully installed Ros, feel free to look over the ROS to documentation website
pages for more information if you're interested.
But with that, let's move on to installing our code editor.