def __init__(self, id, color, speed, pos): self.id = id self.speed = speed self.color = color self.position = pos self.isLife = True self.acceleration = [0, 0] self.rotation = 0.0 self.publisher = rospy.Publisher(self.id, Marker, queue_size=10) self.ros() self.nunchucks = [] i = 0 while i < NUNCHUCKS_COUNT + 1: me = self.id + "_hand" + str(i) position = (NUNCHUCK_LENGTH[0], 0, 0) parent = self.id + "_hand" + str(i - 1) if i == 0: parent = self.id position = (0.4, 0, 0) nunchuck = Nunchuck(me, Marker.CYLINDER, parent, position, NUNCHUCK_LENGTH, [1, 1, 1], 220) self.nunchucks.append(nunchuck) i += 1 position = (1, 0, 0) parent = self.id + "_hand" + str(i - 1) nunchuck = Nunchuck(self.id + "_damage", Marker.ARROW, parent, position, [0.9, 0.5, 0.1], [0.3, 1, 0.7], 0) self.nunchucks.append(nunchuck) self.damage = nunchuck
def __init__(self): self.Nunchuck = Nunchuck.Nunchuck() self.Nunchuck.setdelay(0.005)