ofxKinectV2 addon

Hmm - I need to get my hands on one of the new ones.
The exclusive access message seems a bit strange also.

There is a bit more on this topic on the OpenKinect mailing list.
https://groups.google.com/forum/#!topic/openkinect/2D-wk1QDww8

Thanks, I’ll have a look there.

@Jordi - check this out it sounds like it could be a fix for your issue. https://github.com/ofTheo/ofxKinectV2/issues/1

Thanks I’ll reply there!

EDIT: It works now! thank you so much!
see: https://github.com/ofTheo/ofxKinectV2/issues/1

Is there any experience with the USB extenders with Kinect v2? I just confirmed powered USB 2 extenders, which work with older kinects, do not support V2.

Thanks.

–8

I have tried an active USB 3 cable extender which didn’t work 100%

On the MSFT forums this cable ( pricey ) has been confirmed to work: http://www.amazon.com/Corning-Optical-Cable-Meter-32-8/dp/B00JOJRF6K

10 meters is actually cool for $100 . However, I am looking for something that would handle 50–75 meters. I think this might work, but that’s really pricy.

Thanks.

–8

It might be obvious; but depending on what you want to do, you could also have a computer close to the kinect that process the data; and then send what you need over the network. From what I read on the msft forum, the high bandwidth is due to the time of flight data being processed on the computer side rather than on the kinect. So sending color/depth/skeleton is probably not as bandwidth costly than transmitting the raw data.

Corning also have a 50m cable for $500 !
:slight_smile:

Here is 50 meters for $150. 33 centimeters a buck.

–8

For skeletons that might be a bandwidth saver, however, still a jump in the complexity of the setup, intended to be run by a layman shop, and, assuming the $150 extender works, a price bump too.

Since this is an OS X setup, the skeletons are out of question, while streaming V2 pointclouds will be more challenging than v1 pointclouds, which (uncompressed) already were close to saturating the network in my experience.

–8

I tried to port GPU depth decoding from libfreenect2 and achieved 30fps depth decoding on MBPR. (Average decoding processing time is about 15ms to 18ms)

Here is the code:


