Ejemplo n.º 1
0
def talker():
    msg = cannonNumbers()
    msg.r1 = R1
    msg.r2 = R2
    msg.r3 = R3
    msg.l = L
    pub.publish(msg)
Ejemplo n.º 2
0
#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()
import time
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
from std_msgs.msg import String
from GUI.msg import cannonNumbers
import os

uvc_img = Image()
bridge = CvBridge()
pub = rospy.Publisher('cannon_numbers', cannonNumbers, queue_size=10)
btn_down = False
empty = []
reference4Radii = 22.8
reference4Length = 11.0
msg = cannonNumbers()
'''
def talker():
    msg = cannonNumbers()
    msg.r1 = R1
    msg.r2 = R2
    msg.r3 = R3
    msg.l = L
    pub.publish(msg)
'''


def set_window():
    window = cv2.namedWindow("cannon_mission", cv2.WINDOW_NORMAL)
    cv2.resizeWindow("cannon_mission", 1920, 1080)
    cv2.moveWindow("cannon_mission", 100, 100)