dw.init(20063)

OralInteraction = OralInteraction()

state = States['start']
while True:

    if state == States['start']:
        input("Presione enter para empezar")
        state = States['introduction']

    if state == States['introduction']:
        dw.set_action(dw.actions['SPEAK06'])
        OralInteraction.introduction()
        dw.stop_action(dw.actions['STAND'])
        state = States['listening']

    if state == States['listening']:
        string = OralInteraction.captureAudio()
        name = OralInteraction.listeningName(string)
        print("Nombre: " + str(name))
        university = OralInteraction.listeningUniversity(string)
        print("Universidad: " + str(university))
        state = States['answer']

    if state == States['answer']:
        dw.set_action(dw.actions['SPEAK06'])
        OralInteraction.answerIntroduction(name, university)
        dw.stop_action(dw.actions['STAND'])
        state = States['final']
    'awaitingInput': 5,
    'goodbye': 6
}

# State variable used on the state machine
state = 'awaitingInput'

objectRecognition = ObjectRecognition()

# Endless loop used for the state machine
while True:
    if state == 'awaitingInput':
        input("Presione ENTER para iniciar")
        state = 'greeting'
    elif state == 'greeting':
        dw.stop_action(dw.actions['SPEAK06'])
        objectRecognition.sayHello()
        time.sleep(1)
        dw.stop_action(dw.actions['SIT_DOWN'])
        # time.sleep(0.5)
        # dw.set_head_angle(0, 10)
        time.sleep(3)
        state = 'takingPhoto'
    elif state == 'takingPhoto':
        objectRecognition.takePhoto()
        state = 'processingImage'
    elif state == 'processingImage':
        objectRecognition.processPhoto()
        state = 'speakingObjects'
    elif state == 'speakingObjects':
        dw.stop_action(dw.actions['STAND'])
    #     dw.set_head_angle(0, 90); #AJUSTAR
    #     state = states['at_door']
    # if state==states['at_door']:

    if state == states['reset']:
        if (time.time() - signals['time_delay']) < INIT_TIME:
            state = states['reset']
        else:
            # dw.set_led_head(dw.led_colors['GREEN'])
            # dw.stop_action(dw.actions['SIT_DOWN'])
            # dw.set_head_angle(0, 10)
            # oi.launchListingRequest()
            # state = states['listingRequest']
            ##ORIGINAL
            dw.set_led_head(dw.led_colors['BLUE'])
            dw.stop_action(dw.actions['STAND'])  #SIT_DOWN
            dw.set_head_angle(0, 90)
            #AJUSTAR
            state = states['at_door']

    elif state == states['at_door']:
        if signals['door']:
            state = states['at_door']
        else:
            ### 4 ###
            signals['dwLookFinished'] = False
            dw.look_around('RIGTH')
            state = states['look_around1']

    elif state == states['look_around1']:
        if not signals['dwLookFinished']:
# State variable used on the state machine
state = 'awaitingInput'

oralInteraction = OralInteraction()

attributes = ['cabello negro']
person_name = 'Person16'

# Endless loop used for the state machine
while True:
    if state == 'awaitingInput':
        input("Presione ENTER para iniciar")
        state = 'greeting'
    elif state == 'greeting':

        dw.stop_action(dw.actions['SPEAK06'])
        oralInteraction.sayHello()
        time.sleep(2)
        state = 'takingPhotos'
    elif state == 'takingPhotos':
        dw.set_head_angle(0, 110)
        time.sleep(1)
        C.add_person(person_name)
        state = 'speakingAttributes'
    # elif state == 'learningPerson':
    # 	input( "Estado aprendiendo persona" )
    # 	state = 'speakingAttributes'
    elif state == 'speakingAttributes':

        attributes = ['Reconozco que eres ' + dictionary_atributes[C.get_person_attribute(person_name)['gender']] \
            + ', ' +  dictionary_atributes[C.get_person_attribute(person_name)['glasses']] \