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

There is ros::Time and ros::Duration, which can be used in an intuitive way. ros::Time::now() gives you the current time. You probably want something like:

ros::Time start = ros::Time::now()
while(ros::Time::now - start < ros::Duration(5.0))
    ...

There is ros::Time and ros::Duration, which can be used in an intuitive way. ros::Time::now() gives you the current time. You probably want something like:

ros::Time start = ros::Time::now()
while(ros::Time::now while(ros::Time::now() - start < ros::Duration(5.0))
    ...