WEBVTT

00:00.290 --> 00:07.940
In this laboratory lesson, we will use some tools from the TF2 Library of Ros two to create a C plus

00:07.940 --> 00:14.570
plus service server for the conversion of the orientation of an object from its representation in quaternion

00:14.570 --> 00:17.210
to Euler angles and vice versa.

00:17.810 --> 00:23.180
The service will be useful during the course whenever you want to know the corresponding Euler angles

00:23.180 --> 00:25.640
for a given quaternion or vice versa.

00:26.720 --> 00:33.050
If you haven't followed the previous Python laboratory lesson, then you need to create a new package

00:33.050 --> 00:34.790
in our workspace.

00:34.910 --> 00:42.200
So let's open a terminal and here let's go to the Arduino bot workspace and then to the source folder.

00:42.200 --> 00:47.780
And here where we have already created all the packages that implement the functionalities of the robot

00:47.780 --> 00:48.620
so far.

00:48.830 --> 00:50.920
We need to create a new package.

00:50.930 --> 00:57.590
So, so if you haven't already, we have to create the Arduino bot utils package and we can do so with

00:57.590 --> 01:01.520
the command ros2 package create.

01:01.520 --> 01:03.710
Then let's choose the build type.

01:04.910 --> 01:11.180
And in this case, as we are going to include both Python and C plus plus node in this package, let's

01:11.180 --> 01:21.050
use the Amend CMake as a build type and the package is called Arduino bot utils so you can press enter

01:21.050 --> 01:22.640
to create this package.

01:22.730 --> 01:26.820
I already have it so I will not create it.

01:26.820 --> 01:31.110
And then you need to go back to the workspace and run the command.

01:31.140 --> 01:34.170
Click on Build in order to rebuild the workspace.

01:34.170 --> 01:41.070
And so in order for the new package, so for the Arduino bot utils package to be recognized in Ros two

01:41.610 --> 01:44.430
now we can go back to Visual Studio code.

01:44.760 --> 01:50.850
So let's open Visual Studio code and let's open the Arduino bot utils package that we have just created.

01:51.210 --> 01:58.170
As usual, let's place all the C plus plus source code inside the SRC folder.

01:58.170 --> 02:06.630
So here let's create a new file called Angle Conversion dot CP.

02:07.470 --> 02:13.110
This file will contain the actual code for the conversion between the angular angles and quaternion

02:13.110 --> 02:14.310
and vice versa.

02:15.440 --> 02:21.590
In this script, we are going to create two service server inside our EC2 node, one for the conversion

02:21.590 --> 02:25.370
to Quaternion to Euler and the other one for the opposite conversion.

02:25.370 --> 02:27.410
So from Euler to quaternion.

02:27.770 --> 02:33.710
However, instead of rewriting the code that we already know, we can copy the content of the simple

02:33.710 --> 02:34.790
service server.

02:34.790 --> 02:40.430
So the one that we developed in the Arduino bot CP examples in the source folder.

02:40.430 --> 02:47.660
So let's open the simple service server and let's copy all the content and let's paste it here.

02:47.660 --> 02:50.960
So let's paste it in the angle conversion.

02:51.080 --> 02:54.650
And now let's start by changing the name of the class.

02:54.650 --> 02:59.960
So let's call this one angles converter.

02:59.960 --> 03:04.250
And still this one inherits from the CP node class.

03:04.340 --> 03:11.000
Let's change also the name of the constructor and also within the bind function, Let's change the name

03:11.000 --> 03:12.140
of the class.

03:12.500 --> 03:14.630
Now let's change the name of the node.

03:14.630 --> 03:20.670
So here, let's call the node angles Conversion.

03:22.530 --> 03:23.520
Service.

03:23.910 --> 03:27.710
And now let's start by creating two service servers.

03:27.720 --> 03:31.840
So here with this instruction, we create one service server.

03:31.860 --> 03:37.620
So let's copy this one and let's paste it below in order to create the second one.

