WEBVTT

00:00.050 --> 00:06.620
In this laboratory lesson, we are going to create a simple script, a simple Python node that uses

00:06.620 --> 00:14.180
the V2 APIs in order to send a goal to the robot and move it to a desired position.

00:14.180 --> 00:21.530
Before following this lesson, please mind that the Python API for Moovit was introduced in Ros two

00:21.530 --> 00:22.100
iron.

00:22.100 --> 00:29.600
So if you are using an older Ros two version like for example Ros2 humble, it will not be available

00:29.600 --> 00:36.380
and you can only interact with Moovit using the Cplusplus API that will be developed in the following

00:36.380 --> 00:37.760
laboratory lesson.

00:37.910 --> 00:45.890
So back in Visual Studio Code, let's start by creating our simple script in the Arduino Bot Pi examples

00:45.890 --> 00:46.430
folder.

00:46.430 --> 00:47.690
So this one here.

00:47.690 --> 00:56.570
And so here within the Arduino Pi example sub folder, let's create a new file called simple Moovit

00:58.150 --> 01:00.160
Interface dot pi.

01:00.190 --> 01:00.820
Perfect.

01:00.820 --> 01:06.490
So here, as always, let's start by importing the CLP library.

01:06.520 --> 01:07.120
Perfect.

01:07.120 --> 01:12.220
That is the interface that we can use in order to interact with the Ros2 functionalities.

01:12.220 --> 01:18.970
And here, since we are implementing a very simple Ros2 node, there is no need actually to create a

01:18.970 --> 01:26.530
new class that inherits from the node class, and instead we can directly instruct all the functions

01:26.530 --> 01:29.290
and so all the code in the main function.

01:29.290 --> 01:31.480
So let's define it.

01:36.970 --> 01:41.350
So here let's execute the main function.

01:41.380 --> 01:42.010
Perfect.

01:42.010 --> 01:43.480
And now let's define it.

01:43.480 --> 01:47.050
So let's define the function main in which.

01:47.050 --> 01:50.410
Now we are going to insert all the code of our robot.

01:50.410 --> 01:53.020
So of our API form of it.

01:53.050 --> 02:01.980
Now here the first thing that we want to do is to initialize the Ros to interface with clp init.

02:02.010 --> 02:02.730
Perfect.

02:02.730 --> 02:06.600
And then also we want to insert all the code that will move the robot.

02:06.600 --> 02:13.050
And so all the logic that interacts with the Moveit API for Python in a new function that we are going

02:13.050 --> 02:15.990
to call move robot.

02:16.020 --> 02:16.560
Perfect.

02:16.560 --> 02:21.990
So this function here will actually be in charge of moving the robot from the current position to a

02:21.990 --> 02:24.870
desired position that we will insert here.

02:24.870 --> 02:30.600
And then after moving the robot, we want to simply shut down this node.

02:30.600 --> 02:34.890
So let's use the CLP shutdown function.

02:34.920 --> 02:35.670
Perfect.

02:35.670 --> 02:38.940
So now we are missing to declare this function here.

02:38.940 --> 02:45.630
So the move robot function in which we will actually insert all the logic for this script here.

02:45.630 --> 02:50.880
So let's here let's define the move robot function.

02:50.880 --> 02:51.600
Perfect.

02:51.600 --> 02:59.500
And now in this move robot function we want to start interacting with the Moovit APIs for Python, and

02:59.500 --> 03:07.450
to do so we can import from the Moovit package and from the planning library.

03:07.510 --> 03:10.930
Let's import the class that is called Moovit Pi.

03:10.960 --> 03:11.800
Perfect.

03:11.800 --> 03:16.660
And so now we can start using this class to interact with the Moovit API.

03:16.930 --> 03:21.970
And so here within the move robot function we can create a new instance of this class.

03:22.090 --> 03:25.480
And let's call it Arduino bot.

03:25.720 --> 03:28.390
So this is an instance of the movie Pi.

03:28.390 --> 03:29.560
And we want.

03:29.590 --> 03:33.910
So this one here under the hood is creating a new Ros2 node.

03:34.270 --> 03:35.440
And let's call it.

