In this lesson, I will guide you step by step in setting up the development environment for ubuntu
22.
This is a fundamental step as using a good code editor that has properly been configured for our needs
not only helps us to develop the code faster, but also to detect the errors in advance, and also provides
guidance on how to resolve them.
During this course, I will be using Visual Studio Code to develop all the code, and you will soon
understand why this is the best choice for developing applications with Ros2.
There are, in fact, countless plugins that you can install in order to configure and customize your
development environment, offering various different functionalities from code Autocompletion that is
available in almost every programming language, also to the customization of icons, comments, and
most importantly, one thing that we will rely on this course is the support of Ros2.
So let's start the configuration of these code editor.
And simply in order to install it we can open the ubuntu software.
So this one here that comes with the ubuntu 22 installation.
And we will simply look for code perfect.
And so let's go down here and we will need to install this one here.
So Visual Studio Code as you can see here.
So let's install it.
And now let's wait for the installation of Visual Studio Code.
Once it is installed we have it in the list of the applications.
So let's open it and here we go.
So this is the main page of Visual Studio Code.
And here apart from choosing your team, the most important thing that we need to do is to install some
extensions that are going to be very helpful in the development of the code.
Let's start with the C plus plus extension.
So this one here let's install it.
And also let's install this one here.
So the extension pack.
Perfect.
Then let's also install the Python extension.
Perfect.
So this one here for the support to the Python language.
And then we also can install the CMake extension.
And this one here are already being installed.
So since we have installed the C plus plus extension these are installed along with it.
So perfect.
Let's also install the XML extension, this one here and also the XML tools.
Perfect.
So this will provide us the Autocompletion for the XML files.
And now let's move on.
Also with the installation of the most important extension that we are going to use in this course,
that is the Ros extension.
So this one here that is directly developed and supported by Microsoft.
So let's install it.
Perfect.
So with this the configuration of Visual Studio Code is completed.
And during the course we will see how to use and how to take advantage of the features offered by all
these extensions that we have just downloaded.
And that will help us to develop application faster, with fewer errors and with more ease.
Now, after installing with Visual Studio Code so we can close it since we have all the extensions that
we need.
Let's move on to install other useful components.
So since we will be using the Linux terminal quite extensively in this course.
So this guy here, I recommend you installing a more advanced version of the standard ubuntu terminal
that is this one here and is called Terminator.
So as you can see here I have the normal ubuntu terminal that is this one here and here I have Terminator.
And the cool thing about these different terminals.
So basically they are the same and you can do the same things.
But the cool thing about Terminator is that you can open more windows so you can open several different
terminals within the same window.
So here as you can see this has a better management of the windows.
And also for example here with Ctrl shift E we can open a new window on the side.
And with Ctrl shift O we can open a new window in the bottom.
Also, we can close existing windows with Ctrl shift W perfect.
So we have closed the window here in the bottom.
And for example, if we write something and we press Ctrl shift X here, we have made this terminal
bigger so we can see this command better.
And in order to go back to the previous configuration we can press again Ctrl shift X.
And so we are back with all our terminals.
So this is just a better management of this terminal.
So if you want to install it you simply need to use sudo apt get install terminator.
So in my case I already have this one.
So I already have the newest version.
And so actually whenever I open a new terminal automatically I have Terminator.
Perfect.
So now that we have Terminator, we can also move on to install some Ros2 packages to install any Ros2
package that is available in open source, we can use simply the command sudo apt get install followed
by ros as this is a Ros package, and then followed by the Ros two version that you are using that in
this case it's humble, followed by the name of the package that you want to download and install in
your PC.
Let's start by downloading.
And so by installing a package that we are going to use during the course.
And that is called Joint State Publisher GUI.
So let's press enter.
And as the name of this package suggests this is going to offer a graphical user interface.
So a guy from which we can interact with the joints of our robot.
Then let's install another Ros2 package.
So still with the same command.
So with sudo apt get installed ros humble as we are on Ros humble now.
So now we are on ubuntu 22 and install the exact package.
Then let's also install another package that is the gazebo package.
And this is called ros gz.
And let's install all the packages that belong to gazebo.
So let's press enter.
And this will install a lot of packages.
So as you can see here, I already have all these packages.
But in your case if you don't have all these packages it will install them.
And we are going to use all of these packages in order to start a software called gazebo.
So as you can see here, this is gazebo simulation.
And this will offer a simulated environment in which we will simulate our robot.
Then let's also install another package that is called Ros two control.
So let's install the Ros two control package.
And as the name of this package suggests, it is going to offer the functionalities in order to control
the joints of our robot.
And then also let's install the Ros two controllers package.
Perfect.
And also now that we have the Ros two control package, and also we have the gazebo package, we can
also install a gazebo plugin.
So this software here.
So this simulator here Offers various plugins that one can install and configure in order, for example,
to simulate sensors, or also like in this case, to simulate the control system of the robot.
And so we can install the package that is called ignition Ros to control.
And also in this case let's install all of them.
Basically this package here will contain a lot of functionalities and will contain a plugin that will
allow us to use the Ros to control library, also in the gazebo version that in this case if you are
on Ros2, humble is called ignition.
So that's why we are using ignition.
But this is just a name for gazebo.
So for the gazebo version that you are going to use here in Ros2 humble.
Finally, let's also install another very useful package that we are going to use intensively during
this course that is called Move It.
And also in this case let's install all the Moveit packages.
So let's press enter.
And as you can see here this will install a lot of packages.
So here I already have all of them.
But if you don't this is going to install a lot of packages.
And all of these packages contain some very useful functionalities for the control, for the planning
and for the obstacle avoidance of manipulator robots.
So we are going to use a lot of tools and utilities from this library here.
So from the movie library now we have done with the installation of the Ros packages and we can install
some other packages starting with the lib serial package.
So let's install it with sudo apt get install the lib serial dev.
So let's press enter.
And there's the name of this package suggests we are going to use it in order to communicate.
So in order to send messages to the Arduino board using the serial port and this one here.
So exactly this package here is the one that we are going to use in order to communicate with the Arduino
board using a C plus plus node.
Then in order to do the same also for the Python node.
So in order to write a Python node that can send commands to the Arduino board, we need to install
the python package manager.
So with sudo apt get install and let's install the Python three pip.
So the python package manager.
And then using pip we can install the package that is called pi serial.
So let's press enter.
And actually this package here is the equivalent version for Python of the lib serial package.
So this library here that instead we are going to use for C plus plus then still using pip.
Let's also install another package that is called flask.
And basically this Python library will allow us to create a web server on our PC.
And then let's also install the flask Ask SDK library.
Perfect.
And this library here is that will allow us to interface our web server.
So the one that we will create using flask with the Alexa SDK.
And so basically we will enable the interface between Alexa and our robot.
Still, in order to develop this interface we also need another library that is that is called ask SDK.
So let's install also this library.
Perfect.
And with this we have done so we have installed all the Ros2 packages that we need.
And also we have installed all the Python packages that we need in order to enable the communication
between our robot and the Alexa voice assistant, so that the Alexa voice assistant will send commands
to our robot and our robot will execute them.