def __init__(self):
     self.flag_sign = 0
     self.start_stoping = 0
     self.class_names = ["right", "left", "forward", "backward"]
     rospy.init_node('velocity_command')
     self.pub = rospy.Publisher('/topic_value', velo, queue_size=1)
     self.msgValue = velo()
Exemple #2
0
 def __init__(self):
     self.class_names = ["right", "left", "forward", "backward"]
     self.state = "initializing..."
     self.font = cv2.FONT_HERSHEY_SIMPLEX
     self.t1 = time.clock()
     #ros
     rospy.init_node('velocity_command')
     self.pub = rospy.Publisher('/topic_value', velo, queue_size=1)
     self.msgValue = velo()
Exemple #3
0
    def __init__(self,st_tick):
        self.input_size = 120*320
	#vrep 128*256
        # create labels
        self.k = np.zeros((4, 4), 'float')
        for i in range(4):
            self.k[i, i] = 1
        #paygame
        self.saved_frame = 0
        self.total_frame = 0
        self.frame=0
        self.st_tick=st_tick
        #ros
        rospy.init_node('velocity_command')
        self.pub=rospy.Publisher('/topic_value',velo,queue_size=1)
        self.msgValue=velo()
        self.X = np.empty((0, self.input_size))
        self.y = np.empty((0, 4))
Exemple #4
0
blue = (0, 0, 255)
green = (0, 255, 0)
pink = (255, 200, 200)
pleft = 0
pright = 0
pg.init()
screen = pg.display.set_mode((480, 240))
screen.fill(pink)
myfont = pg.font.SysFont("monospace", 80)
font = pg.font.SysFont("monospace", 20)
text = ""
#ros
rospy.init_node('publish_topic')
pub = rospy.Publisher('/topic_value', velo, queue_size=1)
rate = rospy.Rate(100)
msgValue = velo()


def evento():
    global text, pleft, pright
    for event in pg.event.get():
        if event.type == pg.QUIT:
            return
        if event.type == pg.KEYDOWN:
            if event.key == pg.K_UP:
                text = "FORWARD"
                pleft = 100
                pright = 100
                screen.fill(pink)
            elif event.key == pg.K_DOWN:
                text = "BACKWARD"