예제 #1
0
def mb1swing(msg):
    if mode !=2:
        send = CAN()
        send.stdId = 0x122
        send.extId = -1
        send.data = struct.pack('f', msg.data)
        pub.publish( send )
예제 #2
0
def autoSwingCallback(msg):
    if mode == 2:
        send = CAN()
        send.stdId = 0x122
        send.extId = -1
        send.data = struct.pack('f', msg.data)
        pub.publish(send)
예제 #3
0
def autoSwingCallback(msg):
    if mode ==2:
        send = CAN()
        send.stdId = 0x122
        send.extId = -1
        send.data = struct.pack('f', msg.data)
        pub.publish( send )
예제 #4
0
def mb1swing(msg):
    if mode != 2:
        send = CAN()
        send.stdId = 0x122
        send.extId = -1
        send.data = struct.pack('f', msg.data)
        pub.publish(send)
예제 #5
0
def handCallback(msg):
    send = CAN()
    send.stdId = 0x150
    send.extId = -1
    if msg.data:
        send.data = [0xff]
    else:
        send.data = [0x00]
    pub.publish( send )
예제 #6
0
def handCallback(msg):
    send = CAN()
    send.stdId = 0x150
    send.extId = -1
    if msg.data:
        send.data = [0xff]
    else:
        send.data = [0x00]
    pub.publish(send)
예제 #7
0
def mb1swing(msg):
    if mode != 2:
        send = CAN()
        send.stdId = 0x150
        send.extId = -1
        if msg.data:
            send.data = [0xff]
        else:
            send.data = [0x00]
        pub.publish(send)
def mb1swing(msg):
    if mode !=2:
        send = CAN()
    	send.stdId = 0x150
    	send.extId = -1
    	if msg.data:
        	send.data = [0xff]
    	else:
        	send.data = [0x00]
        pub.publish( send )
예제 #9
0
def talker():
    pub = rospy.Publisher('cantx', CAN, queue_size=100)
    rospy.init_node('canusb_test', anonymous=True)
    r = rospy.Rate(10)  # 10Hz
    count = 0
    while not rospy.is_shutdown():
        msg = CAN()
        msg.stdId = 1
        msg.extId = -1
        msg.data = struct.pack('B', count % 256) + 'ABCDE'
        pub.publish(msg)

        msg = CAN()
        msg.stdId = 100
        msg.extId = 25
        msg.data = struct.pack('i', count)
        pub.publish(msg)

        count += 1

        r.sleep()
예제 #10
0
def autoSwingCallback(msg):
    if mode == 2:
        send = CAN()
        send.stdId = 0x150
        send.extId = -1
        if msg.data:
            if isright == True:
                send.data = [0xfb]
            else:
                send.data = [0xfe]
        else:
            send.data = [0x00]
        pub.publish(send)
예제 #11
0
def autoSwingCallback(msg):
    if mode ==2:
        send = CAN()
    	send.stdId = 0x150
    	send.extId = -1
    	if msg.data:
            if isright == True:
                send.data = [0xfb]
            else:
                send.data = [0xfe]
    	else:
        	send.data = [0x00]
        pub.publish( send )
예제 #12
0
def mb1motor2(msg):
    send = CAN()
    send.stdId = 0x121
    send.extId = -1
    send.data = struct.pack('f', msg.data)
    pub.publish(send)
예제 #13
0
def omni3(msg):
    send = CAN()
    send.stdId = 0x112
    send.extId = -1
    send.data = struct.pack('f', msg.data)
    pub.publish(send)
예제 #14
0
def mb1motor2(msg):
    send = CAN()
    send.stdId = 0x121
    send.extId = -1
    send.data = struct.pack('f', msg.data)
    pub.publish( send )
예제 #15
0
def omni3(msg):
    send = CAN()
    send.stdId = 0x112
    send.extId = -1
    send.data = struct.pack('f', msg.data)
    pub.publish( send )