03:38.290 --> 03:40.780
Let's call the first service server.

03:40.870 --> 03:43.090
User two Quaternion So.

03:47.520 --> 03:53.130
And so let's also change the name of this variable here among the private variables.

03:53.700 --> 03:56.130
So this is the Euler to quaternion.

03:56.490 --> 03:59.930
Let's also create a new private variable.

03:59.940 --> 04:06.150
So a new instance of the service class by a new shared pointer of the service class.

04:06.150 --> 04:14.690
And let's call this one, as you might have imagine, quaternion to user.

04:15.240 --> 04:23.420
And so let's store the content of the quaternion to user as the output of the create service function.

04:23.430 --> 04:25.890
So let's call the first service.

04:25.890 --> 04:31.920
So the one that we are storing in the user to quaternion variable, let's call it as well, user to

04:31.950 --> 04:32.760
quaternion.

04:33.000 --> 04:34.320
And the second one.

04:34.320 --> 04:40.320
So the second service, let's call it quaternion to Euler, and these are the two names.

04:40.320 --> 04:45.360
So Euler to quaternion and Quaternion to Euler are the two names of the service servers.

04:45.360 --> 04:52.030
So the one that in Ros2 will be available for the client to interact with these two services.

04:52.510 --> 04:56.260
Then let's also change the message that we are going to print in the terminal.

04:56.470 --> 05:05.410
And so let's says Angle conversion services are ready.

05:05.590 --> 05:12.130
So let's print this message here and now we need to change also the name of the callback function that

05:12.130 --> 05:14.560
each of these two service server calls.

05:14.770 --> 05:20.470
So for example, the first callback function, so the one executed by the user to quaternion service

05:20.500 --> 05:34.840
is also called Euler to Quaternion callback, and the second one is called Quaternion to Euler callback.

05:34.840 --> 05:41.320
So these are the two callback functions that are executed and still both of them receive two parameters

05:41.320 --> 05:44.770
as input that are the request and response message.

05:44.770 --> 05:49.120
So the interface message for the communication with the service server.

05:49.300 --> 05:52.240
So let's declare also these two functions.

05:52.240 --> 05:54.670
So the other two quaternion callback.

05:54.670 --> 06:03.850
So let's for example, rename the service callback into Euler to Quaternion, then let's leave its content

06:03.850 --> 06:04.570
empty.

06:04.990 --> 06:12.400
Let's copy this function and let's paste it below in order to declare the second callback function.

06:12.400 --> 06:20.010
So this one that is the quaternion to Euler callback before proceeding to define the logic of the two

06:20.020 --> 06:25.900
callback functions, we need to remember to define the communication interface with the two services.

06:25.900 --> 06:31.120
So as you can see now we are still using the old one that was the add to interface.

06:31.240 --> 06:37.030
This means that we need to define how the request and the response message of the new service server

06:37.030 --> 06:40.390
should look like for the interaction with the service.

06:40.780 --> 06:46.930
If you haven't followed me in the Python laboratory lessons, we need to define these interfaces inside

06:46.930 --> 06:49.210
the Arduino bot messages package.

06:49.210 --> 06:53.800
So inside this package here, inside the SRB folder.

06:53.800 --> 07:01.960
So we need to create two new more interfaces, two new more files, the Euler two quaternion XV and

07:01.960 --> 07:04.090
the Quaternion two Euler SRB.

07:04.540 --> 07:08.950
Let's start from the first one, the Euler two Quaternion interface.

07:09.220 --> 07:16.090
In this case, the request message contains three decimal number three floating points that are the

07:16.090 --> 07:18.790
three components, the three Euler angles.

07:18.790 --> 07:20.860
So roll pitch and yaw.

07:21.130 --> 07:27.640
And the response message instead contains four element, four decimal numbers that are the four components

07:27.640 --> 07:32.050
of the quaternion that here we called X, y, z, and W.

