ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
As far as I understand it, when you call publish
it does not block until the message is actually sent, but places the message in the publish queue and returns immediately. When your function, in which you called publish
returns, it is up to ROS (via ros::spin()
) to decide what to call next. Possibly to actually serialize and send your message, but there could be other stuff to do, e.g. processing an incoming message or publishing other messages.
Hence you need a queue and published messages could be dropped if there is too much load, form receiving and/or publishing too many messages.