View Full Version : installing pocketshpinx and festival

06-18-2012, 03:46 PM
I'm new to ROS, trying to learn and am in the beginning stages of yet another project. No where near the first, but first involving ROS. I'm running Precise on a 64 bit HP G62 laptop. Installed Fuerte as per instructions, install went well, no errors reported and checks suggested by the install instructions all went well.

So now I'm trying to work through the tutorial here:http://www.pirobot.org/blog/0022/
but when I get to the "install ros-electric-sound-drivers" bit, I get 'can't find package. I tried substituting fuerte for electric, same same.

I did some looking around in the stacks and packages, near as I can tell sound_drivers has been deprecated in favor of audio_common, but I'm at a loss, being new to ROS (a coupla hours) how to grab and install.

Am I looking for the wrong files? Not far enough through the ROS tuts to make this obvious? missing something else?

A little shove in the right direction would be appreciated. I'd really like to get sphinx and festival up and running on my project.

regards, RIchard

06-18-2012, 06:40 PM
sudo apt-get install gstreamer0.10-pocketsphinx ros-fuerte-audio-common
svn checkout http://albany-ros-pkg.googlecode.com/svn/trunk/rharmony
rosmake pocketsphinx

I had a small problem with rosmake because the old setup script (that I should probably get rid of) was exporting ROS_ROOT as "/opt/ros/fuerte/ros" instead of the correct "/opt/ros/fuerte/share/ros" (upgraded from electric to fuerte). It all compiles and runs fine except the lack of a headset means I get garbage matches from the built-in microphone or maybe audio from the movie I am playing in the background.

06-18-2012, 07:07 PM
Thanks tician. That worked great. Well, mostly. Now I'm getting

rosmake pocketsphinx
[ rosmake ] rosmake starting...
[ rosmake ] Packages requested are: ['pocketsphinx']
[ rosmake ] Logging to directory /home/richard/.ros/rosmake/rosmake_output-20120618-200604
[ rosmake ] Expanded args ['pocketsphinx'] to:
[ rosmake ] WARNING: The following args could not be parsed as stacks or packages: ['pocketsphinx']
[ rosmake ] ERROR: No arguments could be parsed into valid package or stack names.

Any ideas?

regards, Richard

06-18-2012, 07:09 PM
I'm getting too tired to continue with this tonight. After posting my thanks and the error message, I reread your original post and saw the bit about trouble with rosmake. I'll mess with it tomorrow. thanks all, g'nite!

regards, Richard

06-18-2012, 07:18 PM
Sorry, I omitted the few lines requiring changes in the directory. Simply closing and reopening the terminal might enable the newly downloaded package to be found by rosmake (might not). I'm fairly certain the following is what I should have posted last time.

sudo apt-get install gstreamer0.10-pocketsphinx ros-fuerte-audio-common
svn checkout http://albany-ros-pkg.googlecode.com/svn/trunk/rharmony
cd ./rharmony
rosmake pocketsphinx

Then after moving back to your ros_workspace directory (where you were when you ran the last svn command):

svn checkout http://pi-robot-ros-pkg.googlecode.com/svn/trunk/pi_tutorials/pi_speech_tutorial
cd ./pi_speech_tutorial
rosmake pi_speech_tutorial

I use ~/ros_workspace, so I have "~/ros_workspace/rharmony" and "~/ros_workspace/pi_speech_tutorial", where I ran "rosmake pocketsphinx" and "rosmake pi_speech_tutorial", respectively.

The rosmake problem was of my own making and different from yours. If you never installed ros before fuerte (or followed certain ros tutorials), then you should not have the same problem I did. The actual error I experienced because of it was a failure to find "rosbuild.cmake" because the ROS_ROOT path was missing that intermediate "/share/".

06-19-2012, 02:26 PM
Hey tician, thanks for working with me on this. It's still not working, but I have more info. pocketsphinx and audio-common installs went through without reported errors. rharmony checkout went fine, checked out rev 311. (done from within ros_workspace as you directed). Now I'm getting these:

~/ros_workspace/rharmony$ rosmake pocketsphinx
[ rosmake ] rosmake starting...
[ rosmake ] Packages requested are: ['pocketsphinx']
[ rosmake ] Logging to directory /home/richard/.ros/rosmake/rosmake_output-20120619-151255
[ rosmake ] Expanded args ['pocketsphinx'] to:
[rosmake-0] Starting >>> pocketsphinx [ make ]
[ rosmake ] All 21 linesocketsphinx: 0.7 sec ] [ 1 Active 0/1 Complete ]
mkdir -p bin
cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake ..
[rosbuild] Building package pocketsphinx
Failed to invoke /opt/ros/fuerte/bin/rospack deps-manifests pocketsphinx
[rospack] Error: package/stack pocketsphinx depends on non-existent package rospy

