openni_launch works only the first time
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?
Sounds like the driver is getting hung and not shutting down. Can you tell if that node is still running after the first invocation?