Custom message_filters implementation. How?

asked 2015-10-17 07:37:05 -0600

Dimitri Schachmann gravatar image

What I tried:

After studying the message_filters documenation, message_filters appear to me as a powerful tool for topic synchronization. I see how this is indeed realized in the elegant interfaces of the stated TimeSynchronizer, TimeSequencer, Cache and Policy-Based Synchronizers.

But those listed implementations are quite limited considering that there apperar to be only two implemented policies for Policy-Based Synchronizers, one of which is ApproximateTime and the other is ExactTime which mimics TimeSynchronizer.

So I see no easy way to synchronize topics in any other way than ExactTime or ApproximateTime. I tried eyballing approximate_time.h and exact_time.h but there is no documentation that would help me figure out how to write my own sync policy.

My question is:

Is there some documentation on the sync policy API or are there more examples of sync policy implementations? How can I avoid reverse engineering non-documented code that makes heavy use of metaprogramming?

Some context:

I'd like to have a synchronizer for multiple topics, say <A, B, C, D> and I want my callback(A, B, C, D) to be triggered only each new A where for B, C and D just he most recent messages are passed to the callback. All of the data must be available before any callback. I see no way of doing this with the existing message_filter implementation.

What I do now is to handle that logic in my node by heaving B, C, D members which are updated in their own callback plus checking in the A callback whether B, C, D were already received. But this is such a common pattern and begs for encapsulation in a message filter!

edit retag flag offensive close merge delete