I’m using 2 cameras (Orbbec Astra Mini) with python3, opencv3.2 and openNi2 in xubuntu 16.04.
I can read 1 camera and I can choose which one read (changing dev[0])
dev = openni2.Device.open_all()
depth_stream = dev[0].create_depth_stream()
depth_stream.start()
depth_stream.set_video_mode(c_api.OniVideoMode(pixelFormat = c_api.OniPixelFormat.ONI_PIXEL_FORMAT_DEPTH_100_UM, resolutionX = 320, resolutionY = 240, fps = 30))
The problem is that if I start another process which read the other camera it crash and says:
File “/home/stark/.local/lib/python3.5/site-packages/primesense/openni2.py”, line 230, in open_all
return [cls(uri) for uri in cls.enumerate_uris()]
File “/home/stark/.local/lib/python3.5/site-packages/primesense/openni2.py”, line 230, in
return [cls(uri) for uri in cls.enumerate_uris()]
File “/home/stark/.local/lib/python3.5/site-packages/primesense/openni2.py”, line 199, in init
self._reopen()
File “/home/stark/.local/lib/python3.5/site-packages/primesense/openni2.py”, line 209, in _reopen
c_api.oniDeviceOpen(self._orig_uri, ctypes.byref(self._handle))
File “/home/stark/.local/lib/python3.5/site-packages/primesense/_openni2.py”, line 2102, in wrapper
raise OpenNIError(res, msg.strip(), logfile)
primesense.utils.OpenNIError: (OniStatus.ONI_STATUS_ERROR, b’Could not open “2bc5/0404@1/10”: Failed to set USB interface!', None)
I tried to plug the cameras in the same bus and in a different one. Now they are plugged one in usb3.0 and the other in usb2.0.
They work both if called in a single process, when I start the second (same code with different device index) the second doesn’t work.