WEBVTT

00:00.110 --> 00:02.210
After all this installation process.

00:02.210 --> 00:05.090
Let's launch a first Ros2 program.

00:05.090 --> 00:05.720
For that.

00:05.720 --> 00:07.370
We won't write any code here.

00:07.370 --> 00:12.320
We will just use existing examples that were downloaded during the installation.

00:12.320 --> 00:14.810
So for now, just type what I write.

00:14.810 --> 00:16.160
You don't need to really understand.

00:16.160 --> 00:19.070
I will explain everything in the next few sections.

00:19.100 --> 00:19.280
Okay?

00:19.310 --> 00:24.800
The goal is just to have something that works quickly so we can validate that Ros2 is working.

00:24.800 --> 00:28.280
So you can open two terminals however you want.

00:28.310 --> 00:34.040
And in the first terminal we are going to do Ros two and then space run.

00:34.040 --> 00:36.620
And then we will need to provide a package name.

00:36.620 --> 00:38.570
So again I'm going to come back to this later.

00:38.570 --> 00:44.240
So demo nodes CP you can press Tab for auto completion okay.

00:44.270 --> 00:45.260
It should work.

00:45.710 --> 00:50.450
And then space we're going to run talker okay.

00:50.480 --> 00:54.890
So it's called talker Ros to run demo node CP with underscores.

00:54.890 --> 00:56.000
And then talker.

00:56.000 --> 00:59.090
We are going to run that and you should see this.

00:59.090 --> 01:02.780
So some logs saying hello world 123 etc..

01:02.780 --> 01:07.700
If you have an error here already it means that probably you haven't sourced correctly your environment

01:07.700 --> 01:10.160
and you need to go back to the previous lesson.

01:10.760 --> 01:12.860
Okay, so we have this one here.

01:12.860 --> 01:16.370
You can see we have a program printing Hello World with a number.

01:16.400 --> 01:26.600
Now on that terminal let's do Ros2 run demo nodes cpp this time with listener.

01:28.250 --> 01:35.570
And you see we have I heard Hello world and that corresponds actually to what was seemed to be published

01:35.570 --> 01:36.830
here on that terminal.

01:36.830 --> 01:39.740
You see hello world 40 and hello world 40.

01:39.770 --> 01:40.460
Okay.

01:40.460 --> 01:44.540
So you see that this terminal is talking to that terminal.

01:45.020 --> 01:45.590
All right.

01:45.620 --> 01:48.230
To stop a program you can press Ctrl C.

01:48.230 --> 01:50.090
So let's press Ctrl C here.

01:50.210 --> 01:55.040
And you can see that program has been finished and this one is still running.

01:55.040 --> 02:01.310
But as you see as this one is not running, as the talker is not running, then the listener is not

02:01.310 --> 02:02.690
receiving anything.

02:02.690 --> 02:05.030
And I can do ctrl C here as well.

02:05.060 --> 02:05.450
All right.

02:05.450 --> 02:11.120
So if you can successfully start and stop those two programs, it means that everything went well.

02:11.120 --> 02:13.820
And you can continue with the next section.

02:13.820 --> 02:18.710
If it doesn't work, something is wrong with the installation or the environment.

02:18.710 --> 02:19.580
In this case.

02:19.580 --> 02:23.660
Come back to the previous lessons and make sure you have followed every step.