07:32.440 --> 07:37.720
The second interface that we need to declare is the quaternion to Euler interface.

07:37.720 --> 07:45.370
And within this file, the request message this time is composed of four variables of four decimal numbers

07:45.370 --> 07:49.420
that are X, Y, z and W, and the second one.

07:49.420 --> 07:56.320
So the response message is composed of three components that are the three rotation of the Euler angles.

07:56.320 --> 07:58.240
So the roll pitch and yaw.

08:00.130 --> 08:07.000
Then in order to ensure that both of these interfaces are recognized and compiled, let's also add these

08:07.000 --> 08:10.330
ones into the cmakelists.txt.

08:10.630 --> 08:18.250
And so here, where we have already defined the Add interface, we need to add two more lines that are

08:18.280 --> 08:25.060
the ones to declare the Euler to quaternion interface and the quaternion to user interface.

08:25.240 --> 08:27.490
And now we can save this file.

08:27.730 --> 08:31.540
And also before using these two interfaces within our script.

08:31.540 --> 08:37.480
So within our angle conversion file, let's open a new terminal and let's build the workspace.

08:37.900 --> 08:45.490
So let's go into the workspace and let's build it in order for the two new interfaces to be compiled

08:45.490 --> 08:48.100
and so that we can use them in our script.

08:48.670 --> 08:53.750
So once this is compiled, we can start importing the interface.

08:53.770 --> 09:01.560
So still here we can reuse this line and still from the Arduino bot messages libraries from the SRB

09:01.570 --> 09:12.370
folder, let's import the Ula to quaternion dot ZP and then let's also include still from the Arduino

09:12.370 --> 09:15.810
board messages from the services of this package.

09:15.820 --> 09:20.740
Let's include the quaternion to Euler dot ZP.

09:21.190 --> 09:23.020
Now let's use the first interface.

09:23.020 --> 09:31.840
So the interface for the communication with the Euler to quaternion is the Ula to quaternion and for

09:31.840 --> 09:32.950
the second interface.

09:32.950 --> 09:41.440
So for the communication with the service quaternion to Ula, let's use the quaternion to Ula interface.

09:41.440 --> 09:43.150
And also we need to change.

09:43.150 --> 09:50.510
So we need to set these ones here when we create the Ula to quaternion object, we need to use the Ula

09:50.510 --> 09:57.410
to quaternion interface and the quaternion to ula interface when we create the quaternion to ula object.

09:57.710 --> 09:58.790
So this one.

09:58.790 --> 10:03.980
And also finally we need to change the type also of the interface within the callback function.

10:04.610 --> 10:12.170
So the ula to quaternion callback function receives as input a request message that belongs to the Ula

10:12.170 --> 10:19.520
to quaternion interface and returns a response message that still belongs to the ula to quaternion interface.

10:20.120 --> 10:26.600
Then the quaternion to Euler callback function still receives a request message that this time belongs

10:26.600 --> 10:33.630
to the quaternion to user interface and also returns a response message.

10:33.650 --> 10:37.400
Also this one that belongs to the quaternion to Euler interface.

10:38.220 --> 10:39.360
And now we can move on.

10:39.390 --> 10:42.520
Defining the content of the two callback functions.

10:42.540 --> 10:48.570
And so the logic for the conversion of the orientation between the two conventions, so between Euler

10:48.570 --> 10:50.100
to Quaternion and vice.

10:51.090 --> 10:54.540
Let's start with the Euler to quaternion callback function.

10:54.540 --> 11:03.870
And so let's start by printing an informative message into the terminal with the Rql CPP info stream

11:03.870 --> 11:04.620
function.

11:04.860 --> 11:19.290
So let's use the CPP get log to get the logger of rql cpp and then let's print the message request to

11:19.290 --> 11:22.860
convert user angles.

11:23.280 --> 11:29.320
And now let's print the three Euler angles that were received in the request message.

