ros-drivers / openni2_camera

ROS wrapper for openni 2.0
http://wiki.ros.org/openni2_camera
BSD 3-Clause "New" or "Revised" License
56 stars 96 forks source link

Adding functionality to set CloseRange property #50

Open wnklmx opened 7 years ago

wnklmx commented 7 years ago

While testing the new Asus Xtion 2 (which is a great unit btw, anybody who wants more information is welcome to ask) I found out that it features a close range mode. I can toggle it in the newest version of the NiViewer and the important part of the code can be found here: https://github.com/OpenNI/OpenNI2/blob/115cf06c6efea32304182d293eca16ca883c9150/Source/Tools/NiViewer/Device.cpp#L365

It would be great to have the functionality to set this property in ROS.

There are two reasons for this: First thing is that in close range mode it is possible to see objects down to a distance between approx. 10 to 25 cm depending on the color and surface. This is a huge benefit for navigation in narrow environments. Whereas the second point is crucial for some applications: The Xtion 2 is based on TOF and not Structured Light. This introduces the problem with non explicit distance values. Today I did some testing and in normal mode at a distance of approx. 11 meters the objects (a white wall in my case) led to points directly in front of the camera. The close range mode dims the emitter so that when it is activated instead of getting wrong values I get no distance values from objects with a distance greater than 11 meters. Which surely is the better deal.