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

You will have to return from the callback to receive another callback on the next message. So, the work loop must be running in another tread, maybe in the main thread. It can be as simple as something like:

  • in the callback just save the received message to some variable
  • in the main loop wait for it to become _START_REC, then do your stuff while checking for it to become _STOP_REC