Ask Your Question
1

Force subscriber to process messages in the right order

asked 2013-08-17 07:33:50 -0600

philippp625 gravatar image

updated 2013-08-17 08:06:28 -0600

I have a single publisher that publishes messages at high frequency (1800 Hz), and a subscriber in another node. I realized that the messages are not always processed sequentially. I verified this by doing the following: in the callback function, I output a warning every time the seq number of the processed message is lower than the seq number of the message processed in the previous call of the callback.

My question: is there a way to force a subscriber to process the incoming messages exactly in the order of the seq numbers in their header? (up to now I thought this would be the case by default with a single subscriber/publisher system, but apparently it isn't...)

Any help is greatly appreciated!

edit retag flag offensive close merge delete

Comments

I just realized that my problem only exists if I use a tf::MessageFilter when subscribing. Nevertheless, I don't understand why the messages are not processed in the order of their time stamps, since they all have the same frame_id, so the transforms should be available for older messages first.

philippp625 gravatar imagephilippp625 ( 2013-08-19 01:53:07 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-12-05 18:45:09 -0600

tfoote gravatar image

The message filter is specifically designed to cache and potentially return messages when they're ready and doesn't keep the order internally. You could write a specialization which would return them only in the incoming order.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-08-17 07:33:50 -0600

Seen: 478 times

Last updated: Dec 05 '17