03:35.470 --> 03:42.340
So let's give it a name and let's call this node move it Pi.

03:42.370 --> 03:43.270
Perfect.

03:43.630 --> 03:49.600
And so here we have created a new instance of the movie Pi that we have called Arduino bot.

03:49.600 --> 03:51.490
And now using this instance.

03:51.490 --> 03:59.010
So using this object Here, we can access to the two move groups that we have defined in our moved configuration.

03:59.010 --> 04:05.520
So if you remember from the previous lessons when we configured move It, we have defined two move groups,

04:05.520 --> 04:10.170
one for the R so one that moves the R and one for the gripper.

04:10.170 --> 04:13.170
So let's start interacting with the one of the r.

04:13.200 --> 04:17.640
So let's call it Arduino bot arm.

04:18.540 --> 04:19.470
Perfect.

04:19.470 --> 04:26.040
And so from the Arduino bot object let's get a planning component.

04:26.040 --> 04:31.920
So let's use this function here in order to access to the move group that we have called R.

04:32.070 --> 04:33.030
Perfect.

04:33.030 --> 04:35.970
And let's do the same also for the gripper.

04:35.970 --> 04:39.390
So we can copy this line here and we can paste it.

04:39.390 --> 04:43.680
And let's change this variable into Arduino bot gripper.

04:43.680 --> 04:47.250
So with this one here we are accessing to the planning component.

04:47.250 --> 04:52.180
So to the move group that we have called gripper Perfect.

04:52.240 --> 04:57.100
And so with these two variables now we have accessed these two move groups.

04:57.100 --> 05:03.580
Now with the Arduino robot arm and with the Arduino bot gripper variables, we can now access these

05:03.580 --> 05:04.210
two groups.

05:04.210 --> 05:06.280
So the arm and the gripper separately.

05:06.280 --> 05:11.260
And so actually we can send a goal to each of them and then plan trajectories.

05:11.260 --> 05:15.160
And also to execute the goal that we have planned independently.

05:15.160 --> 05:17.710
So we can plan and execute a goal for the arm.

05:17.710 --> 05:22.480
And then we can plan and execute another goal for the gripper to do so.

05:22.480 --> 05:27.250
So to set a goal for the arm, for the gripper we need to import another class.

05:27.490 --> 05:33.970
And this is from the movie package and from the core.

05:34.000 --> 05:40.990
Let's import from the robot state the class that is called robot State.

05:40.990 --> 05:45.700
So as the name of this class suggests, this will contain the state of the robot.

05:45.700 --> 05:51.660
And so actually this can contain both the current state of the robot or also it can contain the desired

05:51.660 --> 05:52.950
state of the robot.

05:52.980 --> 05:59.490
Now let's create two new instances of this variable that is called our state.

05:59.520 --> 06:03.660
And so this is an instance of the robot state.

06:03.660 --> 06:08.340
And let's also create another one that is gripper state.

06:08.340 --> 06:11.790
Again an instance of the robot state class.

06:11.790 --> 06:13.020
And for the moment.

06:13.020 --> 06:15.810
So within this variable we just want to contain.

06:15.810 --> 06:19.140
So we just want to get the current state of the art.

06:19.170 --> 06:27.210
So let's access to the Arduino bot and let's use the Get robot model function.

06:27.210 --> 06:27.960
Perfect.

06:27.990 --> 06:31.470
And also let's do the same here for the gripper.

06:31.680 --> 06:37.170
So let's use the Arduino bot and then the get robot model function.

06:39.510 --> 06:40.440
Perfect.

06:40.440 --> 06:45.930
And now that we have the current state of the joints of the robot that we have created with the two

06:45.960 --> 06:48.250
instances of this class glass here.

06:48.280 --> 06:49.420
Now we can use them.

06:49.420 --> 06:54.550
So we can use these two states to set a goal for the joints of the robot.

06:54.790 --> 07:04.840
And in order to set the goal so we can access the arm state and we can use the set joint group positions

07:04.840 --> 07:05.770
function.

07:05.770 --> 07:14.050
So this function here and also for the gripper let's use the set joint group position perfect.

07:14.050 --> 07:19.750
And for example so for the arm we want to set the position of the joints.

