ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
From the Callbacks and Subscribers wiki,
#include <ros/callback_queue.h>
ros::NodeHandle n;
while (ros::ok())
{
ros::getGlobalCallbackQueue()->callAvailable(ros::WallDuration(0.1));
}
Is the equivalent implementation of ros::spin()
. That page should also have some different ways of implementing multhread spinning, although none of them are event driven that I can tell.
2 | No.2 Revision |
From the Callbacks and Subscribers wiki,
#include <ros/callback_queue.h>
ros::NodeHandle n;
while (ros::ok())
{
ros::getGlobalCallbackQueue()->callAvailable(ros::WallDuration(0.1));
}
Is the equivalent implementation of ros::spin()
. That page should also have some different ways of implementing multhread spinning, although none of them are event driven that I can tell. .
Edit: From @gvdhoorn's comments below, callAvaliable
waits on a condition variable for the given duration, making spin majority event driven.