Beispiel #1
0
        print "Cannot reach {}.".format(adress)
        print "Trying next adress..."
    else:
        break

if web_asker is None:
    print "Cannot reach any adress."
else:
    web_asker.clear_all()

    t = 0
    last_t = 0
    window = 1
    period = 0.05

    pause_question = web_asker.ask("Pause ?", ["Pause !"], priority=10)
    feedback_question = web_asker.ask("Rate behavior : ", [])

    while True:
        if pause_question.answered():
            feedback_question.remove()
            pause_question.remove()

            web_asker.ask("Restart ?", ["Restart !"], priority=10).get_answer()

            pause_question = web_asker.ask("Pause ?", ["Pause !"], priority=10)

        if t - last_t > window:
            if not feedback_question.answered():
                feedback_question.remove()
Beispiel #2
0
for adress in adress_list:
    try:
        web_asker = WebAsker(adress)
    except Exception, e:
        print "Cannot reach {}.".format(adress)
        print "Trying next adress..."
    else:
        break

if web_asker is None:
    print "Cannot reach any adress."
else:
    web_asker.clear_all()

    while True:
        question = web_asker.ask("Pick an action :",
            ["Wait", "Hold", "Pick", "Give", "Go_home"])
        action = question.get_answer().lower()

        if action == "wait":
            action_tuple = action

        elif action == "hold":
            question = web_asker.ask("Pick an object :",
                ["Handle", "Side_left", "Side_right", "Side_front", "Side_back"])
            obj = question.get_answer().lower()

            question = web_asker.ask("Pick a pose :", ["0", "1"])
            pose = int(question.get_answer())

            action_tuple = (action, obj, pose)
Beispiel #3
0
for adress in adress_list:
    try:
        web_asker = WebAsker(adress)
    except Exception, e:
        print "Cannot reach {}.".format(adress)
        print "Trying next adress..."
    else:
        break

if web_asker is None:
    print "Cannot reach any adress."
else:
    web_asker.clear_all()

    while True:
        question = web_asker.ask("Pick an action :",
                                 ["Wait", "Hold", "Pick", "Give", "Go_home"])
        action = question.get_answer().lower()

        if action == "wait":
            action_tuple = action

        elif action == "hold":
            question = web_asker.ask("Pick an object :", [
                "Handle", "Side_left", "Side_right", "Side_front", "Side_back"
            ])
            obj = question.get_answer().lower()

            question = web_asker.ask("Pick a pose :", ["0", "1"])
            pose = int(question.get_answer())

            action_tuple = (action, obj, pose)
Beispiel #4
0
        print "Cannot reach {}.".format(adress)
        print "Trying next adress..."
    else:
        break

if web_asker is None:
    print "Cannot reach any adress."
else:
    web_asker.clear_all()

    t = 0
    last_t = 0
    window = 1
    period = 0.05

    pause_question = web_asker.ask("Pause ?", ["Pause !"], priority=10)
    feedback_question = web_asker.ask("Rate behavior : ", [])

    while True:
        if pause_question.answered():
            feedback_question.remove()
            pause_question.remove()

            web_asker.ask("Restart ?", ["Restart !"], priority=10).get_answer()

            pause_question = web_asker.ask("Pause ?", ["Pause !"], priority=10)

        if t - last_t > window:
            if not feedback_question.answered():
                feedback_question.remove()