Synchronizer: is there a way to call another callback function when the synchronizer discards two incoming messages?

asked 2022-08-09 09:38:48 -0500

macia gravatar image

updated 2022-08-10 02:48:32 -0500

Hi everyone, I have a class the does some processing on the information coming from two different messages, a point cloud and an image. I know how to use the message_filters::Synchronizer to grasp the two messages when they are considered _synchronized_. However, I would like to do some processing on the point cloud only, when the two incoming messages are not in sync.

Hence, something like:

if PointCloud2 message and Image message are synchronized: do something

if they are not synchronized: do something on the point cloud only (call another callback function)

How could I achieve that?

EDIT: Using the ExactTime policy, I have found the existence of a registerDropCallback() method that seems to do the trick. However, there is not corresponding method in case of a synchronizer using ApproximateTime policy. Is there something similar to achieve the goal in this case?

edit retag flag offensive close merge delete