ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Even when publishing is asynchronous, the publish() method will always take some time when there are subscribers. When nothing is subscribing, there is nothing for it to do so it returns quickly, but when something subscribes, it must serialise the data and push it onto an output queue. For point clouds, which tend to be large, the serialisation can take a while. The good thing is that this time remains the same no matter how many subscribers there are.

If you are creating a synchronous publisher (by not passing the queue_size argument when you create the publisher) then message passing becomes synchronous, which could lead to a significant delay for large data like point clouds, particularly if the number of subscribers grows. You should always pass the queue_size argument when creating the publisher. See here for advice on choosing a good queue size.