11:29.340 --> 11:35.520
So the role is in the variable request.

11:36.180 --> 11:38.110
And here this is a pointer.

11:38.110 --> 11:41.440
So let's access to the role.

11:42.430 --> 11:47.140
Then let's also print the pitch.

11:50.060 --> 11:52.520
Still from the request message.

11:52.880 --> 11:54.410
Let's take the pitch.

11:55.010 --> 11:58.490
And then finally, let's take the yo.

12:00.840 --> 12:05.400
And so from the request message, let's take the yaw angle.

12:05.400 --> 12:07.620
So let's print also the yaw angle.

12:07.620 --> 12:10.050
And we want to convert all of these.

12:11.150 --> 12:14.630
Into a quaternion.

12:15.650 --> 12:19.730
So now let's insert the actual logic of the conversion.

12:19.730 --> 12:26.420
And to perform the actual conversion, we can use the TF2 package that is available in Ros two.

12:26.720 --> 12:29.630
So first, let's import this package.

12:29.960 --> 12:40.130
So let's include from the TF2 package the utils modules and now we can use this module to create a new

12:40.130 --> 12:42.560
instance of the quaternion class.

12:42.560 --> 12:51.440
So here from the TF2 namespace, let's create a quaternion and let's call this variable Q.

12:51.950 --> 12:57.470
And this class offers a very useful function that is called set Rpy.

12:57.800 --> 13:05.870
So on the object Q Let's call this set Rpy function, and we can use this function to initialize a quaternion

13:05.900 --> 13:09.110
object based on the three Euler angles.

13:09.110 --> 13:15.000
So based on the three components of the Euler angles, so roll pitch and yaw, and so we can pass to

13:15.000 --> 13:20.070
this function exactly the roll pitch that we received in the request message.

13:20.310 --> 13:27.960
So from the request message, let's take the roll, then the pitch.

13:30.050 --> 13:31.660
And finally also the EU.

13:32.270 --> 13:35.840
Here there is an error, so we don't need a comma.

13:36.750 --> 13:39.090
And here the name is Request.

13:40.690 --> 13:41.920
Okay, now it's fine.

13:42.280 --> 13:45.040
And now we have basically a quaternion object.

13:45.040 --> 13:51.130
So the variable Q that has been constructed based on the three angles.

13:51.130 --> 13:56.950
And so at this point, we can save these four components of the quaternion into the four coefficients.

13:56.950 --> 14:01.330
So into the variable that we need to return into the response message.

14:01.660 --> 14:09.280
So let's access to the response message and we need to assign a value to the variable X and we can use

14:09.280 --> 14:18.190
the variable Q So the quaternion and let's use the get X function, we can do the same for the variable

14:18.190 --> 14:26.710
Y, So let's use the get y function then let's do the same for the variable Z.

14:28.560 --> 14:39.780
Again calling the get Z function and the variable W of the quaternion with the get W.

14:40.890 --> 14:46.530
Finally, once the conversion is done, let's also print another informative message into the console.

14:57.640 --> 15:09.340
So let's use the get logger function to get the logger and let's print the message corresponding.

15:12.630 --> 15:15.190
Mueller quaternion.

15:16.110 --> 15:20.640
And so let's print the four components of the quaternion that are X.

15:22.770 --> 15:26.850
So let's print from the response message the X.

15:27.600 --> 15:31.170
Then let's print the Y.

15:35.030 --> 15:37.280
Then let's print the Z.

15:42.940 --> 15:44.860
And then let's print also the W.

15:52.990 --> 15:57.610
And so with this one, we have all the four components printed into the terminal.

15:58.090 --> 16:00.720
Let's continue with the second callback function.

16:00.730 --> 16:05.350
So the one that we called here quaternion to Euler callback function.

16:05.350 --> 16:12.550
And again, let's start by printing an informative message into the terminal so we can copy this one

16:12.550 --> 16:24.850
in order for avoiding rewriting this code and let's print the message requested to convert quaternion.

