ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You will see the effect only under certain circumstances. First make sure you know what a buffer is used for, then you could try the following:
set the buffer size to 1 and publish 100 messages right after another by writing something like
for (int i=0;i<100;++i)
pub.publish(message);
This will publish the message 100 times but will most likely not be received that often. What happens is the following: If your code publishes a message, it will overwrite the last message which is still waiting in the buffer for transmission. How many messages will be received by the subscriber will depend on the network connection between the publisher and the subscriber.