WEBVTT

00:00.110 --> 00:05.960
In this final laboratory lesson, we will create a new launch file and use it to start all the functionalities

00:05.960 --> 00:12.650
that we have developed so far during the course with the real robot to which we will give comments through

00:12.650 --> 00:14.270
the Voice assistant.

00:15.120 --> 00:20.310
Let's start by creating a new launch file within the Arduino board, bring up package.

00:20.310 --> 00:27.750
So here within the launch folder where we have already created the simulated robot dot launch, let's

00:27.780 --> 00:33.540
add a new file called Real Robot Dot Launch.

00:35.330 --> 00:35.930
Dot py.

00:36.530 --> 00:40.760
And since most of the applications that we want to run for the real robot.

00:40.790 --> 00:43.070
Work the same as for the real robot.

00:43.070 --> 00:47.210
As for the simulation, we can copy the content of the simulated.

00:47.240 --> 00:51.680
Robot and let's paste it here within the real robot.

00:51.710 --> 00:56.630
But anyway, for the real robot, we are not going to need Gazebo, for example.

00:56.870 --> 01:03.110
And also in this launch file, let's remove Gazebo here from the launch description.

01:03.320 --> 01:10.790
And now all this left is to change the value of the is sim argument for the controller and set it to

01:10.790 --> 01:11.180
false.

01:11.180 --> 01:17.840
So if you remember in the previous lessons we have added an argument to the controller dot launch dot

01:17.840 --> 01:18.200
pi.

01:19.280 --> 01:20.930
So this one, the SEC.

01:21.170 --> 01:28.250
And so let's customize this one to indicate that we want to launch the control system for the real robot.

01:28.340 --> 01:32.960
So here, let's set this one to false.

01:32.960 --> 01:35.990
And also let's do the same for Move It.

01:36.110 --> 01:40.490
So let's set the argument is same to false and we can leave instead.

01:40.490 --> 01:46.040
All the other instructions in the launch file unchanged as they are independent of whether we are using

01:46.040 --> 01:48.170
the real robot or the simulated one.

01:48.980 --> 01:54.010
Now everything is ready so we can finally see the result of our hard work.

01:54.020 --> 01:59.030
And so we can start all the functionality, all the applications that we have developed in this course.

01:59.600 --> 02:02.090
So let's connect the robot.

02:02.120 --> 02:08.420
Or better, let's connect the Arduino board that controls the robot to the PC through a USB cable.

02:09.380 --> 02:16.010
We have already uploaded the code on our board and so it is ready to take commands.

02:16.160 --> 02:18.830
Now let's open a new terminal.

02:19.460 --> 02:23.600
Let's go into the workspace and let's build it.

02:24.640 --> 02:27.910
And so this will compile also the new launch file that we have created.

02:28.210 --> 02:32.500
Now, within a new terminal, let's source the workspace.

02:32.650 --> 02:36.130
And now we can start all the functionalities for our robot.

02:36.130 --> 02:42.470
So with the command Ros to launch and from the Arduino bot, bring a package.

02:42.490 --> 02:47.320
Let's start the real robot dot launch dot pi.

02:47.470 --> 02:49.180
So let's press enter.

02:49.450 --> 02:53.920
We can see that there is an error, so let's go back.

02:55.980 --> 03:01.020
Most probably there is an error with the hardware interface and we can see the error here.

03:01.020 --> 03:03.870
So the error is with the Ros2 control library.

03:03.960 --> 03:09.870
And in fact we have we are using an invalid tag, so we have a typo.

03:10.110 --> 03:18.600
So if we go back in Visual Studio code and if we open the Arduino board ros2 control, we can see that

03:18.600 --> 03:19.890
the error is here.

03:20.130 --> 03:22.260
The name of the tag is Zakro.

03:22.590 --> 03:26.790
And then and unless so, let's save this.

03:27.210 --> 03:30.090
Let's interrupt the execution of our launch file.

03:30.090 --> 03:36.540
Now let's build the workspace again and let's give it one more try.

03:38.860 --> 03:43.930
Here, we can see that there is also an error in loading the controllers.

03:44.560 --> 03:49.660
So we can see that it wasn't able to loading the gripper controller.

03:49.690 --> 03:54.280
The joint state broadcaster and neither the arm controller.

03:55.140 --> 04:02.520
So if we go back to Visual Studio code, this is because if we go in the controller launch.

04:03.140 --> 04:05.660
Here, we can see that there is a typo.

04:05.870 --> 04:12.830
So here when we start the controller manager, we are passing the configuration file and we are passing

04:12.830 --> 04:16.730
the Arduino board controller, but the name is Arduino board controllers.

04:16.970 --> 04:19.510
So let's add the S here.

04:19.520 --> 04:22.100
So let's save it again.

04:22.100 --> 04:27.350
Let's interrupt the execution of the script and let's build it again.

04:29.600 --> 04:31.220
Let's give it one more try.

04:32.510 --> 04:36.140
Now we can see that the controllers are loaded correctly.

04:39.820 --> 04:41.200
And everything is working.

04:41.200 --> 04:47.530
So as we started this file, we can already see that the robot arm brings itself in the on position.

04:47.890 --> 04:53.350
Now we can also start moving our robot arm by opening a new terminal.

04:53.350 --> 04:57.640
And here let's start ngrok to communicate with Alexa.

04:57.880 --> 05:06.460
So let's go to the download folder in which I have the ngrok and let's start it with the command and

05:06.610 --> 05:07.000
rock.

05:07.030 --> 05:14.350
Let's start an Http server and then we want to open the port 5000 of the PC.

05:15.490 --> 05:22.420
Now, as you remember, as we are using the free version of Ngrok, we need to copy the new address

05:22.420 --> 05:23.650
that it provides.

05:23.890 --> 05:30.290
So let's copy this address here and let's paste it within the Alexa developer console.

05:30.310 --> 05:32.050
So within our skill.

05:33.680 --> 05:39.140
Let's go to the endpoint section and let's change the endpoint with the new one.

05:39.200 --> 05:40.580
Let's save it.

05:42.640 --> 05:46.930
And then now we can finally start sending comments to our real robot.

05:46.960 --> 05:50.140
So let's put the developer here.

05:50.260 --> 05:53.110
Let's go into the test section.

05:53.290 --> 05:55.390
Let's put our RVs here.

05:55.390 --> 05:58.930
So here in our RVs, we are going to see also the robot moving.

05:58.930 --> 06:05.500
So we will see both the real robot and also in RVs here, the user interface, the robot moving.

06:06.240 --> 06:08.640
So let's start interacting with Alexa.

06:09.790 --> 06:11.530
Activate robot.

06:14.360 --> 06:14.890
Hi.

06:14.900 --> 06:15.920
How can I help?

06:17.030 --> 06:18.080
Pick the pen.

06:20.580 --> 06:21.100
Okay.

06:21.150 --> 06:22.020
I'm moving.

06:25.080 --> 06:28.330
And now, as you can see, the real robot.

06:28.350 --> 06:31.250
And also we have its feedback in service.

06:31.290 --> 06:34.200
They are moving into the peak position.
