Clearing all messages on a topic
I have been reading about the callback queue in roscpp but, I have not found the information I am looking for. I would like to know if there is a way to remove all messages in the callback queue.
As an example: I have a subscriberNode that subscribes to topicFoo and topicInterrupt
5 messages were published to topicFoo from publisherNode.
After the first topicFoo message is processed in topicFooCallback, a topicInterrupt message is published and processed. At this point, I would like all messages in the topicFooCallback to be removed.
Is there a way to do this? Please let me know if any of this is unclear.