ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Hi Sebastian,
a couple of points:
ros::spin()
or ros::spinOnce()
. In roscpp, there are threads which handle topics asynchronously, but they only fill the subscriber queues. When you call ros::spin()
, your thread goes through the messages in the subscriber queues one by one and calls the corresponding callbacks. This means that if you're only using ros::spin()
, your code won't be multi-threaded.Hope this helps!