def print_time(threadName, delay):
global f
global last_time
rate = rospy.Rate(10) # 10hz
while not rospy.is_shutdown():
try:
if rospy.get_time() - last_time >= 60.0:
last_time = rospy.get_time()
f.close()
f = open('log_file' + str(datetime.datetime.now()) + '.txt','w')
except rospy.ROSInterruptException:
pass
rate.sleep()
评论列表
文章目录