def mb1swing(msg): if mode !=2: send = CAN() send.stdId = 0x122 send.extId = -1 send.data = struct.pack('f', msg.data) pub.publish( send )
def autoSwingCallback(msg): if mode == 2: send = CAN() send.stdId = 0x122 send.extId = -1 send.data = struct.pack('f', msg.data) pub.publish(send)
def autoSwingCallback(msg): if mode ==2: send = CAN() send.stdId = 0x122 send.extId = -1 send.data = struct.pack('f', msg.data) pub.publish( send )
def mb1swing(msg): if mode != 2: send = CAN() send.stdId = 0x122 send.extId = -1 send.data = struct.pack('f', msg.data) pub.publish(send)
def handCallback(msg): send = CAN() send.stdId = 0x150 send.extId = -1 if msg.data: send.data = [0xff] else: send.data = [0x00] pub.publish( send )
def handCallback(msg): 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)
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 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()
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)
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 )
def mb1motor2(msg): send = CAN() send.stdId = 0x121 send.extId = -1 send.data = struct.pack('f', msg.data) pub.publish(send)
def omni3(msg): send = CAN() send.stdId = 0x112 send.extId = -1 send.data = struct.pack('f', msg.data) pub.publish(send)
def mb1motor2(msg): send = CAN() send.stdId = 0x121 send.extId = -1 send.data = struct.pack('f', msg.data) pub.publish( send )
def omni3(msg): send = CAN() send.stdId = 0x112 send.extId = -1 send.data = struct.pack('f', msg.data) pub.publish( send )