CMake Error at /opt/ros/fuerte/share/ros/core/rosbuild/public.cmake:129 (message):

Failed to invoke rospack to get compile flags for package 'pocketsphinx'.
Look above for errors from rospack itself. Aborting. Please fix the
broken dependency!

Call Stack (most recent call first):
/opt/ros/fuerte/share/ros/core/rosbuild/public.cmake:203 (rosbuild_invoke_rospack)
CMakeLists.txt:12 (rosbuild_init)

-- Configuring incomplete, errors occurred!
[ rosmake ] Output from build of package pocketsphinx written to:
[ rosmake ] /home/richard/.ros/rosmake/rosmake_output-20120619-151255/pocketsphinx/build_output.log
[rosmake-0] Finished <<< pocketsphinx [FAIL] [ 0.78 seconds ]
[ rosmake ] Halting due to failure in package pocketsphinx.
[ rosmake ] Waiting for other threads to complete.
[ rosmake ] Results:
[ rosmake ] Built 1 packages with 1 failures.
[ rosmake ] Summary output to directory
[ rosmake ] /home/richard/.ros/rosmake/rosmake_output-20120619-151255

so I did the following checks:

locate rosdeps


locate rospy

so now I'm lost again. The build seems to need two files, rospy and rosdeps which, as I understand it are the ros python environment and dependency resolver, but it says those files aren't there, but a locate of both files shows they are. Any ideas?

regards, Richard

06-19-2012, 06:08 PM
So, I am trying to figure this out on my own (ROS noob, not total noob ;-)) and I can see why the make needs rosdep, ensuring all dependencies are met, but having trouble figuring out the rospy bit. That's a ROS specific python right?

I'm wondering if this is a path issue.

regards, Richard

