WEBVTT

00:00.080 --> 00:06.230
In this lesson, I will guide you step by step in setting up the development environment for ubuntu

00:06.260 --> 00:07.190
22.

00:07.220 --> 00:14.030
This is a fundamental step as using a good code editor that has properly been configured for our needs

00:14.060 --> 00:20.990
not only helps us to develop the code faster, but also to detect the errors in advance, and also provides

00:21.020 --> 00:23.270
guidance on how to resolve them.

00:23.630 --> 00:29.930
During this course, I will be using Visual Studio Code to develop all the code, and you will soon

00:29.930 --> 00:35.060
understand why this is the best choice for developing applications with Ros2.

00:35.090 --> 00:41.480
There are, in fact, countless plugins that you can install in order to configure and customize your

00:41.480 --> 00:47.720
development environment, offering various different functionalities from code Autocompletion that is

00:47.720 --> 00:53.720
available in almost every programming language, also to the customization of icons, comments, and

00:53.720 --> 01:00.190
most importantly, one thing that we will rely on this course is the support of Ros2.

01:00.220 --> 01:03.580
So let's start the configuration of these code editor.

01:03.610 --> 01:07.960
And simply in order to install it we can open the ubuntu software.

01:07.960 --> 01:12.130
So this one here that comes with the ubuntu 22 installation.

01:12.130 --> 01:16.720
And we will simply look for code perfect.

01:16.720 --> 01:21.610
And so let's go down here and we will need to install this one here.

01:21.610 --> 01:24.520
So Visual Studio Code as you can see here.

01:24.520 --> 01:26.110
So let's install it.

01:28.390 --> 01:31.960
And now let's wait for the installation of Visual Studio Code.

01:38.230 --> 01:42.610
Once it is installed we have it in the list of the applications.

01:42.610 --> 01:47.380
So let's open it and here we go.

01:47.380 --> 01:50.260
So this is the main page of Visual Studio Code.

01:50.260 --> 01:56.380
And here apart from choosing your team, the most important thing that we need to do is to install some

01:56.380 --> 02:00.880
extensions that are going to be very helpful in the development of the code.

02:00.940 --> 02:03.940
Let's start with the C plus plus extension.

02:03.970 --> 02:06.220
So this one here let's install it.

02:06.220 --> 02:08.500
And also let's install this one here.

02:08.500 --> 02:10.330
So the extension pack.

02:11.500 --> 02:12.250
Perfect.

02:12.280 --> 02:16.870
Then let's also install the Python extension.

02:17.860 --> 02:18.250
Perfect.

02:18.250 --> 02:22.240
So this one here for the support to the Python language.

02:22.450 --> 02:26.290
And then we also can install the CMake extension.

02:26.290 --> 02:29.320
And this one here are already being installed.

02:29.320 --> 02:34.510
So since we have installed the C plus plus extension these are installed along with it.

02:34.600 --> 02:35.830
So perfect.

02:35.860 --> 02:41.530
Let's also install the XML extension, this one here and also the XML tools.

02:41.560 --> 02:42.340
Perfect.

02:42.340 --> 02:46.840
So this will provide us the Autocompletion for the XML files.

02:46.960 --> 02:48.670
And now let's move on.

02:48.670 --> 02:54.040
Also with the installation of the most important extension that we are going to use in this course,

02:54.040 --> 02:56.190
that is the Ros extension.

02:56.190 --> 03:01.170
So this one here that is directly developed and supported by Microsoft.

03:01.170 --> 03:02.460
So let's install it.

03:03.810 --> 03:04.650
Perfect.

03:04.650 --> 03:08.670
So with this the configuration of Visual Studio Code is completed.

03:08.670 --> 03:15.120
And during the course we will see how to use and how to take advantage of the features offered by all

03:15.120 --> 03:17.550
these extensions that we have just downloaded.

03:17.550 --> 03:22.920
And that will help us to develop application faster, with fewer errors and with more ease.

03:22.980 --> 03:28.620
Now, after installing with Visual Studio Code so we can close it since we have all the extensions that

03:28.620 --> 03:29.160
we need.

03:29.190 --> 03:32.640
Let's move on to install other useful components.

03:32.640 --> 03:37.830
So since we will be using the Linux terminal quite extensively in this course.

03:37.830 --> 03:45.510
So this guy here, I recommend you installing a more advanced version of the standard ubuntu terminal

03:45.510 --> 03:48.420
that is this one here and is called Terminator.

