Hello, I try to find all entities in a node - topics, publishers, subscribers, datareaders, datawriters. I use buitin topics and get all topics, but i can not get publishers, subscribers. Can you give some help.
Different DDS Entities come in separate builtin topics. Each Topic entity is described by an instance of the "DCPSTopic" topic, while each DomainParticipant entity is described by an instance of the "DCPSParticipant" topic.
Publishers and DataWriters are not communicated separately, but instead come in a joined builtin topic named "DCPSPublication" that contains one instance for each DataWriter, which also embeds the relevant information from the Publisher that contains it.
Subscribers and DataReaders also come in a joined builtintopic named "DCPSSubscription", that contains one instance for each DataReader, which also embeds the relevant information from the Subscriber that contains it.
For example, to get information about which Writers are in your system, you should subscribe to the "DCPSPublication" topic: you can use the builtin Subscriber for that purpose.
Can you explain to me some more details about your problem? Don't you know how to access these builtin topics, or are you not able to read any samples from them? In the last case, can you provide some more info about your test? Which DDS product are you using, how many Publishers and Subscribers are there on your node, etc.
posted on Wednesday, October 07, 2009 - 09:04 am
I use OpenSpliceDDS. I know how to access builtin topics. I use information in "DCPSTopic" about all topics in the node and get pointer to these topics. I use "find_topic" and "lookup_topicdescription" functions from class "DomainParticipant". I would like to do the same with all subscribers, publishers and their datareaders , datawriters in the node, but i don't know how to use information in "DCPSSubscription" and "DCPSPublication" topics to get that access.
Your point is clear now. The DDS specification does provide a facility to get from a DDS Entity to the builtin topic that describes it: the Entity class contains an operation get_instance_handle for that purpose, which represents the instance handle to the builtin topic that describes that particular DDS Entity.
For example, I have a DataWriter for which I want to find the correspondning DCPSPublication instance. I invoke the get_instance_handle operation on that DataWriter, and use the handle it returns as parameter in a read_instance call on the builtin DCPSPublicationDataReader.
To search in the opposite direction is more difficult: there are currently no standardized interfaces to find an entity given a builtin topic sample.
In the DDS Revision Task Force there is a proposal to allow you to give unique names to entities, which will then also show up in the builtin topics. That should help you find the correct entity easily by name. Future versions of OpenSplice will support this feature.
Currently you can also use the UserDataQospolicy for that purpose: just set it to a unique value (for example a name) in your entity and it will show up in the corresponding builtin topic as well.
Hope this answers your question a little bit.
posted on Wednesday, October 07, 2009 - 12:39 pm
Thank you Erik,
I have pointers to topics and their participatns, and I have an information about their Subscription and Publication modules, so I will create similar modules and start receive or send data.