Ejemplo n.º 1
0
def action_tilt_head():
    global lastKnownHeadPosition
    BOT.sendServo(HEAD, lastKnownHeadPosition)
    positionTo = random.randint(0,40)
    currentPosition = lastKnownHeadPosition
    for x in range(0, positionTo):
        if positionTo > currentPosition:
            currentPosition += 1
            BOT.sendServo(HEAD, currentPosition)
        elif positionTo < currentPosition:
            currentPosition -= 1
            BOT.sendServo(HEAD, currentPosition)

    lastKnownHeadPosition = currentPosition
Ejemplo n.º 2
0
def action_be_reset():
  BOT.sendServo(RIGHT_SHOULDER, 180)
  BOT.sendServo(LEFT_SHOULDER, 0)
  BOT.sendServo(RIGHT_WING, 0)

  BOT.sendServo(LEFT_WING, 90)
  BOT.sendServo(LEFT_ELBOW, 0)
  BOT.sendServo(RIGHT_ELBOW, 100)
  pass
Ejemplo n.º 3
0
def action_be_happy():
  BOT.sendServo(RIGHT_SHOULDER, 0)
  BOT.sendServo(LEFT_SHOULDER, 100)
  BOT.sendServo(RIGHT_WING, 0)
  BOT.sendServo(LEFT_WING, 90)
  BOT.sendServo(LEFT_ELBOW, 0)
  BOT.sendServo(RIGHT_ELBOW, 100)
Ejemplo n.º 4
0
def action_be_happy():
  BOT.sendServo(RIGHT_SHOULDER, 0)
  BOT.sendServo(LEFT_SHOULDER, 180)
  BOT.sendServo(RIGHT_WING, 0)
  BOT.sendServo(LEFT_WING, 90)
  BOT.sendServo(LEFT_ELBOW, 90)
  BOT.sendServo(LEFT_ELBOW, 90)

  for client in SocketManager.clients:
          client.write_message("emotion:happy")
  pass