03:48.420 --> 03:57.170
So as you can see here I have the normal ubuntu terminal that is this one here and here I have Terminator.

03:57.170 --> 04:00.170
And the cool thing about these different terminals.

04:00.170 --> 04:03.170
So basically they are the same and you can do the same things.

04:03.170 --> 04:10.190
But the cool thing about Terminator is that you can open more windows so you can open several different

04:10.220 --> 04:12.860
terminals within the same window.

04:12.860 --> 04:16.910
So here as you can see this has a better management of the windows.

04:16.910 --> 04:23.570
And also for example here with Ctrl shift E we can open a new window on the side.

04:23.570 --> 04:28.190
And with Ctrl shift O we can open a new window in the bottom.

04:28.190 --> 04:32.930
Also, we can close existing windows with Ctrl shift W perfect.

04:32.930 --> 04:35.960
So we have closed the window here in the bottom.

04:35.960 --> 04:44.660
And for example, if we write something and we press Ctrl shift X here, we have made this terminal

04:44.690 --> 04:47.360
bigger so we can see this command better.

04:47.360 --> 04:53.080
And in order to go back to the previous configuration we can press again Ctrl shift X.

04:53.110 --> 04:56.080
And so we are back with all our terminals.

04:56.080 --> 04:59.800
So this is just a better management of this terminal.

04:59.800 --> 05:09.040
So if you want to install it you simply need to use sudo apt get install terminator.

05:09.130 --> 05:12.820
So in my case I already have this one.

05:12.820 --> 05:15.340
So I already have the newest version.

05:15.430 --> 05:20.680
And so actually whenever I open a new terminal automatically I have Terminator.

05:20.680 --> 05:21.550
Perfect.

05:21.550 --> 05:29.980
So now that we have Terminator, we can also move on to install some Ros2 packages to install any Ros2

05:29.980 --> 05:38.650
package that is available in open source, we can use simply the command sudo apt get install followed

05:38.650 --> 05:45.340
by ros as this is a Ros package, and then followed by the Ros two version that you are using that in

05:45.340 --> 05:51.880
this case it's humble, followed by the name of the package that you want to download and install in

05:51.880 --> 05:52.540
your PC.

05:52.810 --> 05:54.670
Let's start by downloading.

05:54.670 --> 05:58.780
And so by installing a package that we are going to use during the course.

05:58.780 --> 06:04.930
And that is called Joint State Publisher GUI.

06:04.960 --> 06:06.400
So let's press enter.

06:07.870 --> 06:13.300
And as the name of this package suggests this is going to offer a graphical user interface.

06:13.300 --> 06:18.580
So a guy from which we can interact with the joints of our robot.

06:18.610 --> 06:21.490
Then let's install another Ros2 package.

06:21.490 --> 06:23.380
So still with the same command.

06:23.380 --> 06:28.450
So with sudo apt get installed ros humble as we are on Ros humble now.

06:28.450 --> 06:33.910
So now we are on ubuntu 22 and install the exact package.

06:33.940 --> 06:38.560
Then let's also install another package that is the gazebo package.

06:38.560 --> 06:42.010
And this is called ros gz.

06:42.010 --> 06:45.610
And let's install all the packages that belong to gazebo.

06:45.610 --> 06:47.170
So let's press enter.

06:47.170 --> 06:49.290
And this will install a lot of packages.

06:49.290 --> 06:52.380
So as you can see here, I already have all these packages.

06:52.380 --> 06:56.820
But in your case if you don't have all these packages it will install them.

06:56.820 --> 07:02.070
And we are going to use all of these packages in order to start a software called gazebo.

07:02.070 --> 07:05.550
So as you can see here, this is gazebo simulation.

07:05.550 --> 07:10.350
And this will offer a simulated environment in which we will simulate our robot.

07:10.410 --> 07:16.140
Then let's also install another package that is called Ros two control.

07:16.140 --> 07:18.480
So let's install the Ros two control package.

07:18.480 --> 07:25.260
And as the name of this package suggests, it is going to offer the functionalities in order to control

07:25.260 --> 07:27.300
the joints of our robot.

07:27.300 --> 07:32.070
And then also let's install the Ros two controllers package.

07:32.070 --> 07:33.030
Perfect.

07:33.060 --> 07:39.990
And also now that we have the Ros two control package, and also we have the gazebo package, we can

07:39.990 --> 07:42.120
also install a gazebo plugin.

