WEBVTT

00:00.340 --> 00:03.640
In this lesson, we are going to create a new Alexa skill.

00:03.640 --> 00:09.760
So a voice assistant action that performs a specific operation when it is activated.

00:09.940 --> 00:16.510
Specifically, the action that we are going to develop will enable the Voice assistant to send several

00:16.510 --> 00:20.560
comments to the robot in response to different received voice commands.

00:21.270 --> 00:22.710
To develop an Alexa skill.

00:23.070 --> 00:29.820
Amazon provides a user friendly web application so a developer console where the developers can not

00:29.820 --> 00:36.510
only create new skills and voice assistant actions, but also can test and activate those actions using

00:36.510 --> 00:40.950
their own voice as if they were interacting with a real voice assistant.

00:41.280 --> 00:51.330
So to find the Alexa developer console, let's type on Google Alexa Developer console or just click

00:51.330 --> 00:54.390
on the link that I leave in the description of this course.

00:54.480 --> 00:56.940
So let's click on the first one.

00:58.540 --> 01:03.790
And here, if you already have an Amazon account, you can use it also to access to the Alexa developer

01:03.790 --> 01:04.430
console.

01:04.450 --> 01:06.670
So here, let's click on login.

01:06.670 --> 01:09.580
And now here you can use your Amazon account.

01:09.580 --> 01:14.770
So I will use my own account, but if you don't have one, you can register here.

01:15.410 --> 01:17.270
So let's log in.

01:19.900 --> 01:24.200
And in this developer console, we can start by creating a new skill.

01:24.220 --> 01:28.810
So let's click here on the developer console.

01:29.200 --> 01:30.960
So let's go to the developer console.

01:30.970 --> 01:36.580
This will open a new link and here we can start creating our skill so our Alexa skill.

01:37.120 --> 01:42.070
Let's start by clicking on Create Skill and now let's give it a name.

01:42.070 --> 01:45.100
So let's, for example, call it as our robot.

01:46.480 --> 01:48.010
That is the Arduino bot.

01:48.040 --> 01:50.490
Next, we need to define also a language.

01:50.500 --> 01:52.750
Let's use English us.

01:52.960 --> 01:55.540
So let's click on next here.

01:55.540 --> 01:59.920
We also need to select the type of experience let's set to other.

02:00.560 --> 02:03.980
And then we need to select a model to begin creating our skill.

02:03.980 --> 02:10.880
And while Amazon Alexa offers a variety of predefined models for interacting with Alexa, there is currently

02:10.880 --> 02:14.690
no model that is specifically for interacting with our robot and Ros2.

02:15.050 --> 02:17.660
Therefore, let's start with a custom model.

02:17.660 --> 02:23.420
So this one here in which we are going to build our skill and our interaction model with the robot.

02:24.100 --> 02:26.530
So then let's move down.

02:26.530 --> 02:29.560
And the next we need to select the hosting service.

02:29.560 --> 02:35.050
Since Alexa needs to communicate and exchange information with our skill through the Internet.

02:35.050 --> 02:40.570
And so we are going to configure how we intend to make our new skill accessible to the Internet.

02:40.870 --> 02:47.110
As mentioned in the theoretical lessons, we are going to use a software called Ngrok that creates and

02:47.110 --> 02:49.450
hosts a web service on our PC.

02:49.780 --> 02:57.220
So this web service will serve as access point for the Alexa Assistant to send commands to our PC and

02:57.220 --> 02:58.450
so to our robot.

02:58.480 --> 03:01.990
Therefore, let's choose the provide on your own.

03:01.990 --> 03:03.490
So let's choose the third one.

03:03.790 --> 03:06.100
And now let's click on next.

03:07.030 --> 03:09.610
And let's click on Start from scratch.

03:09.850 --> 03:11.920
So still click on Next.

03:12.190 --> 03:14.620
And now we can finally create our skill.

03:16.830 --> 03:18.720
This will take a couple of seconds.

03:18.720 --> 03:22.530
So as here in order to build our skill.

03:27.890 --> 03:30.590
We can close this window here and now.

03:30.590 --> 03:34.070
Let's wait for the console to finish creating and configuring.

03:34.070 --> 03:39.020
So as we can see here, there is building progress in order to start configuring it.

03:41.810 --> 03:48.040
Now, once this is done so we can start actually customizing this skill by defining.

03:48.050 --> 03:50.120
So here an invocation name.

03:50.120 --> 03:54.140
So this is a word or a phrase that we want to use to start.

03:54.140 --> 03:57.290
So to activate the interaction with our skill.

03:57.650 --> 04:05.480
For example, let's type the phrase activate the robot.

04:05.810 --> 04:10.940
For example, let's use the phrase activate robot.

04:11.180 --> 04:18.020
This means that whenever we say Alexa activate Robot, the voice assistant will understand that we want

04:18.020 --> 04:19.400
to interact with this skill.