16:24.970 --> 16:30.640
And so now let's print the four components of the quaternion that we received this time in the request

16:30.640 --> 16:31.450
message.

16:31.450 --> 16:41.950
So X is the one that we received in the request message in this called X, Then we have Y.

16:45.500 --> 16:47.480
And this is the request.

16:48.230 --> 16:49.030
Why?

16:50.060 --> 16:52.940
Then we have the Z.

17:01.290 --> 17:05.070
And finally, we have the W.

17:09.530 --> 17:10.250
And do this.

17:10.280 --> 17:13.040
We have the four components of the quaternion.

17:14.090 --> 17:20.030
And then now we need to perform the conversion from the quaternion angles to Euler angles.

17:20.360 --> 17:23.660
To do so, we can still use the quaternion class.

17:23.670 --> 17:30.830
And so again, from the Tfcu library, let's create a new quaternion object and let's call this one

17:30.830 --> 17:37.400
Q And this time we use it to create a quaternion from the four coefficients of the quaternion.

17:37.400 --> 17:42.830
So from the four components of the quaternion that we received this time in the request message.

17:42.980 --> 17:48.050
So let's create this quaternion object based on the request message.

17:48.170 --> 17:57.560
So X, Y, z, and W, so these are the four components.

17:57.650 --> 18:00.770
And then again, using the TF2 library.

18:00.770 --> 18:07.550
So TF2 library, we can create a new object of type matrix three by three.

18:07.760 --> 18:14.580
So this one and let's call this matrix M and this object can be initialized from a quaternion.

18:14.580 --> 18:16.560
So from a quaternion object.

18:16.560 --> 18:20.130
And so from the variable that we called Q this class.

18:20.130 --> 18:28.260
So the matrix three by three class offers a very useful function called get r, P, which stands for

18:28.260 --> 18:29.790
Get roll pitch and yaw.

18:30.060 --> 18:34.620
So on the M object, let's call the get r, P.

18:35.550 --> 18:41.310
And so this function here basically returns the roll pitch and the values.

18:41.310 --> 18:48.660
So the Euler angles that we get after the conversion of the quaternion into a rotation matrix.

18:48.660 --> 18:51.720
So basically this matrix is a rotation matrix.

18:51.720 --> 18:56.190
This rotation matrix is constructed based on the value of the quaternion.

18:56.190 --> 19:03.180
And now from the rotation matrix, we can get the roll pitch and so the Euler angles and let's store

19:03.180 --> 19:06.840
these ones directly into the response message.

19:06.930 --> 19:14.960
So into the roll pitch and also into the yaw at the end.

19:14.960 --> 19:17.390
Let's also print another informative message.

19:18.170 --> 19:21.560
So let's still copy this one.

19:22.370 --> 19:23.700
Let's paste it here.

19:23.720 --> 19:25.610
Let's close the parentheses.

19:25.970 --> 19:28.100
And let's print the message.

19:29.390 --> 19:34.000
Corresponding user angles.

19:34.010 --> 19:39.560
And so let's print the URL that is in the response message.

19:39.590 --> 19:40.910
The URL value.

19:41.360 --> 19:45.800
Then let's also print the pitch.

19:47.630 --> 19:50.750
So let's print the pitch variable.

19:51.980 --> 19:55.430
And finally, let's print the yo.

20:00.870 --> 20:03.600
That is still in the response message with this.

20:03.630 --> 20:10.950
We have completed the implementation of our Angles Converter class, so all the class is completed.

20:10.950 --> 20:17.250
We have defined its constructor and also two callback functions that are called when one of the two

20:17.250 --> 20:19.260
services of the class gets called.

20:20.220 --> 20:23.730
Now we only need to change the name of the class to instantiate.

20:23.730 --> 20:31.470
So here in the main function, the class that we want to instantiate is the Angles Converter class.

