4.1.4. Topic¶
Topic is a command that retrieves information of the Topics with at least one endpoint currently active in the network.
4.1.4.1. Key-words¶
These are the key-words recognize as this command:
topic
topics
t
T
.
4.1.4.2. Arguments¶
Topic command supports from 0 to 2 arguments:
4.1.4.2.1. No argument¶
When no arguments are given to this command, the information shown is a list with every topic with at least one endpoint currently active in the network. The information shown is the topic name, data type name, number of writers and readers and the subscription rate measured in samples per second. The output format is as follows: Topics info.
4.1.4.2.2. Verbose¶
This argument (v
or vv
) queries for more complete information about each of the topics in the network.
The output is a list of data with verbose information.
Check the verbose section in order to know which key-words are available for this argument.
4.1.4.2.3. Topic name¶
This argument requires a string with the topic name. This command queries the database for a single Topic and retrieves its verbose information. This Guid must exist inside the DDS network.
Note
If there are 2 topics with the same name and different Topic Data Type, only one of them could be visible. These is a circumstance that DDS allows, but it is strongly suggested not to do.
4.1.4.2.4. Topic name with wildcards¶
When a topic name contains wildcards (*), this command retrieves verbose information for all topics that match the given filter. This allows users to query multiple topics in a single command, making it easier to gather related data quickly.
4.1.4.3. Output Format¶
The topic information is retrieved in multiple formats depending on the verbosity option.
4.1.4.3.1. Topics info¶
topic: <topic name> (<topic type name>) (<n writers>|<n readers>) [<rate> Hz]
4.1.4.3.2. Topics info in verbose mode¶
name: <topic name>
type: <data type name>
datawriters: <number of datawriters currently active>
datareaders: <number of datareaders currently active>
rate: <samples per second> Hz
4.1.4.3.3. Topics info in high verbosity mode¶
This argument queries for more complete information about each of the topics in the network. It adds the Guid of each endpoint on the topic and the whether the type has been discovered.
name: <topic name>
type: <data type name>
datawriters:
- <Guid>
- ...
datareaders:
- <Guid>
- ...
rate: <samples per second> Hz
dynamic_type_discovered: <bool>
4.1.4.4. Example¶
Let’s assume we have a DDS network where 2 ShapesDemo applications are running.
This would be the expected output for the command topics
:
- name: Circle
type: ShapeType
datawriters: 2
datareaders: 2
rate: 13.0298 Hz
- name: Square
type: ShapeType
datawriters: 3
datareaders: 2
rate: 26.6975 Hz
This would be the expected output for the command topics verbose
:
- name: Circle
type: ShapeType
datawriters:
- 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.3.2
datareaders:
- 01.0f.44.59.c9.65.78.e5.00.00.00.00|0.0.2.7
rate: 13.0286 Hz
dynamic_type_discovered: true
- name: Square
type: ShapeType
datawriters:
- 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.1.2
- 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.2.2
datareaders:
- 01.0f.44.59.21.58.14.d2.00.00.00.00|0.0.2.7
- 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.4.7
rate: 26.685 Hz
dynamic_type_discovered: true
This would be the expected output for the command topics Square
:
name: Circle
type: ShapeType
datawriters:
- 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.6.2
datareaders:
- 01.0f.44.59.c9.65.78.e5.00.00.00.00|0.0.2.7
rate: 13.0418 Hz
dynamic_type_discovered: true