07:19.750 --> 07:24.430
So the desired position for the move group that is called arm.

07:24.430 --> 07:27.730
And we want to set it as a numpy array.

07:27.730 --> 07:30.970
So first let's import the numpy library.

07:31.090 --> 07:36.130
So let's import numpy as np.

07:36.490 --> 07:44.590
And now here so where we are here in the set joint group position let's set the desired position.

07:44.590 --> 07:49.050
So the goal position for the arm is a numpy array.

07:49.620 --> 07:52.050
So here let's set the array.

07:52.050 --> 07:57.810
And here we need to specify the desired position of all the joints that belong to the arm.

07:57.840 --> 08:01.170
So if you remember the arm only has three joints.

08:01.170 --> 08:04.440
So the joint of the base the shoulder and the elbow.

08:04.440 --> 08:08.850
And for example let's just turn the base for 90 degrees.

08:08.850 --> 08:11.550
So 1.57 radians.

08:11.550 --> 08:15.960
And then we can instead set the other joints to zero.

08:15.960 --> 08:22.680
So basically we are setting that the desired position of the arm will just rotate the base joint of

08:22.680 --> 08:23.880
90 degrees.

08:23.910 --> 08:27.000
And then let's also set the desired position for the gripper.

08:28.230 --> 08:28.860
Perfect.

08:28.860 --> 08:32.730
And also in this case this is a numpy array.

08:33.930 --> 08:38.310
And as you remember there are only two joints that belongs to the gripper.

08:38.310 --> 08:44.180
And also these two joints are not independent from each other but they are actuated Treated together.

08:44.180 --> 08:47.510
And so let's for example open the gripper.

08:47.540 --> 08:54.560
And so let's set that the joint number four will rotate of -0.7 radians.

08:54.560 --> 08:59.360
And so the other one the joint number five will rotate the same angle.

08:59.360 --> 09:02.360
So 0.7 but in the opposite direction.

09:02.450 --> 09:03.230
Perfect.

09:03.230 --> 09:06.560
So with this one we have set the goal state of the robot.

09:06.560 --> 09:12.800
So the joints the desired position of the joints of the robot in the goal state.

09:12.800 --> 09:15.860
Now before actually sending these goals to the planner.

09:15.860 --> 09:22.370
So and to calculate the trajectory to these goals here, let's first reset the current state.

09:22.370 --> 09:27.500
So we want first to set the current state of the robot before setting the desired state.

09:27.860 --> 09:31.070
So again let's access to the Arduino robot arm.

09:31.160 --> 09:42.390
And here let's use the function set start state to current State.

09:42.390 --> 09:43.110
Perfect.

09:43.110 --> 09:46.440
So the name of this function is quite self-explanatory.

09:46.470 --> 09:51.900
And so basically we are setting the start state for this object here.

09:51.900 --> 09:54.930
So for the Arduino both are to the current state.

09:54.930 --> 09:56.580
So to the current position.

09:56.580 --> 09:59.820
And so here we have set the start state.

09:59.850 --> 10:01.980
Here we have the goal state.

10:01.980 --> 10:04.410
So the desired goal state of the robot.

10:04.440 --> 10:06.510
Now let's also do the same for the gripper.

10:06.540 --> 10:08.520
So we can copy this instruction here.

10:08.520 --> 10:14.220
And we can set the start state also for the gripper.

10:14.220 --> 10:17.070
So also for the move group of the gripper.

10:17.070 --> 10:20.070
And now we are just missing to set the goal state.

10:20.070 --> 10:29.820
So to take the Arduino robot arm and we can use the set goal state function.

10:29.820 --> 10:32.310
And we want to set the robot state.

10:32.310 --> 10:34.860
And so actually here we can use this object here.

10:34.860 --> 10:39.840
So the arm state object that we have created and in which we have set.

10:39.840 --> 10:41.420
So this one here.

10:41.420 --> 10:43.190
So this position of the joints.

10:43.220 --> 10:46.640
Let's do the same also for the Arduino both gripper.

10:46.640 --> 10:52.520
So here for the gripper let's set the goal state.

10:52.520 --> 10:57.470
And also in this case we want to set the robot state that is this one here.

