Short summary of what I tried to do and what it's actually doing.
In my project I have two simple nodes: one for listening and publishing, and another for speaking and subscribing. I named them listeningNode and speakingNode, respectively.
The task I wanted to achieve was pretty simple, I would have the user say "remember me" which would be recognized as a keyword and be published to voiceCommandCallback
method in the speaking node so my robot could say "Okay, please say your name". Then, back at the listening node, on top of publishing that keyphrase it will also call the method recognize_from_mic_with_dict()
which as you can guess will run using a dictionary of names.
This recognize_from_mic_with_dict()
method will be listening for a name and will attempt to publish that name to namesCallback()
in the listening node and this is where I check if what got published was an actual name or if it was just gibberish, in which case I would kindly ask the user to repeat his/her name and subscribe once again to recognize_from_mic_with_dict()
so it could listen once more.
This sounds more complicated that it probably has to be but it's the only way I could think of achieving this "mode switching". The problem is that if it hears gibberish it will say "I'm sorry, I did not quite hear that. Please repeat that!" and I would like to know if there is a way to make the listening node ignore anything that the robot says because it's attempting to recognize names from its own sentence.