Purpose of rate.sleep()

def publish_once_in_cmd_vel(self):
“”"
This is because publishing in topics sometimes fails the first time you publish.
In continuous publishing systems, this is no big deal, but in systems that publish only
once, it IS very important.
“”"
while not self.ctrl_c:
connections = self.bb8_vel_publisher.get_num_connections()
if connections > 0:
self.bb8_vel_publisher.publish(self.cmd)
rospy.loginfo(“Cmd Published”)
break
else:
self.rate.sleep()

What is the purpose of rate.sleep() function here?

Please see:

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.