06-19-2012, 07:47 PM
Did you install ros-fuerte-desktop-full using apt? Might try installing rosdep (http://ros.org/wiki/rosdep) (now a stand-alone program) and running:

roscd rharmony
rosdep check pocketsphinx

And if all is well, the output should be similar to this (gstreamer0.10-pocketsphinx already installed via apt):

All system dependencies have been satisified
ERROR[pocketsphinx]: Cannot locate rosdep definition for [gstreamer_pocketsphinx]
rosdep key : gstreamer_pocketsphinx
OS name : ubuntu
OS version : oneiric
Data: <no data>

If there are missing dependencies, it should list them and running "rosdep install pocketsphinx" should create a bash script to download everything that is missing.

The output of my attempt to build pocketsphinx (Fuerte on Xubuntu 11.10).

rosmake pocketsphinx
[ rosmake ] rosmake starting...
[ rosmake ] Packages requested are: ['pocketsphinx']
[ rosmake ] Logging to directory /home/rbom/.ros/rosmake/rosmake_output-20120619-202524
[ rosmake ] Expanded args ['pocketsphinx'] to:
[rosmake-0] Starting >>> roslang [ make ]
[rosmake-0] Finished <<< roslang No Makefile in package roslang
[rosmake-1] Starting >>> std_msgs [ make ]
[rosmake-0] Starting >>> rospy [ make ]
[rosmake-0] Finished <<< rospy No Makefile in package rospy
[rosmake-1] Finished <<< std_msgs No Makefile in package std_msgs
[rosmake-1] Starting >>> geometry_msgs [ make ]
[rosmake-1] Finished <<< geometry_msgs No Makefile in package geometry_msgs
[rosmake-1] Starting >>> std_srvs [ make ]
[rosmake-1] Finished <<< std_srvs No Makefile in package std_srvs
[rosmake-1] Starting >>> pocketsphinx [ make ]
[rosmake-1] Finished <<< pocketsphinx [PASS] [ 1.44 seconds ]
[ rosmake ] Results:
[ rosmake ] Built 6 packages with 0 failures.
[ rosmake ] Summary output to directory
[ rosmake ] /home/rbom/.ros/rosmake/rosmake_output-20120619-202524

06-19-2012, 07:51 PM
fuerte was installed using apt. watching Ghost Rider 2 with my daughter at the moment (what a ridiculously bad movie) will try this when its over and let you know.

regards, Richard

06-19-2012, 08:23 PM

Nope. getting

[email protected]:~/ros_workspace/rharmony$ rosdep check pocketsphinx
All system dependencies have been satisified
ERROR[pocketsphinx]: resource not found [rospy]
[email protected]:~/ros_workspace/rharmony$ rosdep install pocketsphinx
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
pocketsphinx: Missing resource rospy
ROS path [0]=/opt/ros/fuerte/share/ros
ROS path [1]=/home/richard/ros_workspace

I figured perhaps rospy wasn't properly installed, but can't seem to find anything in the tutorials etc. Of course, I might now be partially brain dead from watching Ghost Rider 2. Just sayin that might be a possibility....

regards, Richard

06-19-2012, 08:36 PM
So.... silly me, I figured tts would be easier, hell even microsoft makes it painless. I went to the part of the tutorial for installing and operating festival, not really happy with espeak which is what I'm running now.

rosrun sound_play soundplay_node.py
[rospack] Error: stack/package sound_play not found

I did some more poking around, Went to the ROS wiki page on "sound_play" and immediately noted that the source is the audio_common files. So a little more guidance might be helpful.

(I had a feeling when I installed fuerte instead of electric this kind of thing would happen)


06-19-2012, 08:54 PM
For the festival I tried a few things, for example

rosrun audio_common say.py "Greetings"

and suddenly my system said I don't have audio_common installed. Now I am pretty sure I did this the other night when I started this whole discussion, but hey, I'm not quite as young as I used to be, so I went into the tutorials again, installed mercurial, installed audio_common, etc etc etc. ran rosdep install. got this:

rosdep install audio_common
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
audio_capture: Missing resource roscpp
ROS path [0]=/opt/ros/fuerte/share/ros
ROS path [1]=/home/richard/audio_common
ROS path [2]=/home/richard/ros_workspace
sound_play: Missing resource rospy
ROS path [0]=/opt/ros/fuerte/share/ros
ROS path [1]=/home/richard/audio_common
ROS path [2]=/home/richard/ros_workspace
audio_play: Missing resource roscpp
ROS path [0]=/opt/ros/fuerte/share/ros
ROS path [1]=/home/richard/audio_common
ROS path [2]=/home/richard/ros_workspace

I can't decide if I should be sheepish because I'm having all this trouble (I'm not exactly a stupid guy) or pissed because this ROS system is more damned trouble than anything I've yet to run into. ANyway, I am tenacious, I reeeeeeeeeeeally want pocketshpinx running and festival too. I've half a dozen projects waiting on these to programs, so tician and anybody else listening, if you're willing to keep helping, I want to get through all these problems and get this done. I will happily write a new tutorial for the community once we get it all figured out.

regards, Richard

06-19-2012, 10:08 PM
Do you have aptitude installed? I used aptitude's text interface instead of apt-get to install "ros-fuerte-desktop-full", "ros-fuerte-clearpath-turtlebot", "gstreamer0.10-pocketsphinx", and "ros-fuerte-audio-common" on Xubuntu Oneiric ('u' for update packages lists. '/' for forward search. 'n' for repeat last search forward. 'N' for repeat last search backward. 'g' for apply changes. '?' for help). I don't remember if there were any recommended packages that I installed. I have had no problems following the tutorial other than user error with that stupid customized setup.sh that broke ROS_PATH. One caveat is that I still have electric installed. I'm going to try getting rid of it in the next few minutes and try rosmake pocketsphinx again. All else fails, make an archive back-up of your ros_workspace and start over (delete the ros_workspace and purge all ros-fuerte packages and configurations before reinstalling).

Maybe try searching answers.ros (http://answers.ros.org/questions/) for similar problems and asking there if you can't find anything. I'm running on empty and have not yet been able to find a way to break my system to reproduce your error. It's not quite as dain bramage inducing as that movie, but I've spent the day banging my head on a desk trying to 1) get a Roboard to auto-connect to a WPA2-PEAP 802.11b/g wifi network without installing a gui/desktop or breaking wired ethernet (complete and utter failure - debian 6.0.5 i486); 2) read up on SOAR; 3) set up the newer STM32F10x C library (~2011) for the spare CM-730 that I'm hoping to stick in DARSha to finally get usable odometry.

06-19-2012, 10:26 PM
Not sure why, but all of electric was marked as manually installed, so getting rid of it took a little while. Still no problems building or running anything in the tutorial, so maybe some part of ros did not install correctly or maybe some new problem introduced in Precise?

06-22-2012, 12:13 PM
Here's where I'm at. I gave up on ROS for a day or so, did a manual install of pocketsphinx in my home directory, along with sphinxbase, which I did not realize was a prereq for pocketspinx. install went well, pocketsphinx works fine, well kind of. It works, it's just untrained as of yet. I got festival installed too, and working quite well. So now I've gone back into the pi robot tutorial and tried to figure out what went wrong there. What a mess. Pocketsphinx is in rharmony, but rosmake --rosdep-install pocketsphinx just doesn't work.

rosmake --rosdep-install pocketshpinx
Usage: rosmake [options] [PACKAGE]...

rosmake: error: no such option: --rosdep-install

At this point I'm ready to give up on ros, as that seems to be where the problem lies, and just run and train sphinx by itself instead of using ros. I'm wondering if it's fuerte and/or precise that's causing the problems. I'm going to set my machine up as a dual boot with lucid and electric to test the theory. I'll let you know what I find.

regards, Richard

06-22-2012, 01:17 PM
rosrun audio_common say.py "Greetings"

This is not a valid command. Using tab completion with "audio" will produce "audio_capture", "audio_common_msgs" and "audio_play", none of which have an executable component named "say.py". The correct command is exactly as written in the tutorial. The only deviation from the tutorial should have been installing the package (via apt-get, not source) "ros-fuerte-audio-common" instead of "ros-electric-sound-drivers".

I have yet to need to install anything for ROS from source (other than non-standard packages like rharmony and pi_speech_tutorial), and installing without the pre-built packages on Ubuntu is generally discouraged (unless the program has never been added to any packages). As for windows being easier, it may be for a few stand-alone programs, but once you get into multiple dependencies (like PCL trunk to try out kinfu) I have found it to be a massive pain in my ass.

06-22-2012, 02:01 PM
1. Can't remember exactly when or why I ran that rosrun bit. I think it was a hail Mary much earlier in the process.

2. Not sure where the 'from source' piece comes from, as far as I can recall I haven't either.

3. Don't get worked up about the windows comment, I'm a dedicated Linux guy, have been for a while. The only reason I made that comment was that speech rec in Linux is just so fragmented, difficult to implement and incomplete. Note I did not say impossible. I'm obviously not afraid of difficult. That comment in particular came from playing around with the Leaf robot on my daughter's XP box for a few days. Microsoft does speech recognition much better than we do. Easy install, VERY easy training interface, pretty much a couple clicks to install and read a few texts through the training gui (which is easy to find) and it's up and running, pretty damned accurate (comparatively speaking) too.

We have Sphinx and Julius for the most part. Yes, they are toolkits, not applications. I get it. I'm just rather surprised that, with all the interest in speech rec and tts lately (thanks Siri!) that there hasn't been more progress made with either of these.

As far as my progress, I managed to forget that my machine is a dual boot with Ubuntu 12.04 as my primary and Xubuntu 11.10 as the other. I just went in to try to determine if the problem is Precise or Fuerte or me, by installing Electric in x11.10. Didn't get very far, too many broken dependencies in electric, and quite frankly I'd rather figure this out with Precise and Fuerte as they are the most recent iterations.

Having said that, I know Precise works generally well, I haven't run into any real problems with it since I did the install in April. Can you suggest a relatively easy (read not overly time consuming) test I can run fuerte through, some minor program/function, to determine if fuerte and precise do not mix, at least on my machine? I would think that if they were a bad match someone in the community would have figured it out and fixed it or at least been screaming.

regards, Richard

06-22-2012, 02:06 PM
Now I remember why I did the rosrun bit. I had gotten frustrated with sphinx and tried to do the ros install of festival. That was a "really, again?" botched attempt to piece some stuff together from the command in the original tutorial:

rosrun sound_play say.py "Greetings Humans. Take me to your leader."

As I recall I thought perhaps since sound_play had been replaced by audio_common that I might be able to just switch that part of the command. Obviously not.

regards, Richard

06-22-2012, 02:22 PM
tician, check out this thread if you would please. I'm wondering if, as you had, I'm having a path issue. I'm not quite sure what he meant by re source the file though. Can you clue me in? Did they just copy setup.sh into ros_workspace ? Not sure what's going on here, but this person is having the same problems and apparently found a solution, I just don't quite understand the solution.



06-22-2012, 05:32 PM
...did a manual install of pocketsphinx in my home directory, along with sphinxbase... seemed to me to imply that you were trying to install them from source instead of using apt. And the Windows thing was just venting a bit of frustration left over from yesterday (trying to get other kinect stuff working on a Win7 laptop), sorry about that.

In the older version of the ROS environment setup/configuration tutorial (http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment) (electric), it recommended creating a custom "setup.sh" to place in your ros_workspace and sourcing that from your ~/.bashrc file. This old script is what caused my problems when first migrating to fuerte because it overwrote the correct paths created by the "setup.sh" script in /opt/ros/fuerte. My last post initially started out as:
this is a stupid question from a stupid person, but did you add your ros_workspace to the ROS_PACKAGE_PATH environmental variable?
I had deleted that after thinking "if you were successfully able to roscd into rharmony after performing rosmake in it (which makes it findable by ros as a package), then that really is a stupid question since it would not be able to be found by ros to begin with." I had previously tested removing the ros_workspace from ROS_PACKAGE_PATH to see if "rosmake pocketsphinx" would produce the same error as you were getting, but it never did:

rosmake pocketsphinx
[ rosmake ] rosmake starting...
[ rosmake ] Packages requested are: ['pocketsphinx']
[ rosmake ] Logging to directory /home/rbom/.ros/rosmake/rosmake_output-20120622-181125
[ rosmake ] Expanded args ['pocketsphinx'] to:
[ rosmake ] WARNING: The following args could not be parsed as stacks or packages: ['pocketsphinx']
[ rosmake ] ERROR: No arguments could be parsed into valid package or stack names.

The current preferred method of setting up the ROS environment (from the Installation (http://www.ros.org/wiki/fuerte/Installation/Ubuntu) and EnvConfig (http://www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment) tutorials) is to add the following two lines to the end of your ~/.bashrc file.

source /opt/ros/fuerte/setup.bash
export ROS_PACKAGE_PATH=~/ros_workspace:$ROS_PACKAGE_PATH
The first line will call the ros-fuerte environment setup script to create or correctly modify the PYTHONPATH, PATH, CMAKE_PREFIX_PATH, and a few other environmental variables. The second line adds your ros_workspace folder to the ROS_PACKAGE_PATH allowing ros to find any custom packages in it before searching the main ros packages. There is a third line listed in the Configuring ROS tutorial that does not seem to be necessary as I have not yet bothered to add it to my ~/.bashrc and everything works fine. The old electric tutorial had the second line as "source ~/ros_workspace/setup.sh" which did more or less what the /opt/ros/fuerte/setup.sh does now, but without breaking things.

06-22-2012, 05:43 PM
Ah, now I see. The manual install part was separate from the ros install. I have pocket sphinx and festival installed on my system and working properly irregardless of ros, and that install of sphinx was the manual install to which I referred. Quite frankly, I can do what I want to do at the moment without ros, I've just been intrigued for a while now about ros, I thought I'd play with it for a bit and see what there is to be seen. All the ros install stuff has been iaw the tutorials and your helpful guidance.

I have a sneaking suspicion (as I believe I mentioned before) that the problem is in my path(s) definition. I'll check the bashrc file after supper and check for the listed lines. Thanks!

So you see, what started as "hmmmm, that looks interesting, I think I'll check it out." has now become "(INSERT FAVORITE EXPLETIVE HERE) this thing isn't going to beat ME! I'll figure it out if it bloody well kills me!!" Followed by the usual maniacal laughter and hidden tears. My wife is not pleased, my daughter thinks this is all quite funny.

regards, Richard

06-22-2012, 07:03 PM
found a couple errors in my bashrc file. Here's what I had

source /opt/ros/fuerte/setup.bash
export ROS_PACKAGE_PATH=~/ros_workspace:ROS_PACKAGE_PATH
export ROS_WORKSPACE=~ros_workspace

Note that the $ is missing in front of ROS_PACKAGE_PATH on line 2 and the / is missing in front of ros_workspace on line 3. Used gedit and fixed those, still not working. I keep getting:

~/ros_workspace$ rosmake --rosdep-install pocketsphinx
Usage: rosmake [options] [PACKAGE]...

rosmake: error: no such option: --rosdep-install

checked the rosdep help file,:

rosdep install <stacks-and-packages>...
generate a bash script and then execute it.

so I said, hmmmmm maybe all the little dashes aren't supposed to be in there. No such luck.

So then I

~/ros_workspace$ rosdep check pocketsphinx
All system dependencies have been satisified
ERROR[pocketsphinx]: resource not found [rospy]

so all my dependencies have been met, but still no rospy.

bloody cretinous program

regards, Richard

06-22-2012, 07:11 PM
So I figured I'd read more. Started digging through the tutorials. Didn't work. But it did. I can't roscd into roscpp, but I can into rharmony.

[email protected]:~$ roscd roscpp
roscd: No such package/stack 'roscpp'
[email protected]:~$ roscd rharmony
[email protected]:~/ros_workspace/rharmony$

Do I have a bad install here? Is that maybe why I'm having so much trouble?

regards, Richard

06-22-2012, 07:16 PM
it's a path thing. Should I remove fuerte and do a fresh install?

[email protected]:~$ roscd
bash: cd: ~ros_workspace: No such file or directory

according to the tutorials that should take me into my ros_workspace

I am so freakin lost.

regards, Richard

06-22-2012, 08:30 PM
I have never been able to roscd into a newly downloaded package (svn, git, etc.) until after it has been compiled with rosmake. Newly created packages (via roscreate-pkg) will be found immediately if it is created in a sub-directory of any listed in the ROS_PACKAGE_PATH variable. Only packages and stacks can be found by roscd. Your ros_workspace folder is not a package. It is just a directory to store ros packages and stacks. It will not be found by roscd, but the stacks and packages in it will.

I thought I had mentioned it earlier, but it must have been in one of my deleted drafts: "--rosdep-install" is no longer a valid argument for rosmake (removed in fuerte since rosdep is now an independent program).

Pre-tutorial checks:
Create your ros workspace:

mkdir ~/ros_workspace

Setup your ros environment (add to ~/.bashrc):

source /opt/ros/fuerte/setup.sh
export ROS_PACKAGE_PATH=~/ros_workspace:$ROS_PACKAGE_PATH

The pi_speech_tutorial for fuerte:

Installing rharmony/pocketsphinx and pi_speech_tutorial packages:

sudo apt-get install gstreamer0.10-pocketsphinx ros-fuerte-audio-common
cd ~/ros_workspace
svn checkout http://albany-ros-pkg.googlecode.com/svn/trunk/rharmony
cd ./rharmony
rosmake pocketsphinx
cd ../
svn checkout http://pi-robot-ros-pkg.googlecode.com/svn/trunk/pi_tutorials/pi_speech_tutorial
cd ./pi_speech_tutorial
rosmake pi_speech_tutorial

Using pocketsphinx (from any directory after compiled) (each code block in a new terminal):


roslaunch pocketsphinx robocup.launch

rostopic echo /recognizer/output

Installing Festival:

sudo apt-get install ros-fuerte-audio-common

Using Festival (each code block in a new terminal):


rosrun sound_play soundplay_node.py

rosrun sound_play say.py "Greetings Humans. Take me to your leader."

The rest of the commands should work exactly as written on the tutorial page.

06-22-2012, 09:47 PM
And now it works quite nicely. I was trying to do make with the old command, didn't know about the change. Having said that I NEVER would have figured out to run three different terminals. How the hell did you know that?

Now I'm off to train the Sphinx and figure out how to integrate ROS, Festival and Sphinx with the PyAIML bot I've been playing with. the fun never ends. Methinks I'll spend the next day or two in the ROS tutorials.

Thanks for all the help tician. Really. Thank you very much.

regards, Richard

06-23-2012, 12:58 PM
ROS Tutorials (http://www.ros.org/wiki/ROS/Tutorials)

Specifically: #5 - Understanding ROS Nodes (http://www.ros.org/wiki/ROS/Tutorials/UnderstandingNodes)

Open up a new terminal, let's use rosnode to see what running roscore did...
and numerous other times in the later tutorials, especially the turtlesim examples in #6 and #7.

And I had removed the "--rosdep-install" from the commands when I posted my first replies, but I guess I should have explicitly stated that the option had been removed.

06-28-2012, 03:27 PM
Crap. Now I'm having trouble getting pocketsphinx running. Installed Xubuntu-12.04 on the new laptop for darsha using wubi (because non-harddrive booting is locked off by IT), installed ros like I did on my netbook (xubuntu-11.10), ran rosmake pocketsphinx without error, but when I try "roslaunch pocketsphinx robocup.launch" I get this:

started roslaunch server http://ubuntu:42880/


* /recognizer/dict
* /recognizer/lm
* /rosdistro
* /rosversion

recognizer (pocketsphinx/recognizer.py)


core service [/rosout] found
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[recognizer-1]: started with pid [3105]
Traceback (most recent call last):
File "/home/darsha/ros_workspace/rharmony/pocketsphinx/nodes/recognizer.py", line 122, in <module>
r = recognizer()
File "/home/darsha/ros_workspace/rharmony/pocketsphinx/nodes/recognizer.py", line 47, in __init__
+ '! pocketsphinx name=asr ! fakesink')
glib.GError: no element "gconfaudiosrc"
Traceback (most recent call last):
File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/core.py", line 477, in signal_shutdown
File "/home/darsha/ros_workspace/rharmony/pocketsphinx/nodes/recognizer.py", line 76, in shutdown
RuntimeError: called outside of a mainloop
[recognizer-1] process has died [pid 3105, exit code 1, cmd /home/darsha/ros_workspace/rharmony/pocketsphinx/nodes/recognizer.py __name:=recognizer __log:=/home/darsha/.ros/log/14b72fb8-c152-11e1-b431-446d57812594/recognizer-1.log].
log file: /home/darsha/.ros/log/14b72fb8-c152-11e1-b431-446d57812594/recognizer-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete

I know the dummy thread error is not a problem (get the same error twice when starting roscore which does work) and a fix is supposed to be somewhere upstream (do not get the error with 11.10). Running "rosdep check pocketsphinx" says all dependencies satisfied, and gives me the same error "Cannot locate rosdep definition for [gstreamer_pocketsphinx]" as the netbook which does work. Any ideas?

06-28-2012, 04:01 PM
Not ... even ... a ... little ... clue.

Well, maybe a few little ones. When I first started with ubuntu a coupla years ago, I started out using wubi and had LOTS of problems. Lots and LOTS. Just when everything seemed fine, something that was supposed to work wouldn't. Never heard anything good about wubi other than Stay Away! YMMV, So that's idea the first, might be a problem with your install.

Idea the second, maybe the X system is giving you trouble (Xubuntu vs straight ubuntu). I have heard of it happening, but not much, and truly it shouldn't. We're talking almost zero difference other than desktop interface, you X, me (sadly) Unity (although they do seem to have gotten rid of most of the bugs now. It was a disaster at first).

And finally, the longest shot, some compatibility or driver issue with the new machine? Happened to my son, couldn't run Ubuntu, machine was too new, not well supported yet. I cna't rememeber, either couldn't get sound working or video working properly, something important enough that he went back to windows and is waiting for a fix. Might be a hardware compatibility issue if it's a brand new machine????

Those are wafg's (figure the acronym out for yourself) as once I got my head wrapped around your modifications to pi-robot mine works fine (in Ubuntu 12.04 on a 2-ish year old 64 bit HP). Hey, now that I think of it, there's something to check. Is everybody playing in the same sandbox(32 or 64 bit)?

Anyway, my pocketshinx is functional, no runs, no drips, no errors. Doesn't listen worth a damn, and the tutorials at CMU Sphinx are for shyte, but it does work. Today has mostly been spent going through the ROS tutorials and trying to figure out how to get sphinx trained (not the one in ROS, but they are the same program). I can't get past the Accumulating observation counts bit, and the training from pi-robot just isn't enough. Mine's running with maybe 8-10% accuracy right now.

Anyway, bearing in mind you're the experienced and probably smarter part of this pair, I'll keep looking around and see what I can find for your dilemma.

regards, Richard

06-28-2012, 07:05 PM
I've gotten pretty decent recognition from pocketsphinx on the netbook - assuming I keep my head in the right orientation to the internal mic and speak with the correct volume. It does seem to have a bit of trouble with "stop" as it almost always thinks I said "go", which is an accident waiting to happen. Ordered a bluetooth headset and a bt dongle, so hopefully I will get better recognition while simultaneously looking less ridiculous trying to get it working (it is the hunching over the laptop, not the talking to myself. I already talk to myself at great lengths - usually insults). Also going to try to make the control node for the bot use festival or espeak to repeat the phrase pocketsphinx identified back over the headset for me to confirm/cancel prior to actually performing any action. Have not tried training it yet, but I'm still kind of surprised how accurate it has been given how poorly I enunciate (mumble grumble...).

The netbook is running Xfce (Xubuntu 11.10 64-bit) already, so it should not be a Xubuntu vs Ubuntu issue*. Everything installs and runs fine so far except for the pocketsphinx ros package, which is still better than Win7 64-bit being unable to find the microphone array and not supporting multi-touch. I actually thought it was just a cheap resistive touchpad without multi-touch before I got Linux running on the laptop. Unfortunately it probably is wubi causing problems, but I don't really have much of a choice without getting IT involved. I'm going to install 12.04 onto an SD card and tomorrow try using the wubi installed grub to boot from the card. If that doesn't work, then given the hardware issues Win7 is having, it might not be that big a deal to get IT to repartition the drive for a true dual-boot (or joy of joys, just wipe all MS off it since I would much rather not keep dealing with Windows for this project).

*How I loathe Unity - perhaps as much as Windows Vista/7. I very much prefer my OS treating me as if I were hyper-competent while actually being mildly incompetent (but willing to find the answers), rather than being mildly competent while it treats me like I couldn't find my own butt with both hands, a map, and a torch.

06-28-2012, 07:26 PM
I've actually got my pocketsphinx working pretty well now too. Definitely needs some training though. I'm working my way through that. CMU makes sphinx WAY too difficult.

As far as unity, I HATED it when it first came out. I stuck with Maverick (which was, imho, the best they've ever done) until they dropped support for it. Tried xubuntu, kinda liked it, but kinda not. Tried unity again when Oneiric came out, still not great but I got used to it. In one respect unity was good for me. I working my way around the dumbing down part, I've gone almost exclusively to command line ops, which is way cool, and a steep learning curve, but I'm able to do so much more now.

Anyway, back to your problem, so if I understand you aright, IT has it buggered so you can't run or load from either a usb or a disk??? Have you died and gone to Hel??? If you can figure a way to do it without wubi, methinks you'd be okay, if not, well, I'd hafta say yer snookered. I spent some time looking around for some answers in an attempt to be a help, but unfortunately I got nothing other than wubi.

Off to try to figure out Sphinx training. And THEN :-))))))) learn more Lisp.