10:57.470 --> 11:01.700
So the gripper state in which we have set the position.

11:01.700 --> 11:05.720
So a numpy array for the desired configuration of the gripper.

11:05.750 --> 11:06.710
Perfect.

11:06.710 --> 11:11.420
So now we have that for the Arduino robot arm and for the Arduino bot gripper.

11:11.420 --> 11:15.770
So for these two planning components we have set a start state.

11:15.770 --> 11:17.870
We have also set a goal state.

11:17.870 --> 11:18.620
Perfect.

11:18.770 --> 11:25.280
So now we can just plan a trajectory from the start state to the goal state.

11:25.280 --> 11:26.600
And this is pretty easy.

11:26.630 --> 11:33.380
We just need to take the Arduino robot arm and just want to execute the function plan.

11:33.380 --> 11:37.370
And also let's do the same for the Arduino bot gripper.

11:38.440 --> 11:40.570
And let's use the function plan.

11:40.570 --> 11:47.710
So this function here will just calculate a plan that brings the Arduino bot arm from the current position.

11:47.710 --> 11:50.290
So this one here to the goal position.

11:50.290 --> 11:53.050
So to this position here of the joints.

11:53.050 --> 11:56.890
Now let's also save this plan that was generated into a new variable.

11:56.920 --> 12:00.250
And let's call it for example our plan.

12:03.850 --> 12:04.870
Result.

12:04.870 --> 12:09.340
And also here let's call it gripper plan.

12:10.450 --> 12:11.410
Result.

12:11.440 --> 12:11.980
Perfect.

12:11.980 --> 12:15.430
And now let's check whether the plan was successful.

12:15.430 --> 12:21.250
So whether the planner was able to calculate a plan from the current position to the desired position.

12:21.250 --> 12:30.520
And so if the arm plan result and the gripper plan result.

12:30.520 --> 12:36.740
So if the planner was able to calculate a trajectory both for the arm and for the gripper.

12:36.770 --> 12:41.930
Now we finally can execute it so we can execute the trajectory that was calculated.

12:41.990 --> 12:43.580
And this is very simple.

12:43.580 --> 12:45.560
So we can take this object here.

12:45.560 --> 12:53.120
So the Arduino bot that is our robot and we can simply execute this one here.

12:53.120 --> 13:00.800
So from the arm plan result we can take the trajectory.

13:00.800 --> 13:02.540
So we want to execute this trajectory.

13:02.540 --> 13:08.630
And let's also set the controllers to an empty list.

13:08.630 --> 13:13.850
Just in order to use the default controllers that are loaded for the arm.

13:13.880 --> 13:17.120
And let's execute also the trajectory for the gripper.

13:17.120 --> 13:19.430
So still on the Arduino bot object.

13:19.430 --> 13:27.650
So our robot let's execute this time the gripper plan result and also the trajectory.

13:27.650 --> 13:34.400
And also in this case let's set the controllers as an empty array in order to use the default controllers.

13:34.600 --> 13:35.740
otherwise.

13:36.430 --> 13:39.430
So if one of the two planners failed.

13:39.430 --> 13:45.250
So it means that we weren't able to calculate a path from the current state to the goal state.

13:45.250 --> 13:49.570
And this, for example, can be due to the fact that the goal state is invalid.

13:49.570 --> 13:56.080
So imagine if here we put an angle that is bigger than 90 degrees, so bigger than the mechanical limits

13:56.080 --> 13:56.890
of the joints.

13:56.890 --> 13:59.680
So of course this position is not reachable.

13:59.680 --> 14:02.560
And so the planner will fail in this case.

14:02.560 --> 14:05.890
Here we want to print an error message in the terminal.

14:06.040 --> 14:15.550
So we can actually import from the RCL by logging the get logger function.

14:15.550 --> 14:16.030
Perfect.

14:16.030 --> 14:19.900
And so we can use this function here in the else statement.

14:19.900 --> 14:24.820
So let's get the logger and let's get the RCL pi logger.

14:24.820 --> 14:36.920
In order to print an error message that says here one or more planners failed perfect just to inform

14:36.920 --> 14:40.550
the user that the goal state was not valid.

14:41.330 --> 14:43.040
So we can save this script.