20:31.650 --> 20:35.540
And now we are ready to install this script and to execute it.

20:35.550 --> 20:41.820
So let's save this file and let's start by modifying the file Cmakelists.txt.

20:42.480 --> 20:53.160
So here, let's include the dependency from the Rql CPP package since we used it in our C plus plus

20:53.160 --> 20:53.760
node.

20:53.880 --> 21:00.090
And also if you haven't followed me in the python lessons, we need to include the Arduino board messages

21:00.090 --> 21:07.140
package as we have used the definition of the Urartu quaternion and quaternion to user interfaces.

21:07.590 --> 21:12.330
Also, as in our C plus plus script, we have used the TF2 library.

21:12.480 --> 21:14.910
Let's also declare the usage of this library.

21:15.360 --> 21:22.600
So let's add a new Findpackage instruction in which we declare the usage of the TF2 package.

21:23.110 --> 21:29.790
Now to install actually a word node, let's add a new abstraction of type add executable.

21:29.800 --> 21:34.810
So here before the python install package, let's add the add

21:37.180 --> 21:42.130
executable instruction and let's name the new node angle

21:44.440 --> 21:45.580
conversion.

21:45.820 --> 21:53.560
And the source code of this file is in the source folder and in the angles conversion dot cplusplus

21:53.560 --> 21:54.070
file.

21:54.370 --> 21:59.140
Then let's also use the instruction arm and target

22:01.090 --> 22:05.140
dependencies to pass to the angle conversion node.

22:05.140 --> 22:08.710
So to this node all the dependencies it needs.

22:08.710 --> 22:17.950
And so the one from the Rql CPP library, from the Arduino bot messages and from the TF2 library.

22:18.400 --> 22:26.400
Finally, we can use an install instruction, so let's put it here in order to install this node.

22:26.520 --> 22:34.380
And so we want to install the target is the angle conversion node.

22:34.410 --> 22:36.870
So let's copy the name of the executable.

22:36.870 --> 22:40.350
Let's paste it here within the install instruction.

22:40.970 --> 22:42.890
And we need to install it.

22:42.890 --> 22:44.390
So the destination.

22:47.340 --> 22:52.200
Is the lib folder and the sub folder that has the same name of the project.

22:52.200 --> 22:53.790
So Arduino but utils.

22:54.450 --> 23:01.680
And so we can use the variable project name to indicate this path.

23:02.620 --> 23:04.690
Let's save also this file.

23:04.690 --> 23:08.810
And as a final step, we need to declare the dependencies of this node.

23:08.830 --> 23:11.750
Also inside the package dot XML.

23:11.770 --> 23:14.980
So here we need to declare the dependency.

23:14.980 --> 23:21.400
So let's add a new dependency and let's declare this one from the CPP library.

23:21.430 --> 23:25.630
Then we need to add a dependency from the Arduino bot messages library.

23:26.260 --> 23:31.240
And also another dependency from the TF two library.

23:31.660 --> 23:33.430
Let's save also this file.

23:33.430 --> 23:39.160
And with this we have completed the creation of our node and also we have instructed the compiler on

23:39.160 --> 23:41.410
how it should make it an executable.

23:41.680 --> 23:46.540
Now we can finally move on to build our workspace and launch our node.

23:46.780 --> 23:54.400
So let's open a new terminal and let's go into the workspace and let's build it with the command called

23:54.580 --> 23:55.090
build.

23:59.240 --> 24:03.510
And when the build is completed, we can open a new window of the terminal.

24:03.530 --> 24:05.880
Here we can source the workspace.

24:05.900 --> 24:08.950
So the file setup dot bash that is in the workspace.

24:08.960 --> 24:10.580
And let's run our node.

24:10.580 --> 24:12.470
So Ros to run.

24:12.950 --> 24:19.220
And from the Arduino bot utils package, let's start the angle conversion node.

24:19.220 --> 24:20.870
So let's press enter.