07:42.120 --> 07:44.130
So this software here.

07:44.130 --> 07:50.720
So this simulator here Offers various plugins that one can install and configure in order, for example,

07:50.720 --> 07:56.450
to simulate sensors, or also like in this case, to simulate the control system of the robot.

07:56.690 --> 08:04.520
And so we can install the package that is called ignition Ros to control.

08:04.520 --> 08:07.370
And also in this case let's install all of them.

08:07.370 --> 08:13.160
Basically this package here will contain a lot of functionalities and will contain a plugin that will

08:13.160 --> 08:19.670
allow us to use the Ros to control library, also in the gazebo version that in this case if you are

08:19.670 --> 08:22.280
on Ros2, humble is called ignition.

08:22.280 --> 08:24.470
So that's why we are using ignition.

08:24.470 --> 08:27.410
But this is just a name for gazebo.

08:27.410 --> 08:31.790
So for the gazebo version that you are going to use here in Ros2 humble.

08:31.820 --> 08:36.950
Finally, let's also install another very useful package that we are going to use intensively during

08:36.950 --> 08:39.740
this course that is called Move It.

08:39.740 --> 08:43.790
And also in this case let's install all the Moveit packages.

08:43.790 --> 08:45.310
So let's press enter.

08:45.310 --> 08:48.940
And as you can see here this will install a lot of packages.

08:48.940 --> 08:51.370
So here I already have all of them.

08:51.370 --> 08:54.760
But if you don't this is going to install a lot of packages.

08:54.760 --> 09:01.210
And all of these packages contain some very useful functionalities for the control, for the planning

09:01.210 --> 09:04.990
and for the obstacle avoidance of manipulator robots.

09:04.990 --> 09:09.580
So we are going to use a lot of tools and utilities from this library here.

09:09.580 --> 09:15.940
So from the movie library now we have done with the installation of the Ros packages and we can install

09:15.970 --> 09:19.990
some other packages starting with the lib serial package.

09:19.990 --> 09:28.960
So let's install it with sudo apt get install the lib serial dev.

09:28.960 --> 09:30.520
So let's press enter.

09:30.520 --> 09:36.220
And there's the name of this package suggests we are going to use it in order to communicate.

09:36.220 --> 09:42.250
So in order to send messages to the Arduino board using the serial port and this one here.

09:42.280 --> 09:47.680
So exactly this package here is the one that we are going to use in order to communicate with the Arduino

09:47.680 --> 09:50.380
board using a C plus plus node.

09:50.440 --> 09:54.130
Then in order to do the same also for the Python node.

09:54.130 --> 09:59.470
So in order to write a Python node that can send commands to the Arduino board, we need to install

09:59.500 --> 10:01.060
the python package manager.

10:01.060 --> 10:10.240
So with sudo apt get install and let's install the Python three pip.

10:10.240 --> 10:11.980
So the python package manager.

10:11.980 --> 10:19.150
And then using pip we can install the package that is called pi serial.

10:19.150 --> 10:20.500
So let's press enter.

10:20.500 --> 10:27.700
And actually this package here is the equivalent version for Python of the lib serial package.

10:27.700 --> 10:33.010
So this library here that instead we are going to use for C plus plus then still using pip.

10:33.010 --> 10:37.480
Let's also install another package that is called flask.

10:37.480 --> 10:42.270
And basically this Python library will allow us to create a web server on our PC.

10:42.480 --> 10:50.880
And then let's also install the flask Ask SDK library.

10:51.270 --> 10:52.020
Perfect.

10:52.020 --> 10:57.390
And this library here is that will allow us to interface our web server.

10:57.390 --> 11:01.830
So the one that we will create using flask with the Alexa SDK.

11:01.830 --> 11:07.020
And so basically we will enable the interface between Alexa and our robot.

11:07.050 --> 11:13.770
Still, in order to develop this interface we also need another library that is that is called ask SDK.

11:13.800 --> 11:16.140
So let's install also this library.

11:18.780 --> 11:19.590
Perfect.

11:19.590 --> 11:23.880
And with this we have done so we have installed all the Ros2 packages that we need.

11:23.880 --> 11:29.100
And also we have installed all the Python packages that we need in order to enable the communication

11:29.100 --> 11:35.820
between our robot and the Alexa voice assistant, so that the Alexa voice assistant will send commands

11:35.820 --> 11:38.730
to our robot and our robot will execute them.
