In this lecture, we'll be installing and configuring our code editor, which we'll be using throughout
this course.
Now, keep in mind you can choose any code editor or ID you want to use, but my lectures will be recorded
using Visual Studio Code.
Now, in the past I've actually preferred code editor such as Atom or Sublime Text, but in the last
couple of years, Microsoft has put a lot of work into Vee's code and the extensions they put out,
which I really enjoy, especially for ROS development.
So let's go ahead and install VS code onto our machine so I can show you the features that I'm talking
about.
So there are many ways to install vs code on Ubuntu.
One of the easiest ways in my opinion is the snap store install of vs code.
You can do this with the following terminal command, which is the same thing as going over to the Ubuntu
Software center.
And typing out Visual Studio code.
And we see it here.
So this command is the same thing as going to the software center and hitting install here in case you
can put in your password.
So this is one of the easiest ways to go about installing it and make sure that it stays up to date.
We'll go ahead and clear this for now since we're installing it through the software center.
All right.
So it's gone ahead and installed and go ahead and close these.
And if I head over to all apps and I type in Visual Studio Code, it will appear so we can go ahead
and click on that.
And I'll go ahead, right click on it and add it to my favorites so that it's easy to get to.
Since we will be using this throughout the course.
So here we are greeted with the welcome screen where you can configure things such as your editor theme,
and if you plan on using VS code as your primary code editor for all your devices, I highly recommend
linking your GitHub account to your VTS code so that whenever you set up your VTS code on different
machines, all your settings will be set between computers.
Now a hold off on that for right now so you can see how to get started from scratch.
So I'll just go ahead and leave it as this default theme and I'll head over to the extensions tab,
which is the one that kind of looks like a series of blocks.
So here we can search for popular extensions.
Since we're going to be coding in Python.
I highly suggest getting the recommended Python extension here, which is by Microsoft.
So to install it, all you have to do is hit install.
All right.
So let's go ahead and install it.
And we're taken to these tabs, which have to do with getting started with Jupyter notebooks and the
Python development environment within VS code.
For now, we're going to ignore this, but feel free to go through them if you want to.
So let's go ahead and close these tabs.
And so here we see it's been installed.
And if you ever want to configure it, you can always click on this gear icon.
And here you can go to extension settings and configure it as you want, such as setting your desired
path for things like CONDA environments.
But right now we're not going to bother with that.
So I'll go ahead and close this.
Now you may also be interested in the C++ extension pack.
And this comes with a series of tools.
So it comes with a lender for C, slash C plus plus C, make tools.
See slash C++ themes and this will be of use if you ever run into ROS packages which utilize C++ as
well as when we're configuring our C make lists text file so I can go ahead and install this as well.
Then last but not least.
Well, let's installing.
We can also look up the Ross extension.
So this one is also by Microsoft, and this gives us a few extra tools to help us when we're developing
our Ross code.
And you can check out all the features here in the extension summary.
And this extension works for both Ross one and Ross two.
All you have to do is configure it as such.
So we'll go ahead and hit install.
Great.
So that's gone ahead and installed and it's automatically detected that I have Ros too humble since
we installed that earlier.
But in case yours doesn't automatically detect that, simply head over to the extension settings.
Now, if you ever needed to get here manually, you can simply head over to the gear icon, go over
to settings and head over to the extensions tab, where you can then select your desired extension,
which you want to edit.
And here you can just select the Ross distro, which you want to be sourced.
So in this case, if I just type in humble like so it'll go ahead and configure everything for me.
So it automatically detected it since we have it installed.
And all this does is automatically source your opt Ross humble setup bash file, which we've been doing
in our batch RC file.
If you ever wanted to use a different version such as Ross one, you could simply type in that particular
version if you had it installed.
So for instance, noetic.
And here you see you can say could not source.
Ross setup script opt Ross noetic setup dot bash because I don't have no edit currently installed on
this machine so I'll just go ahead and change that back to the default, which was humble.
And we see it's taken effect here in the lower sidebar.
Last but not least, you may notice that my color scheme may be different from yours when going on with
the future lectures.
That's because I will have certain themes activated.
This is purely for my personal preference.
If you want to use the same themes that I will use throughout this course, head over to the gear icon.
Head over to themes and then we can go over to Color Theme.
And here I'll select Browse additional Color themes.
And I will find community material theme darker higher contrast.
So that'll go ahead and set my theme for me.
Then I'll head over to the gear icon one more time, go back to themes, go to file icon theme.
Then install additional file icon themes, which will open it up in the sidebar here and I will be using
this material icon theme.
So this just changes what the icons look like when we're viewing files here in the sidebar.
All right.
With that, you have successfully installed Visual Studio Code, which is the code editor I will be
using throughout this course.
As I said earlier, you are more than welcome to use your own code editor.
But later on in this course, I'll be showing you how you can configure VS code to help us with our
ROS development, such as automatically configuring our workspace, compiling our code and utilizing
some of the other ROS extension features.