What is the best way to synchronize messages?
I wrote a script with two subscribers. The general way to do this is of course
subN = rospy.Subscriber("topicN", TypeN,CallbackN)
so I have two callbacks: Callback1 for topic1 and Callback2 for topic2
However my objective is to use the information of both these topics to generate (and publish) another message.
I am wondering how should I proceed to use both of these messages? Where should I put the code? In a third callback function? How can I synchronize receiving these two messages?
@Kansai: I'm trying to figure out what leads people to post new questions on topics already discussed on ROS Answers. There are many duplicates of your question (and of @Rufus answer).
Could you write a bit about how you approached posting here? Did you search before you posted? If so: how did you search? With which tools? If not: why not? If you did search, and did find previous Q&As: did those not answer your question? Could you describe why not?