ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I won't work like that.

A callback is called back, i.e. it will be triggered iff there is data available from a publisher. You cannot request data from a callback.

The correct way to solve the problem is to synchronize the callbacks, i.e. collect data from both and only trigger your specific code if data from both is OK. For some common use cases, there already exist ROS methods, e.g. Stamped data from one callback and a transformation from TF.