WEBVTT

00:00.080 --> 00:03.650
Let's see how to monitor topics with Actigraph.

00:03.680 --> 00:07.640
For that, we will use the topics that you have just created in this section.

00:07.640 --> 00:11.420
And we're going to create quite a lot of publishers and subscribers, you will see.

00:11.450 --> 00:12.530
First what I'm going to do.

00:12.530 --> 00:14.390
So I have some open terminals.

00:14.390 --> 00:20.960
I'm just going to start an activity graph for example from that one okay I start activity graph with

00:20.960 --> 00:22.490
this comment.

00:23.990 --> 00:25.910
And again I'm going to put this full screen.

00:25.910 --> 00:27.170
You see now it's empty.

00:27.200 --> 00:30.650
We have no node running on the graph.

00:30.650 --> 00:33.920
So I'm going to start a publisher.

00:33.920 --> 00:42.380
So Ross to run my let's start the Cplusplus robot news station.

00:42.380 --> 00:50.450
And let's start Ross to run my Python smartphone.

00:51.380 --> 00:51.890
Okay.

00:51.920 --> 00:54.740
You can see the communication is already working.

00:54.740 --> 00:58.820
We are going to go to Active Graph and let's refresh.

00:58.850 --> 01:04.310
You see I have nodes only and you can see I have my robot news station node my smartphone node.

01:04.310 --> 01:05.660
And then I have a topic.

01:05.660 --> 01:12.760
So this is a topic robot news with the arrow that says that this is a publisher and this is the subscriber.

01:12.760 --> 01:14.950
And actually we can have a better view for that.

01:14.950 --> 01:20.110
If you click on nodes, topics, all you can refresh if needed.

01:20.110 --> 01:22.870
And now you can see that the robot news is a topic.

01:22.870 --> 01:29.980
So the box here is a topic the robot news station is publishing to the topic, and that one the smartphone

01:29.980 --> 01:34.270
is receiving data from the topic, so it's subscribing to the topic.

01:34.300 --> 01:34.570
Okay.

01:34.600 --> 01:39.370
And with this view you can see we can already see what's happening in the graph.

01:39.370 --> 01:44.800
So if for example, you see that communication doesn't work, you can open the graph.

01:44.800 --> 01:49.810
And maybe you see that the publisher is not publishing to the same topic as the subscriber is subscribing

01:49.840 --> 01:52.570
to, and then you can fix that in your code.

01:52.600 --> 01:53.140
Okay.

01:53.170 --> 01:57.670
Now let's go back to the terminal and let's add another publisher.

01:57.670 --> 02:03.100
So let's start to run my my Python or C plus plus.

02:03.100 --> 02:07.360
So they are all the same robot new station.

02:07.360 --> 02:14.310
The thing is I'm not going to start the node like that because it's going to have the same name as that

02:14.310 --> 02:14.760
one.

02:14.760 --> 02:18.210
And you know that we can't have two nodes with the same name.

02:18.210 --> 02:26.340
So I will have to do a Ross args and then dash r node and let's rename it.

02:26.370 --> 02:30.060
Let's just name it station two okay.

02:30.060 --> 02:33.510
So we have robot new station and this one is going to be station two.

02:33.900 --> 02:34.980
You see already.

02:34.980 --> 02:37.740
So we have the C plus plus one and the Python one here.

02:37.740 --> 02:43.440
You see already on this subscriber we receive the data from both publishers.

02:43.440 --> 02:49.950
And we can verify that if we refresh you have the station two that is also publishing on the robot news

02:49.950 --> 02:50.760
topic.

02:50.970 --> 02:51.570
Okay.

02:51.570 --> 02:56.670
So all the subscribers here, only one receive all the data from all the publishers.

02:57.120 --> 03:00.330
We can add yet another.

03:00.750 --> 03:13.890
So that's going to be here another publisher Ross to run my pi PG with robot new station Ross args dash

03:13.920 --> 03:15.540
r node.

03:15.540 --> 03:18.960
Let's call it station three.

