Pankaj-Baranwal / pocketsphinx

Updated ROS bindings to pocketsphinx
BSD 3-Clause "New" or "Revised" License
38 stars 25 forks source link

error recognizer.py #5

Closed han88 closed 7 years ago

han88 commented 7 years ago

while launching robocup.launch i get this error:

process[recognizer-2]: started with pid [6117] [INFO] [1508098044.496404]: Launch config: gconfaudiosrc [INFO] [1508098044.504315]: Starting recognizer... Traceback (most recent call last): File "/home/hannes/catkin_ws/src/pocketsphinx/0.4/nodes/recognizer.py", line 177, in start = recognizer() File "/home/hannes/catkin_ws/src/pocketsphinx/0.4/nodes/recognizer.py", line 73, in init self.start_recognizer() File "/home/hannes/catkin_ws/src/pocketsphinx/0.4/nodes/recognizer.py", line 80, in start_recognizer self.pipeline = gst.parse_launch(self.launch_config) glib.GError: Kein Element »vader« Traceback (most recent call last): File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/core.py", line 467, in signal_shutdown h() File "/home/hannes/catkin_ws/src/pocketsphinx/0.4/nodes/recognizer.py", line 131, in shutdown gtk.main_quit() RuntimeError: called outside of a mainloop [recognizer-2] process has died [pid 6117, exit code 1, cmd /home/hannes/catkin_ws/src/pocketsphinx/0.4/nodes/recognizer.py name:=recognizer log:=/home/hannes/.ros/log/7508c7a4-b1e4-11e7-a2c9-685d43fb8a01/recognizer-2.log]. log file: /home/hannes/.ros/log/7508c7a4-b1e4-11e7-a2c9-685d43fb8a01/recognizer-2*.log

do have an idea how to fix this error? thx

Pankaj-Baranwal commented 7 years ago

Well, robocup.launch is part of the really old version which MikeFerguson had developed back in 2011. If you need the same functionality, you should rather use the updated features present in this package. Simply follow this link: https://github.com/Pankaj-Baranwal/cmu-pocketsphinx/wiki And check out the demos for kws mode and grammar mode provided within the wiki. If you face problems in running them, ask here and I would gladly solve your problems. But unfortunately, what you are asking is a GStreamer related issue and it is no longer recommended to use it with pocketsphinx.

han88 commented 7 years ago

ok thanks i apprehended that, but i tried to launch continuous.launch file (to use with a ros chatbot) and get this error :

[INFO] [1508184564.433888]: Loading the default acoustic model [INFO] [1508184564.434293]: Done loading the default acoustic model [INFO] [1508184564.434615]: Couldn't find lm argument [ERROR] [1508184564.435346]: No dictionary found. Please add an appropriate dictionary argument.

so i am not sure where and how to "add an appropriate dictionary argument" because i defined the dict and lm path in asr_test.py and kws_test.py already...

thx in advance for further help!

Pankaj-Baranwal commented 7 years ago

Follow this guide: https://medium.com/@PankajB96/okay-google-mode-in-pocketsphinx-6acdb5feafe9 It will walk you through the entire process!

han88 commented 7 years ago

thanks for the guide, got no errors anymore so i used the the cmusphinx german language model from http://goofy.zamia.org/voxforge/de/ ... the keyphrase "nein" was detected and short after the process freezes:

[INFO] [1508272678.298270]: [('nein ', -1606, 410, 435)] [INFO] [1508272678.299032]: Detected keyphrase, restarting search INFO: cmn_live.c(120): Update from < 40.00 3.00 -1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 > INFO: cmn_live.c(138): Update to < 29.50 8.61 -0.29 0.84 7.92 5.11 -5.43 0.48 1.45 9.59 -0.06 1.20 2.45 > INFO: kws_search.c(656): kws 0.38 CPU 0.083 xRT INFO: kws_search.c(658): kws 8.61 wall 1.897 xRT INSIDE

does info

INFO: cmn_live.c(138): Update to < 29.50 8.61 -0.29 0.84 7.92 5.11 -5.43 0.48 1.45 9.59 -0.06 1.20 2.45 >

mean that the accuracy is too bad for recognition because of incorrect sampling rate in alsa configuration?

Pankaj-Baranwal commented 7 years ago

Could you share with me your dictionary, kwlist and grammar files?

han88 commented 7 years ago

Hi, the package doesn't contain a grammar file... the acoustic model is " voxforge.cd_cont_6000" dictionary: /home/hannes/catkin_ws/src/pocketsphinx/germcont/etc/voxforge.dic (http://goofy.zamia.org/voxforge/de/) kwlist: /home/hannes/catkin_ws/src/pocketsphinx/sphinxgerm/cmusphinx-voxforge-de.kwlist: contains: ja /1e-1/ nein /1e-5/ test /1e-1/

asr_control stops because there is no grammar file ?: [ERROR] [1508344348.801064]: No grammar found. Please add an appropriate grammar along with gram file. [INFO] [1508344348.801535]: Stop ASRControl

Pankaj-Baranwal commented 7 years ago

Yes, asr_control if for those who need to switch from keyword spotting mode to continuous mode(grammar or lm mode). You need to add a grammar file with extension ".gram". Some sample gram files are available in the /demo folder. BTW, how do you plan on using this package? There are other simpler launch files like continuous.launch and kws.launch for specific tasks. asr.launch is only if you need to "switch" between the two modes. Create a new issue if you are facing any more problem. This issue is already resolved.