ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
30

openni_launch not working in fuerte + ubuntu precise 12.04

asked 2012-05-09 06:26:13 -0600

thebyohazard gravatar image

updated 2014-01-28 17:12:16 -0600

ngrennan gravatar image

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 ... (more)

edit retag flag offensive close merge delete

Comments

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.

Dave Coleman gravatar image Dave Coleman  ( 2012-05-09 17:14:48 -0600 )edit

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)

Martin Peris gravatar image Martin Peris  ( 2012-05-09 17:39:32 -0600 )edit

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?

Martin Peris gravatar image Martin Peris  ( 2012-05-09 17:45:08 -0600 )edit

hmm... Good find. That might be the problem. That REP was written waaay back in September 2010, though.

thebyohazard gravatar image thebyohazard  ( 2012-05-10 04:25:43 -0600 )edit

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.

thebyohazard gravatar image thebyohazard  ( 2012-05-14 11:00:04 -0600 )edit
1

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" :(

Martin Peris gravatar image Martin Peris  ( 2012-05-15 17:09:40 -0600 )edit

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.

ajc gravatar image ajc  ( 2012-05-17 18:07:39 -0600 )edit

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.

thebyohazard gravatar image thebyohazard  ( 2012-05-18 07:05:14 -0600 )edit

7 Answers

Sort by ยป oldest newest most voted
19

answered 2012-05-29 23:32:38 -0600

lubosz gravatar image

updated 2012-05-30 00:23:52 -0600

This is not a ROS bug, but an OpenNI / PrimeSense Sensor one (openni-dev 1.5.2.23 and ps-engine 5.1.0.41 Ubuntu packages).

The boost assertion error in openni_camera (ros-fuerte-openni-camera) was caused by an uncommented exception message.

nodelet: /usr/include/boost/smart_ptr/shared_ptr.hpp:412:
  boost::shared_ptr<T>::reference boost::shared_ptr<T>::operator*() const 
  [with T = xn::NodeInfo, boost::shared_ptr<T>::reference = xn::NodeInfo&]:
  Assertion `px != 0' failed.

There is an interesting comment in the area:

  // Suat: This is an ugly ASUS Xtion workaround.
  if (status == XN_STATUS_OK)
  {
  //THROW_OPENNI_EXCEPTION ("enumerating image generators failed. Reason: %s", xnGetStatusString (status));

Maybe it occurred all the time on ASUS Xtion, so it was removed. The problem is that the Kinect color nodes can not be initialized.

I wrote a patch, so the exception is thrown again. Try my openni_camera repo, if you want.

With my patch you get a nicer exception:

terminate called after throwing an instance of 'openni_wrapper::OpenNIException'
  what():  unsigned int openni_wrapper::OpenNIDriver::updateDeviceList() 
  @ openni_camera/src/openni_driver.cpp @ 118 : enumerating image generators failed. 
  Reason: Can't create any node of the requested type!

This sadly does not solve the issue. The workaround to kill the XnSensorServer, found in the PrimeSense Sensor Module (ps-engine). Sometimes I have to start XnSensorServer and close it, if the kill does not work.

$ killall XnSensorServer
$ XnSensorServer 
Starting sensor server...
Running...
^C
$

The fix could be applied to the launch script, so you just could restart the node. But there are also runtime errors. When I restart the client application there sometimes is no Kinect image, without an openni_camera crash.

Sometimes I get following exception during runtime:

terminate called after throwing an instance of 'openni_wrapper::OpenNIException'
  what():  virtual void openni_wrapper::OpenNIDevice::startImageStream() 
  @ openni_camera/src/openni_device.cpp @ 224 : 
  starting image stream failed. Reason: Xiron OS got an event timeout!

I was very unsatisfied with the OpenNI performance and looked into the Archlinux Packages openni-git and sensorkinect-git which worked like a charm.

They use the unstable git branch of OpenNI and avin2's branch of Sensor. He frequently merges PrimeSense's unstable branch, but he did not seem to got merged upstream. His work included things like blacklisting the gspca-kinect Linux module, which conflicts with OpenNi.

This is a overview of current OpenNI and Sensor versions. You can see that ROS Fuerte is in sync with master and Jochen Sprickerhof's PCL PPA is outdated. I also experienced the boost assertion with the PCL PPA version.

openni-dev:
pcl ppa      1.3.2.1
ros deb      1.5.2.23
git master   1.5.2.23
git unstable 1.5.4.0

ps-engine:
pcl ppa      5.0.3.3
ros deb      5.1.0.41
git master   5.1.0.41
git unstable 5.1.2.1
git avin2    5.1.2.1

I made Ubuntu packages of git unstable and git avin2 with checkinstall. I didn't experience the crash on these versions. I would like to make a PPA with these versions, but can't find the ros ... (more)

edit flag offensive delete link more

Comments

So I applied your patch and added code to print out the EnumerationErrors given by the enumerateProductionTrees function. It tells me a bit more info in case it helps someone: Got a timeout while waiting for a network command to complete! failed to enumerate: Image: PrimeSense/SensorV2/5.1.0.41

thebyohazard gravatar image thebyohazard  ( 2012-06-06 09:30:55 -0600 )edit

The deb's cause the new error for my Asus that no devices are detected ala kinect not detected

phil0stine gravatar image phil0stine  ( 2012-08-29 12:22:30 -0600 )edit

Thanks - that works for me - but it still doesnt sort out the warnings encountered to correctly set up the yaml files (I will have to look further in to this) and there are times when I still have to kill all and reboot - not the most elegant of solutions hoping OpenNi sorts it out for Fuerte

kleinash gravatar image kleinash  ( 2012-10-16 21:29:45 -0600 )edit
7

answered 2012-05-22 03:34:56 -0600

mgb45 gravatar image

As a workaround, I found that you can get the nodes to work again by killing the XnSensorServer process manually before you launch openni.

edit flag offensive delete link more
3

answered 2012-08-06 03:38:01 -0600

sleonard gravatar image

Just in case this can help. The error "Assertion `px != 0' failed" is also triggered if the Linux "gspca_kinect" driver is loaded. Ensure that you rmmod "gspca_main" and "gspca_kinect".

