When would a ApproximateTime Sync stop calling ist callback?
Hi there!
I have two topics that I want to synchronize. One is running at a rate of 20 Hz, the other one approx. at 28 Hz. I am using the following code.
In the header file I define:
typedef message_filters::sync_policies::ApproximateTime<sensor_msgs::PointCloud2, sensor_msgs::PointCloud2> SyncPolicy;
message_filters::Subscriber<sensor_msgs::PointCloud2> cloud_sub1;
message_filters::Subscriber<sensor_msgs::PointCloud2> cloud_sub2;
message_filters::Synchronizer<SyncPolicy> *sync_;
In the cpp file:
cloud_sub1.subscribe(nh, "in/points1", 30);
cloud_sub2.subscribe(nh, "in/points2", 30);
sync_ = new message_filters::Synchronizer<SyncPolicy>(SyncPolicy(30), cloud_sub1, cloud_sub2);
sync_->registerCallback(boost::bind(&Hello::callback, this, _1, _2));
The code works, but after many hours of running my project it can happen, that the callback is not called anymore, even though the node is still alive.
- Does the queue size passed here cloud_sub1.subscribe(nh, "in/points1", 30); have any effect? I can set this to -1 and it still seems to be generally working.
- I must admit I do not really understand the ApproximateTime algorithm described here But from my understanding, it should always call its callback, when there are actually messages in both queues (which I have verified - both incoming topics still send data, even in times the callback is not called anymore). When is the callback not called? What does that tell us about the messages in the queues?
- Is the queue size passed to the SyncPolicy set to all subscribers? I thought it would be a queue for already matched "sets", but why can I set the queue size of the subscribers to -1 then?
Hope someone can help :)
FYI, your link in #2 is not valid.
thanks, I fixed the link.