def talker(): msg = Num() msg.circlesNo = C msg.trianglesNo = T msg.linesNo = L msg.squaresNo = S pub.publish(msg)
def talker(): #rospy.init_node('shapes_no', anonymous=True) rate = rospy.Rate(10) msg = Num() msg.circlesNo = C msg.trianglesNo = T msg.linesNo = L msg.squaresNo = S while not rospy.is_shutdown(): rospy.loginfo(msg) pub.publish(msg) rate.sleep()
#port imports import serial.tools.list_ports as port_list #Flags Publishers species_flag_pub = rospy.Publisher('species_flag', String, queue_size=10) line_follower_flag_pub = rospy.Publisher('line_follower_flag', String, queue_size=10) cannon_flag_pub = rospy.Publisher('cannon_flag', String, queue_size=10) judge_canon_pub = rospy.Publisher('cannon_numbers', cannonNumbers, queue_size=10) #global variables cannon_numbers = cannonNumbers() species_count = Num() joy_values = String() rov_msg = rov_msgs() uvc_img = Image() crack_length = '' cap = None #Text Variables font = cv2.FONT_HERSHEY_SIMPLEX bottomLeftCornerOfText = (10, 500) fontScale = 1 fontColor = (0, 0, 255) lineType = 2 # Instantiate CvBridge, object bridge = CvBridge()