ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You should definitely NOT use time.sleep()
.
The ROS way of doing this is:
rate = rospy.Rate(5)
# Do stuff
rate.sleep()
2 | No.2 Revision |
You should definitely NOT use time.sleep()
.
The ROS way of doing this is:
rate = rospy.Rate(5)
rospy.Rate(1) # 1 Hz
# Do stuff
rate.sleep()
Or the similar:
rospy.sleep(1) # 1 sec
3 | No.3 Revision |
You should definitely NOT use time.sleep()
.
The ROS way of doing this is:
rate = rospy.Rate(1) # 1 Hz
# Do stuff
rate.sleep()
rate.sleep() # Sleeps for 1/rate sec
Or the similar:
rospy.sleep(1) # Sleeps for 1 sec
4 | No.4 Revision |
You should definitely NOT use time.sleep()
The ROS way of doing this is:
rate = rospy.Rate(1) # 1 Hz
# Do stuff
stuff, maybe in a while loop
rate.sleep() # Sleeps for 1/rate sec
Or the similar:
rospy.sleep(1) # Sleeps for 1 sec
5 | No.5 Revision |
You should definitely NOT use time.sleep()
The ROS way of doing this is:
rate = rospy.Rate(1) # 1 Hz
# Do stuff, maybe in a while loop
rate.sleep() # Sleeps for 1/rate sec
Or the similar:
rospy.sleep(1) # Sleeps for 1 sec
API documentation: http://docs.ros.org/jade/api/rospy/html/rospy.rostime-module.html
6 | No.6 Revision |
You should definitely NOT use time.sleep()
The ROS way of doing this is:
rate = rospy.Rate(1) # 1 Hz
# Do stuff, maybe in a while loop
rate.sleep() # Sleeps for 1/rate sec
Or the similar:
rospy.sleep(1) # Sleeps for 1 sec
In both cases, you'll ofc need to import rospy
Here's the API documentation: http://docs.ros.org/jade/api/rospy/html/rospy.rostime-module.html