Let's see how to monitor topics with Actigraph.
For that, we will use the topics that you have just created in this section.
And we're going to create quite a lot of publishers and subscribers, you will see.
First what I'm going to do.
So I have some open terminals.
I'm just going to start an activity graph for example from that one okay I start activity graph with
this comment.
And again I'm going to put this full screen.
You see now it's empty.
We have no node running on the graph.
So I'm going to start a publisher.
So Ross to run my let's start the Cplusplus robot news station.
And let's start Ross to run my Python smartphone.
Okay.
You can see the communication is already working.
We are going to go to Active Graph and let's refresh.
You see I have nodes only and you can see I have my robot news station node my smartphone node.
And then I have a topic.
So this is a topic robot news with the arrow that says that this is a publisher and this is the subscriber.
And actually we can have a better view for that.
If you click on nodes, topics, all you can refresh if needed.
And now you can see that the robot news is a topic.
So the box here is a topic the robot news station is publishing to the topic, and that one the smartphone
is receiving data from the topic, so it's subscribing to the topic.
Okay.
And with this view you can see we can already see what's happening in the graph.
So if for example, you see that communication doesn't work, you can open the graph.
And maybe you see that the publisher is not publishing to the same topic as the subscriber is subscribing
to, and then you can fix that in your code.
Okay.
Now let's go back to the terminal and let's add another publisher.
So let's start to run my my Python or C plus plus.
So they are all the same robot new station.
The thing is I'm not going to start the node like that because it's going to have the same name as that
one.
And you know that we can't have two nodes with the same name.
So I will have to do a Ross args and then dash r node and let's rename it.
Let's just name it station two okay.
So we have robot new station and this one is going to be station two.
You see already.
So we have the C plus plus one and the Python one here.
You see already on this subscriber we receive the data from both publishers.
And we can verify that if we refresh you have the station two that is also publishing on the robot news
topic.
Okay.
So all the subscribers here, only one receive all the data from all the publishers.
We can add yet another.
So that's going to be here another publisher Ross to run my pi PG with robot new station Ross args dash
r node.
Let's call it station three.
Okay, has been started and now we see we have three publishers on that topic.
Now let's add another subscriber for example.
So I'm gonna open a new new terminal.
Let's move that here.
Ross to run my, for example, CBP package with smartphone.
And because we already have a smartphone node I'm going to rename.
Also Ross Arcs are going to rename the node to smartphone two.
Okay.
And you see that node is also receiving all the data from all the publishers.
Okay, I can refresh.
And you see I have my smartphone two here that also receives all the data from all the publishers.
And now let's go back to the terminal I'm going to do here.
I'm going to start Ross to run.
I'm going to start a publisher but this time.
So I'm going to rename, of course, the node and let's say station four.
And this time I'm also going to remap the topic.
So another R the topic is robot news.
Let's say my news okay.
So this one is publishing to a my news topic now.
And it's not going to be received by those subscribers.
We can verify that.
And you see here.
So maybe you have those boxes checked okay.
That syncs and live topics.
You can uncheck those.
And now you see the station four is publishing to my news.
And you see that it's completely different.
So those two topics are not the same.
And so those two subscribers will not receive anything from that topic.
And thus they will not receive anything from the station.
Four now let's say we want to add the smartphone three that will listen to that topic.
My news I can create here.
For example, let's split that again.
Press to run my by PG with smartphone.
Let's do Ross AGS dash R, let's rename to Smart phone three and let's also rename the topic.
So Robot News My news and make sure it's the same as here.
Let's run that.
You can see this is already working.
We received some data here which is from that publisher.
And we can verify here.
Okay.
So you see we have two topics and we have many nodes.
But by using different topic names you can see that those three nodes are only going to publish to that
one.
And it's only going to be received by those two nodes here.
And then whatever you publish on the my news topic is going to be received here by the smart phone.
Three.
So we have two different communications here.
All right.
So with this example I started a lot of nodes, lots of different configurations just to show you that
with nodes and topics you can do a lot of different things.
And with renaming the nodes and topics at runtime, you can already make your application quite dynamic.