Rosanswers logo

Hi, i have two working places (office and home).

Office: When i try to display depth images from the kinect with rviz, everything is ok. I switch between depth images and registered depth images with dynamic_reconfigure.

Home: Depth image is normal. The registered depth image is black. The status in rvis is OK. The amount if images rises. When i try to display the data in C++ (cout << image), every pixel is NAN (not a number).

I use (of course) another pc and another kinect at the two working places. The OS (Ubuntu 12.04 (precise)), ROS (rosversion ros 1.8.10) and all used programms should be the same (i'm not shure).

I tried to find some difference between the both systems -> unsuccessful. Any ideas?

Thanks Sebastian

Originally posted by sebastianKrabben on ROS Answers with karma: 51 on 2013-01-30

Post score: 5

Original comments

Comment by dinamex on 2013-01-30:
which kind of USB Bus are you using? There are still problems with USB3.0

Comment by felix k on 2013-01-30:
We got the same black depth (or other confusing silent errors) with enabled registration since the last openni update, too..

Comment by sebastianKrabben on 2013-01-30:
I use USB 2

Comment by georgebrindeiro on 2013-01-31:
Similar issue: http://answers.ros.org/question/53779/nan-values-published-in-point-clouds-depth_registered-with-new-openni_camera-and-openni_launch

Comment by georgebrindeiro on 2013-01-31:
Similar issue: http://answers.ros.org/question/36997/deprecated-kinect-driver-superior-to-the-new-one/

Comment by georgebrindeiro on 2013-01-31:
I have seen this around a lot and experienced it myself, I guess we can confirm it is an OpenNI bug. I think we should all go to the OpenNI community and report that bug. We can start supporting this question: http://gsfn.us/t/3krs6


3 Answers 3


Rosanswers logo

But the problem it is that if you turn off that variable the point cloud is not a correct one because the depth and the rgb information is not in the same reference frame! As you can see in one of the topicis you said that they talk about the same topics!

Edit 2

I made it work finally, i don't know whether it will work for you. What i did, was uninstall openni_camera, openni_launch, libopenni-dev and install agian openni and kinect sensor as follows:

To install openni

$ mkdir ~/kinect 
$ cd ~/kinect
$ git clone https://github.com/OpenNI/OpenNI.git -b unstable
$ cd OpenNI/Platform/Linux/CreateRedist
$ bash RedistMaker
$ cd ../Redist/OpenNI-Bin-Dev-Linux-x86*/
$ sudo ./install.sh

To install kinect sensor

$ cd ~/kinect
$ git clone https://github.com/avin2/SensorKinect
$ cd SensorKinect/Platform/Linux/CreateRedist
$ bash RedistMaker
$ cd ../Redist/Sensor-Bin-Linux-x86*
$ sudo sh install.sh

Once, i installed this, i installed back openni_camera and openni_launch. This worked for me, i hope it works for you all too!

Originally posted by anto1389 with karma: 106 on 2013-01-31

This answer was ACCEPTED on the original site

Post score: 6

Original comments

Comment by georgebrindeiro on 2013-02-01:
For some reason, it is working OK for me now. Maybe it was a recent update... It was very enlightening to read the documentation about depth_registration, though: http://www.ros.org/wiki/openni_launch#Registration

Comment by sebastianKrabben on 2013-02-02:
I tried to install openni and kinect sensor manually, but i get errors during "bash RedistMaker": ...javac: not found make[1]: *** [../../../Bin/x86-Release/org.OpenNI.jar] Error 127 make: *** [Wrappers/OpenNI.java] Error 2...Building Failed! (openjdk is installed on my pc!!!)

Comment by stfn on 2013-02-20:
This did resolve the problem for me too, along with some downsides: http://answers.ros.org/question/55513

Comment by Lucile on 2013-06-11:
Hi ! i know it hasn't been updated for a long time, but if anyone runs through the same issue as sebastian, it can be solved by installing javac : sudo apt-get install openjdk-7-jdk is the right command for Ubuntu

Comment by Blizzard on 2013-08-29:
After three frustrating days of trying to make depth registration work i finally found your post. Now it works. Thank you! Thank you! Thank you! (I'm using Kubuntu 12.04.2 lts 64 bit and ROS fuerte)

Comment by GioRos on 2013-09-22:
Hi, i followed george steps but now when i roslaunch openni_launch openni_launch i get: [ INFO] [1379865586.935153519]: No devices connected.... waiting for devices to be connected ........ ........ Before openni could find my kinect...what i'm missing?? Please help me. thanks (Ubuntu 12.04 ROS fuerte) Here is my lsusb command: Bus 001 Device 025: ID 045e:02c2 Microsoft Corp. Bus 001 Device 026: ID 045e:02ad Microsoft Corp. Xbox NUI Audio Bus 001 Device 028: ID 045e:02ae Microsoft Corp. Xbox NUI Camera So kinect is found by pc!! Thanks.

Comment by georgebrindeiro on 2013-09-23:
@GioROS: Have you blacklisted or otherwise removed the gspca_kinect module? Have you tried installing avin2's SensorKinect module for OpenNI?

Comment by GioRos on 2013-09-23:
Thank for reply. If i type rmmod gspca_kinect i get "Module gspca_kinect does not exist in /proc/modules";However gspca_kinect blaklisted but again no device connetted...! here is what i did: sudo apt-remove openni_camera, openni_launch, libopenni-dev. Then followed your guide to install openni & avin2 kinect sensor. Then sudo apt-get install openni_camera, openni_launch.

Comment by GioRos on 2013-09-25:
No dice. I read all posts but no solution found yet. It seems the only way is to reinstall the entire Ubuntu:... Obviously not acceptable..!! but If i did a fresh install , could i encounter the same issue? Someone might give me any advise?!i'm stuck and I can't go on with my project....! thanks

Comment by georgebrindeiro on 2013-09-25:
I would try removing everything related to ROS and OpenNI first and reinstalling first. By the way, what kind of computer are you using? I have had issues with OpenNI in older computers at times...

Comment by GioRos on 2013-09-25:
I use MacBook unibody late 2008 Ubuntu 12.04 partitioned. Is there a single command to remove ROS and OpenNI??But after reinstalling ROS and openni what should i do if i get the same issue related to registered-depth-image??If i followed again your steps above, could i end up in the same situation of today? Thanks

Comment by georgebrindeiro on 2013-09-25:
I wish I knew the answer to your questions, every now and again I run into the same issues with getting my Kinects to work in ROS. Things get updated often and, at times, get broken for a subset of the users. Good luck, though.

Comment by GioRos on 2013-09-27:
Thanks. If it can help...I switched to hydro and now registered depth works. bye

Comment by KevinNickels on 2013-10-01:
Thanks - this fixed registered depth for me on Ubuntu 12.04 with groovy. With depth_registration off, I get unregistered points, but now with dept_registration on, I get registered points (instead of blank/NaN).

BTW, I did not have to uninstall/reinstall openni_* packages!

Comment by slamzxp on 2013-12-04:
@GioRos I encountered the same problem as yours, I guess there was something wrong during the first installation ---"sudo sh install.sh". I made it work finally after I tried to install kinect sensor again as the above method. BTW,unplug the usb. I hope it helps.

Comment by Rasoul on 2013-12-30:
I just tried this method, but I receive the following error at the end of bash RedistMaker job in SensorKinect folder: cp: cannot stat ../Bin/x86-Release/libXnDeviceSensorV2KM.*': No such file or directory`. Any idea?


Rosanswers logo

Apparently the newest version of OpenNI has a bug where, in ROS:

  1. Point clouds are available in /camera/depth_registered/points even if the depth_registration flag is off.

  2. When the depth_registration flag is off, the clouds do not seem depth registered.

  3. When the depth_registration flag is on, the point clouds and the corresponding depth image are filled with NaN values.

That may be a bug in the latest version of OpenNI or an incompatibility between the latest version and ROS. I haven't seen any reports of people having this problem outside of ROS, but that may be just because I haven't looked enough.

Originally posted by georgebrindeiro with karma: 1264 on 2013-01-31

This answer was NOT ACCEPTED on the original site

Post score: 4


Rosanswers logo

This is likely a bug on the implementation, i'v open a issue ticket on github, and i sugest that if you have the same problem to do the same (in my ticket or in another).

Here it is: https://github.com/ros-drivers/openni_camera/issues/13

Originally posted by jcc with karma: 200 on 2013-04-15

This answer was NOT ACCEPTED on the original site

Post score: 1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.