24:20.870 --> 24:26.930
And upon the node startup we can see already that it informs us that the angle conversion services are

24:26.930 --> 24:31.580
correctly running and are ready to process new conversion requests.

24:31.910 --> 24:32.840
We can verify.

24:32.840 --> 24:42.620
So by opening a new terminal and here we can execute the command Ros2 service list to get the list of

24:42.620 --> 24:45.650
all the services that are currently available in Ros2.

24:45.950 --> 24:51.740
And apart from the ones that were automatically created at the startup of the Node, we can see that

24:51.740 --> 24:57.830
there are the two services that we created and so earlier to Quaternion and quaternion to Euler.

24:58.500 --> 25:04.170
Now we can request the execution of our conversion so we can request so we can call one of these two

25:04.170 --> 25:04.950
services.

25:04.950 --> 25:11.280
And in order to do so, we first need to source the workspace also in this terminal in order for us

25:11.280 --> 25:16.290
to to recognize the message interface that we are going to use for the communication with these two

25:16.290 --> 25:17.160
services.

25:17.160 --> 25:22.650
And so now we can use the command Ros2 service call.

25:22.860 --> 25:29.250
Let's, for example, call the Euler to quaternion service, Ula to quaternion.

25:29.280 --> 25:36.030
Now if we press tab twice, we can already see that Ros two automatically detects that this service

25:36.060 --> 25:42.990
here is accepting ula to quaternion messages that are defined in the Arduino bot Messages library.

25:43.380 --> 25:51.270
So let's type the interface, then let's use the double quotes, then let's press tab twice and let's

25:51.270 --> 25:58.150
type role and then tab and we can see that the Autocompletion is inserting a default message.

25:58.150 --> 26:03.910
So a prototype of the request message that we need to send to the user to quaternion service.

26:04.090 --> 26:15.460
For example, here, let's ask to the service to convert the angles -0.5, then zero and then 1.5.

26:15.460 --> 26:19.960
So this is in radians and we want to convert this one into a quaternion.

26:19.960 --> 26:25.840
So let's press enter and as soon as we do so, we send this request to the server and we can see that

26:25.840 --> 26:29.200
it responds with the corresponding quaternion.

26:29.200 --> 26:34.630
So this is the quaternion that corresponds to these three Euler angles.

26:34.630 --> 26:38.830
So these are the three Euler angles and this is the corresponding quaternion.

26:38.830 --> 26:40.720
And you can also see that the client.

26:40.720 --> 26:46.840
So here in the terminal, we can see that we received the response correctly from the service server.

26:47.290 --> 26:49.960
Let's try to call the second service.

26:50.110 --> 26:54.430
So, Ros, two service call this time.

26:54.430 --> 26:57.190
Let's try to call the quaternion to alert.

26:57.520 --> 26:59.290
Let's press tab twice.

26:59.290 --> 27:04.990
And so we can see that this service is accepting the quaternion to Euler messages.

27:04.990 --> 27:06.730
So the this interface.

27:07.300 --> 27:09.340
So let's use this interface then.

27:09.340 --> 27:10.960
Let's use double quotes.

27:10.990 --> 27:18.970
Let's press tab twice, let's type X, let's press again tab and the Autocompletion of Ros is inserting

27:18.970 --> 27:24.040
an empty prototype of the request message that belongs to this interface.

27:24.040 --> 27:28.450
And now let's set the quaternion that we want to convert to the unit Quaternion.

27:28.450 --> 27:34.390
So to the quaternion that has all the components set to zero except for the last one that we set to

27:34.390 --> 27:34.870
one.

27:35.170 --> 27:36.880
So let's press enter.

27:36.880 --> 27:43.090
And actually we can see that the quaternion corresponds to here the corresponding angles.

27:43.090 --> 27:50.000
So this is the quaternion that we wanted to convert and these are the corresponding Euler angles that

27:50.000 --> 27:53.720
represent the same orientation as this one as this quaternion.
