mayacakmak / emarsoftware

Front end tools for designing robot faces, setting up custom robot APIs, and controlling a robot (WoZ)
BSD 2-Clause "Simplified" License
2 stars 12 forks source link

Consecutive robot.speak() calls #23

Open samesoul opened 4 years ago

samesoul commented 4 years ago

When inserting consecutive "robot.speak();" functions, only performs first one. Need to add robot.sleep(); functions in between speaking functions and guess the duration, or aggregate them into a single robot.speak(); function (but that removes natural pauses in between sentences).

Screen Shot 2020-07-16 at 12 12 02 PM

Either make this explicit in specifications or fix

kaimihata commented 4 years ago

Need to update https://github.com/mayacakmak/robotapijs to make the speak function return a promise, but the speaking is handled in the backend, so not 100% how to handle this best yet.

mayacakmak commented 4 years ago

I think the issue is that the function is currently non-blocking, so the later function calls happen right away but get dropped b/c the robot is already speaking. We might need a way to catch the ending of speak actions. Ideally we would have two versions of the function; one would block execution until the utterance is done the other would just start an utterance (which is useful for doing two things in parallel), but we need to know when it's done to then start the pause and next utterance. We need to look into the speech process in the back end (face renderer) see if there is an event triggered when the speech is done or a state variable that becomes true/false that we can check/expose to the API.