ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Another option is using
ros::Duration(1.0).sleep() // Sleep for one second
while Rate
requires the sleep duration in Hz (1/s), Duration
requires the sleep time in seconds. Typically, Rate
is used inside loops, while Duration
is the better choice when the sleeping occurs just once.