Ask Your Question

Synchronizing between a message and a tf.

asked 2013-02-26 10:29:07 -0500

updated 2013-02-26 10:30:43 -0500

I am writing an application, where I subscribe to large messages (such as images or point clouds) and I use them in conjunction with a tf transform. The message arrives, I query the tf server for the transform, and if the transform satisfies a certain criteria, I do something with the message. Otherwise, I ignore the message.

If the message publisher and message subscriber are on different computers over a network, this generates a lot of wasted traffic for all the discarded messages. Is there an elegant way to resolve this? For example, subscribe to a specific tf, process it, and if it meets the criteria, request a single message?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-02-26 20:59:54 -0500

Achim gravatar image

Of course there are the message filters for that. But I don't think they solve your problem. I don't think that you can resemble the "transmit only the necessary stuff" mechanic through topics, because AFAIK if you subscribe to a topic, ros will transmit all the messages on that topic to your node (and if you can't process them fast enough and run out of buffer space, old ones are discarded).

I think you should look into the service mechanism that ros offers. Of course time delays are a problem here... you could implement, for example, a service request to the node that has the data (and should buffer some of that) with a timestamp as parameter of the TF you received and then transmit back the most fitting data available. Something like that. In any case the service mechanism allows you to transmit data only when you request it. That's what you need, right?

edit flag offensive delete link more


Services are an option. I would like to stick with topics, because it already works with topics, and works fine when the pub/sub are on the same machine. I was hoping to get the netweork case without chaning the infrastructure too much. Is there a subscirber option to request a single message, instead of a continuous asynchronous callback?

Ivan Dryanovski gravatar image Ivan Dryanovski  ( 2013-02-27 01:58:26 -0500 )edit

To my knowledge, the proposed solution for receiving single messages is to register a subscriber and withdraw as soon as a message was received.

Philip gravatar image Philip  ( 2013-02-27 03:16:21 -0500 )edit

@Philip: Do you know if there a cost / delay associated with the re-subscription?

Ivan Dryanovski gravatar image Ivan Dryanovski  ( 2013-02-27 03:34:48 -0500 )edit

I'll use it soon, but haven't done so yet. Some cost will arise (informing the roscore of the new subscriber, contacting the publisher (if any), ...), but I've got no clue about the timing details, i.e. real cost.

Philip gravatar image Philip  ( 2013-03-05 00:04:19 -0500 )edit

Your Answer

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

Add Answer

Question Tools


Asked: 2013-02-26 10:29:07 -0500

Seen: 182 times

Last updated: Feb 26 '13