def run(self): """ This function is the main run loop.""" rospy.on_shutdown(self.stop) while not rospy.is_shutdown(): if self.twist: self.publisher.publish(self.twist) self.r.sleep()