(Require https://github.com/satoruhiga/ofxOpenGLContextScope)
Tested environment : MBPR15 Mid2012, OSX 10.9.4, openFrameworks v.0.8.3

The shaders are ported to GLSL 1.20 and ofGpuDepthPacketProcessor is fully re-implemented using OF utility classes as much as possible. (e.g. ofTexture/ofFbo)

The implementation is still working in progress.
(Filter stage is not ported yet and some time flickering occurs.)

A welcome development indeed. Will try it out as soon as my Kinect v2 arrives.

Thanks.

–8

Hi Hanasan_hanasan: Trying to run your addon, I am getting an RGB frame, no IR or Depth frames, and the app quits immediately with the following errors. I noticed the README tells to have “flushed firmware on Kinect using Windows 8” – I just bought this kinect a day ago – does it still have to be flushed?

Thanks.

Using libusbx v1.0.17.10852

Trying to open device 045E:02D8…
speed: 5000 Mbit/s (USB SuperSpeed)
active configuration: 1, err: 0
Claiming interface 0…
libusbx: info [darwin_claim_interface] no interface found; setting configuration: 1

Claiming interface 1…
running kinect…
Control transfer 1 - set isoch delay
Control transfer 2 - set sel u1/u2

Setting interface alt setting…
Setting stream status: Disable
Control transfer 3 - enable u1
Control transfer 4 - enable u2
Control transfer 5 - set feature 768
Setting sensor status: Disable
Kinect init done

iso max_packet_size: 33792
speed: 5000 Mbit/s (USB SuperSpeed)
running kinect…
Setting sensor status: Enable

===

Cmd seq 0 func 0x02 (0)
Cmd sent, 20 bytes sent
Cmd response seq 0 func 0x02 (0)
Cmd response success, 512 bytes received
Received cmd data 0x02 (0), length: 512
Cmd response seq 0 func 0x02 (0)
Cmd response success, 16 bytes received
Cmd response completed
Response complete for cmd 0x02 (0)
dumping 512 bytes of raw data from command KCMD_READ_DATA1:
0x0000: 03 00 02 00 48 0f 00 00 00 00 00 00 00 00 00 00 …H…
0x0010: 03 00 02 00 48 0f 00 00 00 00 00 00 00 00 00 00 …H…
0x0020: 03 00 02 00 48 0f 00 00 00 00 00 00 00 00 00 00 …H…
0x0030: 03 00 02 00 48 0f 00 00 00 00 00 00 00 00 00 00 …H…
0x0040: 03 00 02 00 48 0f 00 00 00 00 00 00 00 00 00 00 …H…
0x0050: 03 00 02 00 48 0f 00 00 00 00 00 00 00 00 00 00 …H…
0x0060: 03 00 02 00 48 0f 00 00 00 00 00 00 00 00 00 00 …H…
0x0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x00a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x00b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x00c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x00d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x00e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x00f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x01a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x01b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x01c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x01d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x01e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x01f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …

===

Cmd seq 1 func 0x14 (0)
Cmd sent, 20 bytes sent
Cmd response seq 1 func 0x14 (0)
Cmd response success, 92 bytes received
Received cmd data 0x14 (0), length: 92
Cmd response seq 1 func 0x14 (0)
Cmd response success, 16 bytes received
Cmd response completed
Response complete for cmd 0x14 (0)
dumping 92 bytes of raw data from command KCMD_READ_VERSIONS:
0x0000: 00 00 12 00 00 00 00 00 01 00 00 00 43 c1 1f 41 …C…A
0x0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0020: 0a 21 33 55 c2 00 17 20 00 08 00 00 10 00 00 00 .!3U… …
0x0030: 00 01 00 00 00 10 00 00 00 00 80 00 01 00 00 00 …
0x0040: 31 33 00 00 00 04 13 04 47 4d 43 38 30 34 2e 31 13…GMC804.1
0x0050: 58 00 00 00 00 00 00 00 00 00 00 00 X…

===

Cmd seq 2 func 0x22 (0x1)
Cmd sent, 24 bytes sent
Cmd response seq 2 func 0x22 (0x1)
Cmd response success, 128 bytes received
Received cmd data 0x22 (0x1), length: 128
Cmd response seq 2 func 0x22 (0x1)
Cmd response success, 16 bytes received
Cmd response completed
Response complete for cmd 0x22 (0x1)
dumping 128 bytes of raw data from command KCMD_READ_DATA_PAGE 0x01:
0x0000: 35 00 30 00 31 00 35 00 32 00 33 00 35 00 34 00 5.0.1.5.2.3.5.4.
0x0010: 31 00 39 00 34 00 32 00 00 00 00 00 00 00 00 00 1.9.4.2…
0x0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
0x0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …

===

Cmd seq 3 func 0x22 (0x3)
Cmd sent, 24 bytes sent
Cmd response seq 3 func 0x22 (0x3)
Cmd response success, 92 bytes received
Received cmd data 0x22 (0x3), length: 92
Cmd response seq 3 func 0x22 (0x3)
Cmd response success, 16 bytes received
Cmd response completed
Response complete for cmd 0x22 (0x3)
depth camera intrinsic parameters: fx 365.010315, fy 365.010315, cx 259.066986, cy 207.043594
depth camera radial distortion coeffs: k1 0.092289, k2 -0.273054, p1 0.000000, p2 0.000000, k3 0.098222

===

Cmd seq 4 func 0x22 (0x2)
Cmd sent, 24 bytes sent
Cmd response seq 4 func 0x22 (0x2)
Cmd response success, 1302882 bytes received
Received cmd data 0x22 (0x2), length: 1302882
Cmd response seq 4 func 0x22 (0x2)
Cmd response success, 16 bytes received
Cmd response completed
Response complete for cmd 0x22 (0x2)

===

Cmd seq 5 func 0x22 (0x4)
Cmd sent, 24 bytes sent
Cmd response seq 5 func 0x22 (0x4)
Cmd response success, 12981 bytes received
Received cmd data 0x22 (0x4), length: 12981
Cmd response seq 5 func 0x22 (0x4)
Cmd response success, 16 bytes received
Cmd response completed
Response complete for cmd 0x22 (0x4)
1081.37
959.5
539.5
863
52
0.000412203
-3.32267e-05
-1.03431e-06
0.000261537
-0.00106513
-2.11046e-05
0.000270872
0.636668
0.00113992
0.0997265
-3.66343e-05
0.000620034
0.000350574
-3.57244e-05
-5.83431e-05
5.10673e-05
-0.0010234
-0.0011634
0.635936
0.0197555

===

Cmd seq 6 func 0x16 (0x90000)
Cmd sent, 24 bytes sent
Cmd response seq 6 func 0x16 (0x90000)
Cmd response success, 4 bytes received
Received cmd data 0x16 (0x90000), length: 4
Cmd response seq 6 func 0x16 (0x90000)
Cmd response success, 16 bytes received
Cmd response completed
Response complete for cmd 0x16 (0x90000)
Received status KCMD_READ_STATUS (0x90000): 1024

===

Cmd seq 7 func 0x09 (0)
Cmd sent, 20 bytes sent
Cmd response seq 7 func 0x09 (0)
Cmd response success, 16 bytes received
Cmd response completed
Response complete for cmd 0x09 (0)
Setting stream status: Enable

===

Cmd seq 8 func 0x16 (0x90000)
Cmd sent, 24 bytes sent
Cmd response seq 8 func 0x16 (0x90000)
Cmd response success, 4 bytes received
Received cmd data 0x16 (0x90000), length: 4
Cmd response seq 8 func 0x16 (0x90000)
Cmd response success, 16 bytes received
Cmd response completed
Response complete for cmd 0x16 (0x90000)
Received status KCMD_READ_STATUS (0x90000): 1026

===

Cmd seq 9 func 0x2b (0x1)
Cmd sent, 24 bytes sent
Cmd response seq 9 func 0x2b (0x1)
Cmd response success, 16 bytes received
Cmd response completed
Response complete for cmd 0x2b (0x1)
Set stream status success: Enable
speed: 5000 Mbit/s (USB SuperSpeed)
libusbx: warning [darwin_transfer_status] transfer error: timed out
[ofGpuDepthPacketProcessor] avg. time: 7.87418ms -> ~126.997Hz
ofxKinectV2GPUExample(856,0xa09c11a8) malloc: *** error for object 0x18fab10: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 0 pipe 3
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 0 pipe 3
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 0 pipe 3
[TransferPool::submit] transfer submission disabled!
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 0 pipe 3
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 0 pipe 3
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 0 pipe 3
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 0 pipe 3
[TransferPool::submit] transfer submission disabled!
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 0 pipe 3
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 0 pipe 3
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[DepthPacketStreamParser::handleNewData] not all subsequences received 127
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
[TransferPool::submit] transfer submission disabled!
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
[TransferPool::submit] transfer submission disabled!
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
[TransferPool::submit] transfer submission disabled!
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
[TransferPool::submit] transfer submission disabled!
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
[TransferPool::submit] transfer submission disabled!
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
[TransferPool::submit] transfer submission disabled!
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
[TransferPool::submit] transfer submission disabled!
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
[TransferPool::submit] transfer submission disabled!
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
[TransferPool::submit] transfer submission disabled!
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
[TransferPool::submit] transfer submission disabled!
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
libusbx: warning [darwin_abort_transfers] aborting all transactions on interface 1 pipe 1
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
closing kinect…
[TransferPool::submit] transfer submission disabled!Setting sensor status: Disable

[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
[TransferPool::submit] transfer submission disabled!
Releasing interface 0…
Releasing interface 1…
Closing device…
libusbx: warning [libusb_exit] application left some devices open

Hi eight, could you try theo’s original version of ofxKinectV2 at first?
My fork aims at GPU depth packet decoding on OSX,
and confirmed running on MBPR15 Mid 2012.
It might be more unstable than theo’s original CPU depth packet decoding.

And actual procedure for me to get KinectV2 work on OSX was following:

  1. Connect KinectV2 to Win8 machine and check it works
  2. Connect KinectV2 to OSX
    I do not know only connecting to Win8 machine triggers flushing,
    but actual procedure was above.

Theo’s version works, almost no issues. However, while applying delaunay to it, the rate falls below 1 fps.

I have the same version of MBPR15 Mid 2012.

I haven’t flushed my kinect, since it was working on theo’s addon. Do I need to flush it for it to work with yours? Was your kinect working with your addon without the flush?

Regards,

–8

Confirming that this extender works, however, the sequence of connecting the devices matters. Here’s the sequence:

  1. Connect the fiber end to computer
  2. Connect the other end to the accompanying adapter.
  3. Power the adapter in 2. up.
  4. Connect the kinect to the adapter in 2.
  5. Power up the kinect.
  6. Launch the program
  7. Bingo!!!
1 Like

As far as I know, I didn’t flush my Kinect V2 …

@eight - with the non-gpu version you can get much, much better frame rates building in Release mode.
The Release optimizations make a big difference here.

Glad the extender works! Thats great news.
Does it stay working on reboot?

I am using Release mode, of course. Haven’t tried to reboot the system – but will surely try it next week.

–8