vector-python-sdk icon indicating copy to clipboard operation
vector-python-sdk copied to clipboard

Trying to call "say_text" twice error

Open edeneliel opened this issue 5 years ago • 0 comments
trafficstars

Let's say i want to make my vector say "Sorry" every time he's not able to get what i said So i wrote this code:

def on_wake_word(robot, event_type, event):
    if "wake_word_end" in str(event) and event.wake_word_end.intent_json == '':
        try:
            robot.conn.request_control()
            robot.behavior.say_text("Sorry i couldn't help")
        finally:
            robot.conn.release_control()


if __name__ == "__main__":

    with Robot() as vector_robot:
        vector_robot.events.subscribe(on_wake_word, Events.wake_word)

        while True:
            sleep(1)

the function does called twice if i try to trigger vector, the first time vector reacts as he should, and say the text, the second time though, he gets there and throw an error:

<_MultiThreadedRendezvous of RPC that terminated with:
	status = StatusCode.INTERNAL
	details = "Failed to say text"
	debug_error_string = "{"created":"@1601351205.816768000","description":"Error received from peer ipv4:X.X.X.X:443","file":"src/core/lib/surface/call.cc","file_line":1062,"grpc_message":"Failed to say text","grpc_status":13}"
>

expected: That vector will work multiple times with the same call,

Thanks ahead, Eden

edeneliel avatar Sep 29 '20 03:09 edeneliel