openni_launch not working in fuerte + ubuntu precise 12.04
EDIT 4: I tried launching the driver on a fresh install of fuerte on a fresh install of precise, following all ros install instructions to the letter. Still get the same error. And I tried this on two different machines.
I've tried different versions of openni since they just updated the unstable branch with lots of bug fixes, but I couldn't get it to work. The latest stable branch and the last stable branch before that didn't work, either. They either get rid of the assertion error then don't recognize the device or they don't install at all. Reinstalling the openni-dev prebuilt package brings back the assertion error.
So, @ajc made a good suggestion that something gets changed somewhere since it starts the first time but stops working subsequent times. I'm thinking in a config file, but I tried deleting the two ros config files in /opt/ros/fuerte/stacks/openni_camera/cfg and it still complained the same way. I'd try changing some of the openni config files, but messing with the different versions of openni made some duplicate directories on my machine, and I don't quite know what's what. Somebody might try playing with the files in /etc/openni or /etc/ni (I'm not sure which you'll have, but FWIW, rosmake uses */openni directories when I build openni_camera on my computer).
It also appears I gave some bad intel before. This, this, and this all say the assertion error means that a boost pointer was not initialized somewhere (rather than the error being a header file conflict).
So I'm wondering if this might be a bug in the code rather something we're doing wrong with dependencies or installation. I can't verify this, as I'm unsure how to use nodelets with gdb. If this does warrant a bug report, should it be to ros or openni?
EDIT 3: The problem definitely has something to do with openni. The xn namespace that the error involves in an openni namespace. I finally got images published (!) but only for two runs just like @Martin Peris. Here's the details:
Openni is now a system dependency in fuerte, so I figured I'd reinstall it from the version on their website. (If you do that, note that mono was not optional for me as it says in the readme.)
After installing openni and running openni.launch, I didn't get any fatal errors, (the only errors were that a service was already advertised) but the kinect wasn't being recognized by the driver. It just kept spitting out
No devices connected.... waiting for devices to be connected
lsusb showed the kinect fine.
So according to somebody on this thread I reinstalled openni-dev and libusb-1.0-0-dev. The next time I ran the driver, it worked and showed the depth image in rviz! However, I couldn't switch to a color image.
So I restarted the driver, and the color showed ...
Same issue here, roslaunch openni_launch openni.launch is throwing a lot of errors on Ubuntu 10.10 with Fuerte, and in Electric everything worked fine.
I get the same issue on precise + fuerte, but it is odd because the first time I executed roslaunch openni_launch openni.launch, it worked! Then it crashed and get the same error as in this post ever since. (Sorry I can not provide more info about the crash)
According to http://www.ros.org/reps/rep-0003.html#fuerte-turtle-mar-2012 fuerte uses boost 1.40, precise comes with boost 1.46.1. Maybe is that the source of the error?
hmm... Good find. That might be the problem. That REP was written waaay back in September 2010, though.
In case anybody's still trying to figure this out, it's not a problem with the already advertised services. That's just an annoying bug.
Hi tbh, I found a workaround to the annoying bug that you mentioned http://answers.ros.org/question/12244/complaint-from-openni_launch-on-already-advertised but still no luck with the "Assertion `px != 0' failed" :(
I like the explaination of it being a boost library misconfiguration, but this doesn't seem to explain the fact that openni_launch works the first time I run it, but doesn't work subsequent launches. My suspicion is thus that this is related to unclean shutdown, but can't see where code changed.
I don't know about boost being the culprit any more. I did a fresh install of precise and fuerte on 2 different machines & got the same error on both. They were both using boost 1.46. The kinect works fine on the exact same computer in windows so it's not the kinect, either.