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

openni_launch works only the first time

asked 2012-07-18 00:18:21 -0600

rastaxe gravatar image

updated 2016-10-24 09:02:11 -0600

ngrennan gravatar image

I am using fuerte on Ubuntu 12.04 with a Kinect. I have noted that openni_launch works only the first time. When it works, on the terminal I have:

roslaunch openni_launch openni.launch  
[...]   
[ INFO] [1342603480.398058817]: Initializing nodelet with 6 worker threads.  
[ERROR] [1342603484.926529464]: Tried to advertise a service that is already advertised in this node [/camera/depth_registered/image_rect_raw/compressed/set_parameters]  
[ERROR] [1342603484.943879879]: Tried to advertise a service that is already advertised in this node [/camera/depth_registered/image_rect_raw/theora/set_parameters]  
[ INFO] [1342603487.444944913]: Number devices connected: 1  
[ INFO] [1342603487.445153962]: 1. device on bus 002:06 is a Xbox NUI Camera (2ae) from Microsoft (45e) with serial id 'A00364A09534141A'  
[ INFO] [1342603487.446153737]: Searching for device with index = 1  
[ INFO] [1342603487.520744291]: Opened 'Xbox NUI Camera' on bus 2:6 with serial number 'A00364A09534141A'  
[ INFO] [1342603487.556152646]: rgb_frame_id = '/camera_rgb_optical_frame'   
[ INFO] [1342603487.556216539]: depth_frame_id= '/camera_depth_optical_frame'   
[ WARN] [1342603487.563057732]: Camera calibration file /home/ale/.ros/camera_info/rgb_A00364A09534141A.yaml not found.  
[ WARN] [1342603487.563112210]: Using default parameters for RGB camera calibration.  [ WARN] [1342603487.563158568]: Camera calibration file /home/ale/.ros/camera_info/depth_A00364A09534141A.yaml not found.  
[ WARN] [1342603487.563200355]: Using default parameters for IR camera calibration.

Despite the errors it works. If I close the program and I restart openni_launch, I have:

[...]

[ERROR] [1342602671.015884628]: Tried to advertise a service that is already advertised in this node [/camera/depth_registered/image_rect_raw/compressed/set_parameters]                       
[ERROR] [1342602671.031949234]: Tried to advertise a service that is already advertised in this node [/camera/depth_registered/image_rect_raw/theora/set_parameters]                       
[ INFO] [1342602678.285143378]: Number devices connected: 1           
[ INFO] [1342602678.285292312]: 1. device on bus 002:11 is a Xbox NUI Camera (2ae) from Microsoft (45e) with serial id 'A00364A09534141A'     
[ INFO] [1342602678.286667631]: 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 14263, exit code -6, cmd /opt/ros /fuerte/stacks/nodelet_core/nodelet/bin/nodelet manager __name:=camera_nodelet_manager __log:=/home/ale/.ros/log/8292bcc6-d0b8-11e1-b766-c860005fdc27/camera_nodelet_manager-2.log].
log file: /home/ale/.ros/log/8292bcc6-d0b8-11e1-b766-c860005fdc27/camera_nodelet_manager-2*.log

The line "Initializing nodelet with 6 worker threads." is missing and the program crashes. In this case, if I use some programs from libfreenect such as "cppview" or "tiltdemo", kinect works. The only thing that I can do to reuse openni is to restart the pc! Maybe it is a sort of ros initialization problem, I do not know. I noted also that the first time, openni_launch takes some seconds more to start up, it waits a little bit more on the line:

*Checking log directory for disk usage. This may take awhile.                 
Press Ctrl-C to interrupt*

Someone can help me?

edit retag flag offensive close merge delete

Comments

Sounds like the driver is getting hung and not shutting down. Can you tell if that node is still running after the first invocation?

joq gravatar image joq  ( 2012-07-18 03:55:25 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted
5

answered 2012-07-18 22:55:53 -0600

rastaxe gravatar image

Ok, I found the problem. It seems that openni does not shut down properly. The XnSensorServer program still runs. If I kill the process then openni opens Kinect properly. I found other posts about that on pcl and openNI forum, so I think that it would be useful to add this tip to the wiki. Thanks joq for the suggestion.

edit flag offensive delete link more

Comments

1

Here's a ticket to keep track of this: https://kforge.ros.org/openni/trac/ticket/55

jbohren gravatar image jbohren  ( 2012-07-23 06:15:44 -0600 )edit
1

Hack attached to ticket

I Heart Robotics gravatar image I Heart Robotics  ( 2012-08-14 20:20:57 -0600 )edit
1

And here's another hack, that you can add to a kinect launchfile: https://bitbucket.org/jbohren/xnsensorserver-hack/src

jbohren gravatar image jbohren  ( 2012-08-14 20:57:07 -0600 )edit

There are quite a few other threads discussing this same issue in case that helps the ticket: threadA and threadB

thebyohazard gravatar image thebyohazard  ( 2012-10-11 07:30:18 -0600 )edit
1

answered 2012-10-11 03:54:16 -0600

kleinash gravatar image

updated 2015-01-30 03:05:08 -0600

The only answer I found that worked for this was to run:

killall -s 9 XnSensorServer

before you rerun the openni_launch - this still does not solve all the other warnings but it does help not having to restart your entire system to get it running again..

edit flag offensive delete link more
0

answered 2012-10-11 08:52:43 -0600

jkammerl gravatar image

One workaround to this proble is to downgrade openni and the sensor drivers. Have a look at Jochen's launchpad. His openni debians do work under precise.

https://launchpad.net/~v-launchpad-jochen-sprickerhof-de

edit flag offensive delete link more

Comments

or upgrade.. I found this error went away with hydro..

kleinash gravatar image kleinash  ( 2014-06-02 08:28:02 -0600 )edit

Question Tools

Stats

Asked: 2012-07-18 00:18:21 -0600

Seen: 2,971 times

Last updated: Jan 30 '15