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

This is not something broken. The published data is not stored anywhere. It's just published. If no one has yet subscribed, the message is lost. So it all depends on the order and timing of your nodes: when do the talker allow connections (advertise) and when do the listener actually subscribe.

Normally you will want a design where it is not a problem if the first message it lost. Maybe it helps to think of the published data as a momentarily status for a sensor, say it might be a temperature reading. The interesting thing is the actual temperature, which is published with some interval and the first temperature reading is usually not important.

However to some extend you can actually cache some data to help clients (listeners) keep up with the message stream. Read about queue sizes and the latch option here