14:43.040 --> 14:49.400
And with this our move robot function is completed and so we are ready to start it.

14:49.400 --> 14:50.900
So we are ready to execute it.

14:50.900 --> 14:54.980
But in order to do so we are going to need a new launch file.

14:54.980 --> 15:00.020
So we are going to create a new launch file that actually starts this node here.

15:00.020 --> 15:04.700
So let's do it again here within the Arduino bot Pi examples package.

15:04.700 --> 15:11.270
And as by Ros2 conventions, we need to create a new folder called launch.

15:11.270 --> 15:23.330
And within this folder we can create our launch file that we can call simple move it interface dot launch

15:23.750 --> 15:24.500
dot pi.

15:24.530 --> 15:25.250
Perfect.

15:25.250 --> 15:28.370
And here before starting this node here.

15:28.370 --> 15:33.190
So this Python node here the move it pi so the move it.

15:33.220 --> 15:37.090
API for Python needs a move it configuration.

15:37.090 --> 15:41.470
So basically they need a move it config builder.

15:41.470 --> 15:47.710
And if you remember we have already used the moved config builder class here in the Arduino bot.

15:47.740 --> 15:48.880
Move it launch file.

15:48.880 --> 15:55.330
So in this launch file here, if we open it on one side we can see that here we have already used this

15:55.330 --> 15:56.260
file here.

15:56.260 --> 15:57.850
So the move it config builder.

15:57.880 --> 16:00.310
Now also to start this one here.

16:00.310 --> 16:02.590
So also to start this note that we have just developed.

16:02.590 --> 16:05.680
We are going to need these same class here.

16:05.680 --> 16:07.570
So actually we can copy it.

16:07.570 --> 16:13.090
So we can copy all this function and we can paste it here.

16:13.720 --> 16:15.550
Also we can import.

16:16.150 --> 16:20.830
So here we can copy the include statement and we can paste it.

16:20.860 --> 16:21.700
Perfect.

16:21.790 --> 16:27.220
And now actually for our simple launch file we are not going to need these two arguments.

16:27.220 --> 16:30.510
We are just going to need the moved it configuration perfect.

16:30.690 --> 16:32.310
So we can close this one.

16:32.310 --> 16:38.760
And here in this case the move it configuration basically is loading from the Arduino bot.

16:38.760 --> 16:39.180
Move it.

16:39.180 --> 16:45.780
And from the Arduino bot description all the Urdf model of the robot and also is loading all the configuration

16:45.780 --> 16:48.750
files that we have created for move it.

16:48.780 --> 16:49.620
Perfect.

16:49.620 --> 16:55.650
So to this configuration file, in order to use the Moovit API, we need to add another configuration

16:55.650 --> 16:57.360
so we can add it here.

16:57.360 --> 17:02.880
After the trajectory execution configuration and the configuration that we are going to need is the

17:02.880 --> 17:04.620
Moovit CP.

17:04.830 --> 17:08.850
In fact under the hood basically the Moovit pi.

17:08.880 --> 17:13.980
So this API here basically are just using the C plus plus API.

17:14.100 --> 17:16.770
So we need to configure this parameter here.

17:16.770 --> 17:22.560
So the Moovit cp with a new YAML file that you are going to create soon.

17:22.560 --> 17:27.820
And this YAML file that we are going to create will be at the file path.

17:27.850 --> 17:30.880
So still within the config folder.

17:30.880 --> 17:32.680
And we are going to create it soon.

17:32.680 --> 17:41.830
And we are going to call it planning Python API dot YAML.

17:41.830 --> 17:49.210
And so as you can understand from the name, this YAML file will be just used for the Python API.

17:49.240 --> 17:51.970
So to configure the Python API for move it.

17:52.300 --> 17:55.870
So with this we have just created a configuration file.

17:55.870 --> 18:00.190
So this one here an object of this type for our simple node.

18:00.190 --> 18:02.920
So for the simple move with interface node.

18:02.920 --> 18:05.740
So now we can actually start this node here.

18:05.860 --> 18:12.070
So the simple move it interface node.

18:12.190 --> 18:14.830
And so this is an instance of the node class.

