Publisher and subscriber have more than one Datawriter and Datareader as default

asked 2020-04-02 09:54:11 -0500

Sapodilla gravatar image

Hi everyone,

I am investigating the Discovery phase of ROS2 using Wireshark. According to the picture below, as I understand RTPS discovery mechanism, there are 8 DataWriter in the participant while I only create 1 publisher. The same thing with the subscriber, I only create 1 subscriber but in the heartbeat packet indicating that there are 8 DataReader.

image description

Additionally, those number of DataWriter and DataReader are not fixed. The other time I start the same application, I get different numbers for DataWriter and Data Reader.

My setup is a simple communication between one publisher and one subscriber with no QoS running on the same machine. ROS2 runs on FastRTPS. My question are that:

  1. Why do I have more than 1 DataReader and 1 DataWriter?
  2. What are those extra DataReader and DataWriter? What are their purpose?
  3. Does it affect on discovery duration as well as performance?

Thanks in advance! I apology if I make an inappropriate question.

edit retag flag offensive close merge delete