ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I don't think that your subscriptions callbacks are guaranteed to overlap. How did you choose 25,000 lines, and have you timed the callback to see if it actually takes longer than 0.5 seconds?
I would try rewriting your subscription callback as such:
void myCallback(const std_msgs::String& str)
{
count++;
ros::Duration d(0.6);
printf("\nSubscriber %i is going to sleep\n", count);
d.sleep();
printf("\nSubscriber %i is waking up\n", count);
}
This way you know that the subscription callbacks are slower than your publish calls. You should then expect to see the subscription process print something like:
Subscriber 0 is going to sleep
Subscriber 1 is going to sleep
Subscriber 0 is waking up
etc...