18:14.830 --> 18:24.730
And we want to start from the package that is called Arduino board by examples.

18:24.730 --> 18:32.040
So from this package we want to start the executable that we have just created and it is called simple

18:32.310 --> 18:33.360
move it.

18:35.940 --> 18:37.020
Interface.

18:37.020 --> 18:45.510
So this script here that we have just created and we want to configure it with some parameters.

18:45.600 --> 18:46.170
Perfect.

18:46.170 --> 18:49.200
And the parameters that we want to configure here.

18:49.200 --> 18:50.310
So this is a list.

18:50.310 --> 18:53.610
And simply in this list we want to use this one here.

18:53.610 --> 18:56.850
So we want to use the move it config.

18:56.850 --> 19:01.860
And we want to this one to be converted into a dictionary.

19:01.860 --> 19:04.860
And apart from that we can also set the parameter.

19:05.190 --> 19:07.320
So here let's use the parentheses.

19:07.320 --> 19:08.670
And let's set the parameter.

19:08.670 --> 19:13.050
Use same time to true as.

19:13.050 --> 19:15.330
Basically we are going to use this node here.

19:15.330 --> 19:19.530
So the simple move interface just with the simulated robot.

19:19.560 --> 19:24.440
And so we can just hard code here the user same time to true.

19:24.530 --> 19:25.310
Perfect.

19:25.310 --> 19:32.540
So we are just missing now to return a launch description.

19:32.540 --> 19:34.910
And the constructor of this class takes a list.

19:34.910 --> 19:40.160
And within this list we need to insert all the nodes, all the actions that we want to execute with

19:40.160 --> 19:41.240
this launch file.

19:41.240 --> 19:45.740
And in this case this is just the simple move it interface.

19:45.740 --> 19:47.780
So only this one here.

19:47.960 --> 19:53.150
Also we can remove here all the classes that we are not using.

19:53.570 --> 19:58.430
Perfect in order to have a clearer file and also a smaller one.

19:58.430 --> 19:59.300
Perfect.

19:59.300 --> 20:04.670
And so with this one we have finally started our node and we have also configured it.

20:04.670 --> 20:09.620
And now we are just missing one last step that is this one here.

20:09.620 --> 20:13.340
So we want to create this configuration file here.

20:13.340 --> 20:15.830
So the planning Python API dot YAML.

20:15.830 --> 20:21.690
That is a configuration file that is only used in order to configure the Python API.

20:21.750 --> 20:27.030
So let's create it here within the Arduino bot move it package in the config folder.

20:27.030 --> 20:33.870
So as we have said here and let's call this one as we have set this one here so we can copy the name.

20:34.050 --> 20:39.390
And here let's create a new file and let's paste the name that we have inserted here.

20:39.390 --> 20:41.130
So let's press enter.

20:41.340 --> 20:50.010
And now in this file we just need to configure the planning pipelines that we want to use.

20:50.010 --> 20:56.280
And actually the pipeline names.

20:56.280 --> 21:01.080
So this is a vector containing all the planners that we want to use.

21:01.080 --> 21:05.520
So for the moment we are fine just with Ompl.

21:05.550 --> 21:09.390
So this is the only planner that we are going to use for this course.

21:09.420 --> 21:22.400
Then let's also configure here the plan request params and let's set the parameter planar id.

21:22.400 --> 21:26.540
And again we are only going to use om pl as a planar.

21:26.570 --> 21:32.810
Then let's also set the parameter planning attempts.

21:32.810 --> 21:35.330
And let's set this 1 to 1.

21:35.330 --> 21:38.870
And then the planning.

21:41.000 --> 21:42.050
Pipeline.

21:42.410 --> 21:44.390
And this is again om PL.

21:44.420 --> 21:46.520
So just the Ompl planner.

21:46.550 --> 21:57.980
And then also we can set the max velocity scaling factor so we can set this 1 to 1.

21:57.980 --> 22:01.220
So basically we are not scaling the maximum velocity.

22:01.220 --> 22:04.100
And also we can set the max.

22:06.530 --> 22:10.580
Acceleration scaling factor again to 1.0.

22:10.580 --> 22:17.090
And these actually are the only parameters that we need in order to configure the Python interface.