04:19.400 --> 04:24.140
And so we'll begin the communication with the web service that we are hosting on our PC.

04:24.140 --> 04:27.080
And so it will begin to send commands to the robot.

04:27.380 --> 04:29.360
Let's save this invocation name.

04:29.360 --> 04:31.100
So let's click on Save.

04:33.420 --> 04:36.690
And now we can move on to the interaction model.

04:36.690 --> 04:40.650
So let's click here on the interaction model and then to the intents.

04:41.340 --> 04:47.760
So here are listed all the skill functionalities, so all the voice commands that are required to activate

04:47.760 --> 04:49.860
each functionality by default.

04:49.860 --> 04:56.580
We can see that just by creating this skill, some intents are created by default, so are already present

04:56.580 --> 05:02.730
and these are the ones to interact with the skill in order to cancel it or to stop the interaction with

05:02.730 --> 05:03.330
Alexa.

05:04.270 --> 05:08.680
Now let's, for example, delete the word intent.

05:08.980 --> 05:13.780
Let's remove this one and let's create instead a new one.

05:13.780 --> 05:18.220
And let's call this one pick intent.

05:18.430 --> 05:23.830
And now we need to add a list of the commands that we are going to need to activate this intent.

05:23.920 --> 05:26.830
So first, let's create this custom intent.

05:26.830 --> 05:35.980
And now, for example, the command that can activate this pick action is pick up this pen.

05:36.340 --> 05:47.950
So let's press enter or also grab the pen or also, for example, we can say pick the pen.

05:48.160 --> 05:54.640
So whenever we say one of these three commands to the Alexa assistant, it will automatically send a

05:54.640 --> 05:56.380
goal to our action server.

05:56.390 --> 06:02.410
So to our task server that is available on the robot and it will bring the robot in the pick position.

06:03.960 --> 06:05.610
We can also add more comments.

06:05.610 --> 06:11.280
So, for example, if you want, you can also add more phrases that you want to say if you want to enable

06:11.280 --> 06:12.240
the intent.

06:12.240 --> 06:15.300
But for the moment, we are happy about these three comments.

06:15.300 --> 06:16.680
So these are enough.

06:16.680 --> 06:19.800
And now let's proceed to create a new intent.

06:19.950 --> 06:22.110
So let's go back to the intents.

06:22.140 --> 06:26.220
Now we can see that we have our pick intent here has been created correctly.

06:26.220 --> 06:29.040
And also it has three phrases.

06:29.040 --> 06:33.150
So we can say three different comments to activate this pick intent.

06:33.860 --> 06:39.920
Let's create a new one and let's call this one sleep indent.

06:40.190 --> 06:44.120
Now let's create this custom intent and we want to activate this one.

06:44.120 --> 06:53.090
When we say the phrase rest or sleep or turn off the robot.

06:54.160 --> 06:59.860
So when we say one of these three phrases, basically the intent is the intent will be activated and

06:59.860 --> 07:02.560
this will send a slip command to the robot.

07:02.560 --> 07:03.910
So to the task server.

07:04.800 --> 07:05.880
Let's move on.

07:06.060 --> 07:09.000
So let's go back, let's say first.

07:10.860 --> 07:12.780
And then let's go back to the intense.

07:13.860 --> 07:16.110
And let's add one last intent.

07:16.140 --> 07:22.710
So here and let's call this one wake intent.

07:22.740 --> 07:24.810
So let's create this intent.

07:25.050 --> 07:31.110
And now let's add the list of the commands that we want to use in order to activate this wake intent.

07:31.230 --> 07:44.520
For example, the phrase wake up the robot or also activate the robot, or also, for example, just

07:44.520 --> 07:45.180
wake up.

07:45.300 --> 07:47.790
Let's save also this intent.

07:49.650 --> 07:55.380
And now if we go back in the intense following, the same procedure, if you wish, you can continue

07:55.380 --> 08:01.740
adding functionalities to the Alexa skill, sending actions to the robot and creating also a more complex

08:01.740 --> 08:03.480
voice interaction model.

08:03.480 --> 08:05.520
And so with more capabilities.

08:05.670 --> 08:11.530
For now, I will stop here and we will move on configuring the next section of the console.

08:11.550 --> 08:14.550
So let's go the next section.

08:15.890 --> 08:17.780
Is the endpoint section.

08:17.780 --> 08:20.870
So this one here is the one that we need to configure now.

08:21.940 --> 08:22.570
Here.

08:22.570 --> 08:27.460
We need to indicate the address that Alexa is to use for the communication with the robot.

08:27.460 --> 08:34.780
And so for the communication with our PC, since we plan to provide and host the robots kill ourselves

08:34.780 --> 08:41.020
using Andyrock, we can choose here the protocol to be Https.

08:41.380 --> 08:47.500
And then for now, here, let's enter a placeholder address in the Uri field.

08:47.500 --> 08:51.040
So here and under the default region.

