ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You should use a combination of spinOnce() and sleep (have a look at the tutorials). spin() blocks until an error occures or the program receives a sigint (ctrl+c).
Also it may be a good idea to move the spinning to the main loop. A blocking constructor seems like rather bad design... :)