0
$\begingroup$

Rosanswers logo

Hi,

I have a design problem.

I have a topic with an image, that needs to be analyzed and I need to get a certain coordinate from it. I also have another topic with a certain coordinate.

I need to use both of those coordinates in a callback method. So let's say I have a subscriber's callback:

callback(imageInfo) {
    //I only get the imageinfo here
}

So I get the imageinfo there but I need to use the certain coordinate info also, to calculate a result. I could create a global variable for the certain coordinate and have a different subscriber with a callback setting its value and then use the global variable in the callback(imageinfo).

But is there a better way? It doesn't seem that good.


Originally posted by RosFan19 on ROS Answers with karma: 107 on 2015-04-20

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

have a look at http://wiki.ros.org/message_filters

if your messages have Header fields with sync'ed time stamps you could use the TimeSynchronizer for instance:

http://wiki.ros.org/message_filters#Time_Synchronizer


Originally posted by Wolf with karma: 7555 on 2015-04-20

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by RosFan19 on 2015-04-20:
This is exactly what I needed. Thanks!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.