[WIN]I can only got access to the kinect a few times out of 20 times attempts

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[WIN]I can only got access to the kinect a few times out of 20 times attempts

justin1230
I am on win10 and using the kinect v2 for RTAB-Map with the use of Usbdk1.0.12.
The log always show "found valid kinect v2" and "found one devices", but it just stay freeze for few minutes and said "camera initialization failed".
I can only successfully connect a few times and most of the time it freeze and failed to connect.
Reply | Threaded
Open this post in threaded view
|

Re: [WIN]I can only got access to the kinect a few times out of 20 times attempts

justin1230
It happens with the following errors:
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 6 usb devices connected
Driver file operation error. DeviceIoControl failed (The device is not connected. Error code = 1167)
[Error] [Freenect2Impl] failed to open Kinect v2: @4:2 LIBUSB_ERROR_OTHER Other error
[Info] [Freenect2Impl] found 0 devices
[Error] [Freenect2Impl] requested device 0 is not connected!
[ERROR] (2017-10-11 17:08:25) CameraRGBD.cpp:1551::rtabmap::CameraFreenect2::init() CameraFreenect2: no device connected or failure opening the default one! Note that rtabmap should link on libusb of libfreenect2. Tip, before starting rtabmap: "$ export LD_LIBRARY_PATH=~/libfreenect2/depends/libusb/lib:$LD_LIBRARY_PATH"
[ WARN] (2017-10-11 17:08:25) PreferencesDialog.cpp:4980::rtabmap::PreferencesDialog::createCamera() init camera failed...
Reply | Threaded
Open this post in threaded view
|

Re: [WIN]I can only got access to the kinect a few times out of 20 times attempts

justin1230
note that I use libfreenect2-0.2.0-usbdk-vs2014-x64
and I can connect to kinect 2 with Protonect.exee all the time.
Reply | Threaded
Open this post in threaded view
|

Re: [WIN]I can only got access to the kinect a few times out of 20 times attempts

matlabbe
Administrator
Hi,

I cannot reproduce your problem on my machine. I tested binaries usbk v1.00-12 with RTABMap-0.14.0-win64.zip and libfreenect2-0.2.0-usbdk-vs2015-x64.zip and both work fine (within 2-3 sec of initialization). Here are the outputs in the terminal:

RTAB-Map.exe:
[Info] [OpenCLDepthPacketProcessorImpl]  devices:
[Info] [OpenCLDepthPacketProcessorImpl]   0: GeForce GT 620  (GPU)[NVIDIA Corporation ]
[Info] [OpenCLDepthPacketProcessorImpl]   1:         Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz  (CPU)[Intel(R) Corporation ]
[Info] [OpenCLDepthPacketProcessorImpl]   2:         Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz  (CPU)[Intel(R) Corporation ]
[Info] [OpenCLDepthPacketProcessorImpl] selected device: GeForce GT 620  (GPU)[NVIDIA Corporation ]
[Info] [OpenCLDepthPacketProcessorImpl] building OpenCL program...
[Info] [OpenCLDepthPacketProcessorImpl] OpenCL program built successfully
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 12 usb devices connected
[Info] [Freenect2Impl] found valid Kinect v2 @14:2 with serial 506816242542
[Info] [Freenect2Impl] found 1 devices
[Info] [Freenect2DeviceImpl] opening...
[Info] [Freenect2DeviceImpl] transfer pool sizes rgb: 3*1048576 ir: 8*64*33792
[Info] [Freenect2DeviceImpl] opened
[Info] [OpenCLDepthPacketProcessorImpl] building OpenCL program...
[Info] [OpenCLDepthPacketProcessorImpl] OpenCL program built successfully
[Info] [Freenect2DeviceImpl] starting...
[Info] [Freenect2DeviceImpl] submitting rgb transfers...
[Info] [Freenect2DeviceImpl] submitting depth transfers...
[Info] [Freenect2DeviceImpl] started
[ WARN] (2017-10-11 10:38:44) CameraRGBD.cpp:1510::rtabmap::CameraFreenect2::init() Freenect2: When using custom calibration file, type kTypeColor2DepthSD is not supported. kTypeDepth2ColorSD is used instead...
[Info] [DepthPacketStreamParser] 2 packets were lost
[Info] [DepthPacketStreamParser] 2 packets were lost

protonect.exe:
Version: 0.2.0
Environment variables: LOGFILE=<protonect.log>
Usage: C:\Users\Mathieu\Downloads\libfreenect2-0.2.0-usbdk-vs2015-x64\bin\Protonect.exe [-gpu=<id>] [gl | cl | cuda | cpu] [<device serial>]
        [-noviewer] [-norgb | -nodepth] [-help] [-version]
        [-frames <number of frames to process>]
To pause and unpause: pkill -USR1 Protonect
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 12 usb devices connected
[Info] [Freenect2Impl] found valid Kinect v2 @14:2 with serial 506816242542
[Info] [Freenect2Impl] found 1 devices
[Info] [Freenect2DeviceImpl] opening...
[Info] [Freenect2DeviceImpl] transfer pool sizes rgb: 3*1048576 ir: 8*64*33792
[Info] [Freenect2DeviceImpl] opened
[Info] [Freenect2DeviceImpl] starting...
[Info] [Freenect2DeviceImpl] submitting rgb transfers...
[Info] [Freenect2DeviceImpl] submitting depth transfers...
[Info] [Freenect2DeviceImpl] started
device serial: 506816242542
device firmware: 4.0.3916.0
[Info] [DepthPacketStreamParser] 5 packets were lost
[Info] [DepthPacketStreamParser] 5 packets were lost

The only difference I see is that RTAB-Map uses OpenCL pipeline instead of OpenGL pipeline by default. I tried Protonect.exe with 'cl' pipeline but it is not built with it. Do you have a GPU on your computer with OpenCL installed? I updated the code to use OpenGL in priority: see this commit. In that commit I also added the option to choose which pipeline we want. I'll try to release new binaries soon with that change.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: [WIN]I can only got access to the kinect a few times out of 20 times attempts

matlabbe
Administrator
Hi,

Can you try these binaries? If it works, I'll make an official release.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: [WIN]I can only got access to the kinect a few times out of 20 times attempts

justin1230
Hi, sorry for late reply, seems not working.
Still getting "camera initialization failed".
Reply | Threaded
Open this post in threaded view
|

Re: [WIN]I can only got access to the kinect a few times out of 20 times attempts

matlabbe
Administrator
I'll be able to test on another windows machine in 1 week... Out of town right now..
Reply | Threaded
Open this post in threaded view
|

Re: [WIN]I can only got access to the kinect a few times out of 20 times attempts

matlabbe
Administrator
I've found the problem, it is because the wrong libusb-1.0.dll is packaged with the released binaries. A quick fix for already released binaries is to copy libusb-1.0.dll from libfreenect2 binaries (libfreenect2-0.2.0-usbdk-vs2015-x64.zip) in RTAB-Map bin directory (over the bad libusb-1.0.dll). The next releases will be packaged with the right dll.

cheers,
Mathieu