22:17.090 --> 22:19.320
So in order to configure the Python API.

22:19.350 --> 22:21.180
So let's save also this file.

22:21.180 --> 22:24.330
And now we are just missing to install everything.

22:24.330 --> 22:26.490
So to install this script here.

22:26.490 --> 22:30.900
So the simple movie interface within the Arduino Pi examples package.

22:30.900 --> 22:34.560
And also to install the launch file that we have just created.

22:34.650 --> 22:40.110
So we need to open the file setup.py that is in the Arduino dot pi examples.

22:40.110 --> 22:45.090
And in order to install our node we can just copy this line here.

22:45.090 --> 22:51.780
So the one that we have used for the Simple Action client and we can paste it here in order to install

22:51.780 --> 22:57.570
the simple move it interface node.

22:57.720 --> 23:02.100
And this node here is in the Arduino dot Pi examples folder.

23:02.100 --> 23:04.710
And it's called Simple Movie Interface.

23:04.710 --> 23:09.360
And still from this script here we want to execute the main function.

23:09.600 --> 23:12.150
Then we also need to install the launch folder.

23:12.150 --> 23:13.560
So this one here.

23:13.560 --> 23:18.050
And in order to install the launch folder we need to modify this section here.

23:18.050 --> 23:20.150
So the data files section.

23:20.300 --> 23:25.670
So let's import some useful libraries that are the OS Python library.

23:25.670 --> 23:32.840
And also from the glob library lets import the glob function.

23:32.870 --> 23:33.560
Perfect.

23:33.560 --> 23:37.040
And so now here so after the installation.

23:37.040 --> 23:42.470
So as you can see here this instruction here will install the file package dot XML.

23:42.470 --> 23:44.930
Now we also want to install the launch folder.

23:44.930 --> 23:47.240
So here let's add a new instruction.

23:47.240 --> 23:52.610
And from the US path join perfect.

23:52.640 --> 24:02.240
And here from the share folder and from the package name variable, we want to install the launch folder

24:02.240 --> 24:03.410
that we have just created.

24:03.410 --> 24:04.100
Perfect.

24:04.130 --> 24:10.790
Now here after the parenthesis we can use the glob function.

24:11.300 --> 24:22.000
And again within this function we can use the OS path join in order to access the launch folder and

24:22.000 --> 24:23.020
from the launch folder.

24:23.020 --> 24:30.970
So from this folder we want to install everything that has the name launch and the extension.

24:30.970 --> 24:43.420
So here let's use the parentheses p x y and also the extension y m a and also all other extensions.

24:43.990 --> 24:44.680
Perfect.

24:44.680 --> 24:51.100
So we can save also this file in which we have installed our simple movie interface and in which we

24:51.100 --> 24:53.500
have also installed the launch directory.

24:53.500 --> 25:00.820
So the launch file here and now don't forget as a last step to modify also the package dot XML as we

25:00.850 --> 25:02.950
have introduced new dependencies.

25:03.100 --> 25:09.910
In fact, we have introduced an execution dependency from the Ros2 launch package as we have created

25:09.910 --> 25:18.140
a new launch file, and also we have a new execution dependency from the move it by package.

25:18.170 --> 25:24.290
Anyway, this dependency here is only needed if you are using a newer version of Ros2.

25:24.320 --> 25:33.050
So only if the condition is that your Ros distro.

25:33.050 --> 25:37.700
So the Ros distribution that you are using is bigger than or equal to iron.

25:37.700 --> 25:42.530
So for example, if you are using Ros two chassis you will have this package here.

25:42.530 --> 25:48.680
So this library here that is that is not available in older version of Ros two like for example anvil

25:48.710 --> 25:49.640
perfect.

25:49.640 --> 25:51.290
So let's save also this file.

25:51.290 --> 25:57.800
And in the following lesson after developing the same interface with the movie C plus plus API, we

25:57.830 --> 25:59.210
are going to start this node.

25:59.210 --> 26:05.150
And we are going to see how we can use it to plan a trajectory to the desired position of the robot

26:05.150 --> 26:08.690
that we have set here in this file here.

26:08.690 --> 26:10.100
So in these lines here.
