ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Example code that should achieve what you want:
ros::Time start_time = ros::Time::now();
ros::Duration timeout(2.0); // Timeout of 2 seconds
while(ros::Time::now() - start_time < timeout) {
// do your stuff
}
2 | No.2 Revision |
Example code that should achieve do what you want:
ros::Time start_time = ros::Time::now();
ros::Duration timeout(2.0); // Timeout of 2 seconds
while(ros::Time::now() - start_time < timeout) {
// do your stuff
}