def callback(data):
print("callback called...")
global i
global vc
rospy.loginfo("I heard %s",data)
with open('dataset.csv', 'a') as csvfile:
spamwriter = csv.writer(csvfile, delimiter=' ',
quotechar='|', quoting=csv.QUOTE_MINIMAL)
spamwriter.writerow([data.angular.z])
if vc.isOpened(): # try to get the first frame
rval, frame = vc.read()
else:
rval = False
rval, frame = vc.read()
cv2.imwrite("images/image_" + str(i) + ".png", frame)
i += 1
评论列表
文章目录