0

I don't know how many people use FastDDS but I would appreciate some help

When talking about Domain Participants (and specifically Domain Participant Listeners) what is exactly meant when saying "a Publisher has been 'discovered'"?

In the documentation it says

on_publisher_discovery(): A new Publisher is discovered in the same domain, a previously known Publisher has been removed, or some Publisher has changed its QoS.

but what exactly is meant by this?

I mean, does it indicate that a publisher has been detected as started publishing topics? or just that there is a publisher (even though it never publishes nothing yet)

And on that same line, how can I find the Active publishers? (meaning the publishers that are publishing topics)

KansaiRobot
  • 7,564
  • 11
  • 71
  • 150
  • Hi @KansaiRobot. according to my experience, this callback can be used to handle events such as the discovery of a new publisher, the removal of a previously known publisher, or changes in the Quality of Service (QoS) settings of a publisher. – dincer.unal May 24 '23 at 12:49

1 Answers1

0

I have been using fastdds for about 2 years. I tried to find a solution based on my experience on the subject. hope I help

find the active publishers in FastDDS, you can leverage the participant discovery mechanism and examine the participants and their associated publishers.

  • set up a participant discovery callback: Register a callback function for participant discovery events using the on_participant_discovery() function or similar mechanism provided by FastDDS. This callback will be triggered when participants join or leave the DDS domain.

  • track discovered participants: Within the participant discovery callback, maintain a data structure (e.g., a list or map) to track the discovered participants. Store relevant information about each participant, such as their unique identifier or other identifying attributes. Track discovered participants: Within the participant discovery callback, maintain a data structure (e.g., a list or map) to track the discovered participants. Store relevant information about each participant, such as their unique identifier or other identifying attributes.

  • set up a publisher discovery callback: Register a callback function for publisher discovery events using the on_publisher_discovery() function or similar mechanism provided by FastDDS. This callback will be triggered when publishers are discovered or removed within the DDS domain.

  • track discovered publishers: Within the publisher discovery callback, update your data structure of discovered participants to include information about the discovered publishers. Associate each publisher with its corresponding participant based on their identifiers or any other linking mechanism.

  • determine active publishers: By inspecting the data structure of discovered participants and associated publishers, you can identify the active publishers. Active publishers are those that have been discovered and are currently associated with a participant within the DDS domain.

dincer.unal
  • 67
  • 1
  • 2
  • 13