Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version


You can't know the order in which messages will be received, so callbacks should be robust to information from other topics. From my experience of ROS, the best way of doing that consist in having callbacks that store data in node's class attributes, so they are accessible from other callbacks. You should also check if the data you need is available (the attribute has a consistent value) or skip processing if not. At most, callbacks should be independent from each other.