Yes. I'm serious. There's a master plan.

regards, Richard

06-28-2012, 09:12 PM
Very Large University with lots of Dells. They used the BIOS's security/password protection to allow booting only from the internal hard-disk (I can see this being very useful on the public PC's, but not so much with individual research lab PC's and laptops). They are not BOFH's, but they are still a bit possessive per university policy (almost everything over ~$300 is tagged with a barcode, even the darwin's). Fortunately, the fitpc2i-sbc's in the DARwIn-OP's are not controlled by IT and never will be.

The default install of Xubuntu rather annoys me, but it suits me well enough after removing several of the default programs (leafpad, parole, ubuntu software center, update center/notifier, etc.) and replacing them with VLC, gedit, Gnome System Monitor, aptitude, and a butt-load of dev tools. I've tried several distros (Puppy-Linux, DSL, Debian) and several flavors of Ubuntu (still hate Unity and KDE is bleh), but so far Xubuntu has been the least troublesome in keeping up-to-date while successfully customizing to my semi-minimalist taste. I do get the occasional tinge of nostalgia for fluxbox, so I may play with that again.

06-29-2012, 12:34 PM
I also settled on xubuntu as the least annoying of the Linuxes. (I even tried Gentoo at one point -- eek!)
But for my robot itself, I'm using Arch, and it's actually gotten to be pretty good!

06-29-2012, 02:10 PM
Why Arch?

Taught the AIML.bot to learn and retain today, now cleaning all the AIML files to make a corpus for sphinx training. Python is such a joy to work with!

regards, Richard

06-30-2012, 12:41 PM
So, am I missing something with ROS? Have I just not gotten far enough in the tutorials? Let's say I have festival tts, sphinx stt and a chatbot written in python with full on AIML files, a learning function and a growing list of capabilites (I have installed or written all of those). I was under the impression that ROS was a framework to tie all that kind of stuff together as well as a grunch of libraries to add functionality, such as interface with arduino (I would like to) for sensor input and movement. I just can't seem to wrap my head around ROS. Let's pretend I'm a complete idiot (no, I'm not). Can you tician (or anyone for that matter) give me a quick morons overview of ROS, the tutorials, while I understand and have able to reproduce everything so far (except for pinging my_turtle for some reason) just aren't giving me the big picture.

Progressing nicely with individual bits but not integration, Richard

06-30-2012, 11:43 PM
I still don't think I can explain it much better than the ros wiki (http://www.ros.org/wiki/ROS/Introduction).

You start a 'roscore' process in one terminal and only one instance of it should ever be running at one time. If that single instance of roscore goes down, then everything stops because no node will know how to communicate with any other without roscore running. Each and every subsequent node launched requires its own terminal tab/window. If you want to do a "rostopic echo" for any topic published by a node, you must keep that pre-existing node running in its own terminal. Think of it a bit as though every node is running on a separate computer on a network (entirely possible to do (http://www.ros.org/wiki/ROS/Tutorials/MultipleMachines)). If one node/computer goes down, none of the others will be able to interact with it (subscribe to its topics or use its services).

rospy and roscpp are libraries to allow your program/node to communicate with any other ros node by subscribing/publishing to topics and/or using node services.

As an example, controlling a mobile base using voice control:
0) start roscore
1) create a sphinx node to publish recognized text as a string message on a topic (e.g. '/text_cmd');
2) create a command interpreter node to subscribe to the '/text_cmd' topic, filter the received text for valid commands, and convert the commands into a desired base movement command (in the simplest form it is a 'geometry_msgs/Twist' message usually published on the topic '/cmd_vel');
3) create a base controller node to subscribe to the '/cmd_vel' topic and convert the desired movement (usually X/Y translation and Z rotation) into commands specific to the robot's motor controller(s) either through direct control of a serial port (as I did for DARSha) or by publishing to another topic to which the low-level robot motor/base controller is subscribing (such as the arbotix node);

Using the ros navigation stack would require a few more steps which I still have not tested yet (messing with navigation is pointless until I get decent odometry from the base controller), but the process is documented on the ros wiki (http://www.ros.org/wiki/navigation/Tutorials/RobotSetup).