edit flag offensive delete link more

Comments

Yeah, the ros ps-engine debian package installs a kernel module conf that blacklists gspca_kinect. (/etc/modprobe.d/blacklist-psengine.conf)

jbohren gravatar image jbohren  ( 2012-08-06 03:42:24 -0600 )edit

Removing these two kernel modules worked for me. Thanks sleonard!

Advait Jain gravatar image Advait Jain  ( 2012-10-09 11:39:32 -0600 )edit
1

answered 2012-09-03 09:41:53 -0600

jkammerl gravatar image

updated 2012-09-03 09:42:27 -0600

The ros openni-dev and ps-engine packages from packages.ros.org seem to be broken. Using the debs from Jochen Sprinkerhof fixes this problem.

sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl

Installing: openni-dev 1.3.2.1-4+precise1
ps-engine 5.0.3.3-3+precise1

edit flag offensive delete link more
0

answered 2012-08-02 03:32:45 -0600

jbohren gravatar image

updated 2012-08-04 23:32:50 -0600

Over at Fawkes (www.fawkesrobotics.org), it looks like they solved the problem by running the XnSensorServer in the process itself. See this patch here:

http://git.fawkesrobotics.org/fawkes.git/commitdiff/f3e977334507333019f1230587ec0a6afea94b71

edit flag offensive delete link more

Comments

Hmm... The link isn't working for me. Is it just the latest head? Perhaps you could relink it?

thebyohazard gravatar image thebyohazard  ( 2012-08-03 09:01:59 -0600 )edit

I updated the link, for some reason there was an extra 'f' on the end.

jbohren gravatar image jbohren  ( 2012-08-04 23:33:17 -0600 )edit
-1

answered 2012-10-28 20:26:52 -0600

I think this exit code -6 means that the kinect is already in use. Try disconnecting it and reconnecting it. If that doesn't work you may need to remove the default drivers for the device. Here is a thread explaining how to do this. http://superuser.com/questions/377621/could-not-claim-interface-on-camera-6-when-trying-to-connect-usb-camera-kin

edit flag offensive delete link more

Comments

This "works", but it is not really a practical solution.

jbohren gravatar image jbohren  ( 2012-10-30 06:27:45 -0600 )edit
-2

answered 2012-05-18 07:39:03 -0600

Salvo gravatar image

Hello, I have the same problem with fuerte + ubuntu precise:

[ INFO] [1337361978.151711102]: Searching for device with index = 1
nodelet: /usr/include/boost/smart_ptr/shared_ptr.hpp:412: boost::shared_ptr<T>::reference boost::shared_ptr<T>::operator*() const [with T = xn::NodeInfo, boost::shared_ptr<T>::reference = xn::NodeInfo&]: Assertion `px != 0' failed.
[camera_nodelet_manager-2] process has died [pid 31832, exit code -6, cmd /opt/ros/fuerte/stacks/nodelet_core/nodelet/bin/nodelet manager __name:=camera_nodelet_manager __log:=/home/salvo/.ros/log/8e53190e-a10e-11e1-b6a6-f46d04509546/camera_nodelet_manager-2.log].
log file: /home/salvo/.ros/log/8e53190e-a10e-11e1-b6a6-f46d04509546/camera_nodelet_manager-2*.log

any news or ideas?

edit flag offensive delete link more

Question Tools

20 followers

Stats

Asked: 2012-05-09 06:26:13 -0600

Seen: 11,406 times

Last updated: Oct 28 '12