08:51.040 --> 09:00.010
So here, let's just say for example, https and rock.io.

09:00.010 --> 09:06.580
But we will come back later to modify this address with the one that Ngrok will provide us once we start

09:06.630 --> 09:07.260
Andyrock.

09:08.060 --> 09:08.540
Next.

09:08.540 --> 09:12.610
We also need to configure the SSL certificate type.

09:12.620 --> 09:19.610
So let's press on this window and let's click on the My development endpoint is a sub domain.

09:19.610 --> 09:21.410
So let's click on this one.

09:21.560 --> 09:24.680
And now we can save this configuration of the endpoint.

09:24.680 --> 09:26.960
So let's save this one.

09:26.990 --> 09:32.240
Even though, as I said, we will come back to modify in the future, this one here.

09:32.240 --> 09:39.020
So basically we are going to replace this one with the actual address that Ngrok will provide us.

09:40.380 --> 09:42.870
Now we can click on save.

09:42.870 --> 09:43.320
So.

09:44.620 --> 09:49.450
This saved the interaction model and now we can go back to our skill.

09:49.480 --> 09:51.760
So here to your skill.

09:51.940 --> 09:54.450
And now actually we can click on the Arduino bot.

09:54.460 --> 09:59.250
That is the name that we gave to our skill and now we can click on Build the Skill.

09:59.260 --> 10:06.250
So let's press build and this process will create the voice interaction model and the natural language

10:06.250 --> 10:12.070
processing for this skill, enabling it to convert and to understand the voice commands and also to

10:12.070 --> 10:14.020
activate the corresponding intents.

10:20.960 --> 10:26.420
Once the build of the voice interaction model is completed, we can proceed to test it.

10:26.450 --> 10:32.510
Although anyway, it won't be able to communicate with our robot yet, but at least we can see that

10:32.510 --> 10:38.210
the type and the content of the message that Alexa is going to try to send to the skill are correct.

10:38.360 --> 10:41.450
So let's go to the test section here.

10:42.620 --> 10:48.800
And here in this section, we can interact with the Alexa voice assistant as if we had a real Alexa

10:48.800 --> 10:49.280
device.

10:49.280 --> 10:52.010
And so we can use this one to test our skill.

10:52.370 --> 10:55.580
And so let's allow the usage of the microphone.

10:56.210 --> 10:59.870
And then let's set this one to the development.

10:59.870 --> 11:07.640
So now we are able to test our skill and now we can interact with here with the voice assistant both

11:07.640 --> 11:11.750
we can press the microphone and keep pressed this symbol here.

11:11.750 --> 11:16.280
So this icon here or also we can just type here the command.

11:16.550 --> 11:20.360
So for example, let's press this button.

11:21.450 --> 11:22.950
Activate robot.

11:26.510 --> 11:28.910
I am unable to reach the requested skill.

11:29.390 --> 11:35.420
And although Alexa returned with an error, since we have entered a placeholder address for the communication

11:35.420 --> 11:36.160
with our skill.

11:36.170 --> 11:43.250
So basically the voice assistant was not able to contact our service and so did not receive any response.

11:43.430 --> 11:49.070
However, the interesting part of this test is the message that appears in this console, and this is

11:49.070 --> 11:55.400
basically a Json message that the voice assistant in the next lesson will send to our web server.

11:55.400 --> 11:58.490
So to the web server that we are going to host on our PC.

11:58.490 --> 12:05.090
So this is the Json that we have to receive and also to interpret in order to then activate the corresponding

12:05.090 --> 12:05.780
action.

12:06.730 --> 12:10.270
For example, if we scroll at the end of this message.

12:10.360 --> 12:17.480
So here the interesting part is the type of the request that Alexa is sending to us.

12:17.500 --> 12:24.520
So, for example, now the assistant is requesting the launch request and this is always the first message.

12:24.520 --> 12:30.040
So the entry point of the interaction between the voice assistant and the Web service on our PC.

12:30.430 --> 12:37.300
All the other messages that Alexa will exchange with our skill so with our web server will have a similar

12:37.300 --> 12:37.960
format.

12:37.960 --> 12:43.360
And so they will have the request and they will have a field name type.

12:43.360 --> 12:48.820
And this will contain the type of the request that the assistant wants us to perform.

12:48.820 --> 12:55.180
So, for example, this in the future will contain the peak intent or also it will contain the wake

12:55.180 --> 12:55.900
up intent.

12:55.900 --> 12:59.140
And so basically all the intents that we have defined.

12:59.740 --> 13:04.170
Therefore, in the next lessons, we are going to create the code for our skill.

13:04.180 --> 13:10.690
So we are going to implement the logic that receives this Json message, decode this message and also

13:10.690 --> 13:17.260
based on the type of the request that it received communicates with the robot and Soviet Russia and

13:17.260 --> 13:20.350
moves the robot in order to perform a specific task.
