WEBVTT

00:00.080 --> 00:03.440
This is the solution for the first activity of this course.

00:03.440 --> 00:08.570
And in this activity, the challenge is to get the same view here as I have on this image.

00:08.570 --> 00:10.940
When you start our cut graph, okay.

00:10.970 --> 00:14.600
And as you can see we need to start four different nodes.

00:14.600 --> 00:15.830
The first two nodes.

00:15.830 --> 00:20.030
So we have the Python one and the C plus plus ones that we need to rename.

00:20.060 --> 00:23.570
And then we also have the turtle sim with the teleop.

00:23.570 --> 00:26.150
So let's start with that node here.

00:26.150 --> 00:28.520
You see we have to start the Python node.

00:28.550 --> 00:30.170
Actually we could start any node.

00:30.170 --> 00:35.000
In the end we just need to start the node that has this name custom pi.

00:35.030 --> 00:44.090
So let's do ros to run my pi pkg with pi node.

00:44.390 --> 00:51.230
And then well the default name I can just run it and see that the default name is going to be pi test.

00:51.230 --> 00:55.070
So pi test is not going to be what we want okay.

00:55.100 --> 00:57.680
You see in the code it's pi test.

00:57.680 --> 00:59.510
So we need to modify this.

00:59.540 --> 01:01.310
We're not going to modify this in the code.

01:01.310 --> 01:05.090
We are going to use the remapping option from the terminal.

01:05.240 --> 01:10.040
By the way I'm just going to remove that here and save the file okay.

01:11.150 --> 01:18.090
So let's run it again this time with Ross r dash r underscore underscore.

01:18.090 --> 01:18.900
Node.

01:19.500 --> 01:21.420
And what's the name again?

01:21.420 --> 01:25.110
Custom p y.

01:25.530 --> 01:27.510
Let's press enter.

01:28.800 --> 01:29.190
Okay.

01:29.190 --> 01:31.050
Now I can start acute graph.

01:31.050 --> 01:32.730
Let's just start acute graph here.

01:32.730 --> 01:34.680
For example I could open a fifth terminal.

01:34.710 --> 01:35.700
It doesn't matter.

01:35.700 --> 01:37.620
So acute graph.

01:39.660 --> 01:40.320
Okay.

01:40.320 --> 01:42.240
So we already have the first one.

01:42.540 --> 01:46.080
The second one we're going to start the for example the C plus plus one.

01:46.080 --> 01:56.460
So ros2 run my cpp package with cpp node ros args and then dash r node.

01:56.460 --> 01:59.730
And this time the node name is a bit long.

01:59.730 --> 02:03.120
So this is a really long name for cpp node.

02:03.120 --> 02:04.530
But it works.

02:04.560 --> 02:15.870
This is a really long name for a cpp node but it works.

02:15.870 --> 02:19.320
So of course I don't recommend that you use names that long.

02:19.350 --> 02:26.510
But just to show you that, well, it works as long as you separate each word by an underscore is going

02:26.540 --> 02:27.140
to work.

02:27.830 --> 02:29.630
And you see we have the logs.

02:29.630 --> 02:32.450
So let's go back to our cut graph.

02:32.450 --> 02:33.890
And let's refresh.

02:33.890 --> 02:35.930
We have the two nodes here.

02:35.960 --> 02:36.620
Great.

02:36.650 --> 02:39.740
Now let's go to those two other nodes.

02:39.740 --> 02:42.380
You see this is the total SIM and the teleop.

02:42.380 --> 02:46.040
So the Teleop turtle is using the same name.

02:46.040 --> 02:48.050
So we won't need to rename it.

02:48.050 --> 02:50.090
But that node here.

02:50.090 --> 03:02.240
So if I run the turtle SIM Ross to run turtle sim and turtle sim node, you see that the node name is

03:02.240 --> 03:03.080
turtle sim.

03:03.290 --> 03:07.520
We can see that on our graph.

03:07.550 --> 03:08.060
Okay.

03:08.090 --> 03:12.050
And we don't want turtle sim, we want Donatello.

03:12.560 --> 03:13.100
All right.

03:13.100 --> 03:22.040
So I'm going to do Ross ags dash r node Donatello.

03:24.050 --> 03:24.650
Great.

03:24.860 --> 03:27.830
And what turtle sim window is still named turtle sim.

03:27.830 --> 03:33.260
But you see, now the node name is Donatello, which we can verify right here.

03:33.800 --> 03:36.350
And finally, we need to start the.

03:37.010 --> 03:37.950
Uh, teleop.

03:37.950 --> 03:41.790
So, ros to run turtle sim.

03:41.790 --> 03:46.320
So that's the turtle sim package, and then turtle teleop key.

03:46.350 --> 03:52.440
If you don't remember that, just press tab twice here and you can see all the nodes we can start.

03:52.440 --> 03:54.060
So we have the turtle sim node.

03:54.060 --> 03:55.830
We also have two other nodes we haven't seen.

03:55.830 --> 03:56.970
You can try them.

03:56.970 --> 03:58.920
And we have the turtle Teleop.

03:58.920 --> 04:03.810
So turtle Teleop key okay.

04:03.840 --> 04:05.760
It's working.

04:06.000 --> 04:07.590
We can even move.

04:07.590 --> 04:13.680
So I press some keys here and you can see on the turtle sim we have moved.

04:13.680 --> 04:16.710
And if I go back to my actigraph I refresh.

04:17.340 --> 04:19.590
Well that's the view.

04:19.590 --> 04:21.510
So it doesn't match exactly.

04:21.540 --> 04:25.260
I mean it's it's not exactly organized the same way.

04:25.260 --> 04:26.400
So the layout is not the same.

04:26.400 --> 04:29.070
But this is exactly the same thing.

04:29.100 --> 04:29.430
Okay.

04:29.460 --> 04:31.710
We have our two nodes here.

04:31.710 --> 04:33.960
So the CP node and the Python one.

04:33.960 --> 04:40.380
And then we have the Teleop turtle and the Donatello that are communicating with each other okay.

04:40.410 --> 04:46.170
So even if you get a layout that's a bit different it's really not a problem okay.

04:46.200 --> 04:48.450
As long as you get the same nodes, great.

04:48.450 --> 04:50.670
And that's it for this first activity.