03:19.860 --> 03:26.540
Okay, has been started and now we see we have three publishers on that topic.

03:26.570 --> 03:29.630
Now let's add another subscriber for example.

03:29.810 --> 03:33.800
So I'm gonna open a new new terminal.

03:33.830 --> 03:35.960
Let's move that here.

03:36.110 --> 03:41.690
Ross to run my, for example, CBP package with smartphone.

03:41.690 --> 03:45.530
And because we already have a smartphone node I'm going to rename.

03:45.530 --> 03:52.430
Also Ross Arcs are going to rename the node to smartphone two.

03:55.010 --> 03:55.790
Okay.

03:55.820 --> 04:01.130
And you see that node is also receiving all the data from all the publishers.

04:01.160 --> 04:03.320
Okay, I can refresh.

04:03.320 --> 04:09.290
And you see I have my smartphone two here that also receives all the data from all the publishers.

04:09.290 --> 04:12.770
And now let's go back to the terminal I'm going to do here.

04:12.800 --> 04:15.860
I'm going to start Ross to run.

04:15.890 --> 04:20.300
I'm going to start a publisher but this time.

04:20.300 --> 04:28.950
So I'm going to rename, of course, the node and let's say station four.

04:28.950 --> 04:32.370
And this time I'm also going to remap the topic.

04:32.370 --> 04:37.200
So another R the topic is robot news.

04:37.200 --> 04:42.180
Let's say my news okay.

04:42.180 --> 04:45.810
So this one is publishing to a my news topic now.

04:45.810 --> 04:48.690
And it's not going to be received by those subscribers.

04:48.690 --> 04:50.250
We can verify that.

04:51.300 --> 04:52.170
And you see here.

04:52.170 --> 04:55.680
So maybe you have those boxes checked okay.

04:55.710 --> 04:57.570
That syncs and live topics.

04:57.660 --> 04:59.340
You can uncheck those.

04:59.340 --> 05:04.170
And now you see the station four is publishing to my news.

05:04.170 --> 05:06.270
And you see that it's completely different.

05:06.270 --> 05:09.180
So those two topics are not the same.

05:09.510 --> 05:13.500
And so those two subscribers will not receive anything from that topic.

05:13.500 --> 05:15.960
And thus they will not receive anything from the station.

05:15.960 --> 05:22.140
Four now let's say we want to add the smartphone three that will listen to that topic.

05:22.140 --> 05:25.170
My news I can create here.

05:26.040 --> 05:30.030
For example, let's split that again.

05:30.150 --> 05:36.290
Press to run my by PG with smartphone.

05:37.400 --> 05:49.730
Let's do Ross AGS dash R, let's rename to Smart phone three and let's also rename the topic.

05:49.730 --> 05:56.060
So Robot News My news and make sure it's the same as here.

05:56.570 --> 05:57.890
Let's run that.

05:58.460 --> 06:00.170
You can see this is already working.

06:00.170 --> 06:02.840
We received some data here which is from that publisher.

06:02.840 --> 06:05.660
And we can verify here.

06:05.930 --> 06:06.350
Okay.

06:06.380 --> 06:09.500
So you see we have two topics and we have many nodes.

06:09.500 --> 06:14.090
But by using different topic names you can see that those three nodes are only going to publish to that

06:14.090 --> 06:14.570
one.

06:14.570 --> 06:18.320
And it's only going to be received by those two nodes here.

06:18.320 --> 06:22.550
And then whatever you publish on the my news topic is going to be received here by the smart phone.

06:22.580 --> 06:22.850
Three.

06:22.850 --> 06:24.740
So we have two different communications here.

06:24.770 --> 06:25.130
All right.

06:25.130 --> 06:30.590
So with this example I started a lot of nodes, lots of different configurations just to show you that

06:30.590 --> 06:34.310
with nodes and topics you can do a lot of different things.

06:34.310 --> 06:40.700
And with renaming the nodes and topics at runtime, you can already make your application quite dynamic.
