davesnowdon / nao-recorder

Record NAO's joint positions and save the data or generate code to produce animations using FluentNAO (https://github.com/dnajd/FluentNao)
GNU General Public License v2.0
3 stars 3 forks source link

Check when speech recognition is already running and handle #27

Closed davesnowdon closed 11 years ago

davesnowdon commented 11 years ago

If nao_recorder crashes and leaves speech recognition running, then the next time nao_recorder is started it will crash with the following exception ALSpeechRecognition::setWordListAsVocabulary AsrEngine::setVocabulary Vocabulary cannot be changed while ASR engine is running

davesnowdon commented 11 years ago

File "src/main/python/recorder/main.py", line 218, in do_connect if self.robot.connect(hostname, portnumber): File "/opt/home/dns/projects/nao/nao-recorder/src/main/python/recorder/core.py", line 200, in connect self.env.speechRecognition.setWordListAsVocabulary(self.vocabulary.keys(), False) File "/opt/packages/aldebaran-robotics/nao/pynaoqi/naoqi.py", line 239, in call return self.wrapped.method_missing(self.method, _args, *_kwargs) File "/opt/packages/aldebaran-robotics/nao/pynaoqi/naoqi.py", line 309, in method_missing raise e RuntimeError: ALSpeechRecognition::setWordListAsVocabulary ALBroker::methodCall: method: setWordListAsVocabulary, params: [["left arm relax", "head stiff", "left arm stiff", "left hand open", "right hand close", "now lie back", "now crouch", "right leg relax", "right hand open", "right leg stiff", "now exit", "now lie belly", "hello now", "left hand close", "left leg relax", "right arm relax", "now sit", "now key frame", "now stand", "left leg stiff", "head relax", "right arm stiff"], false] ALSpeechRecognition::setWordListAsVocabulary AsrEngine::setVocabulary Vocabulary cannot be changed while ASR engine is running