You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey!
I have connected two kinects and both of them are working just fine if I start each of them with a separate Protonect or multiframe_listener (each of them is connected to a separate USB controller and libfreenect2/issues/807 is implemented)
But I am trying to get frames from both kinects within a single script.
Here is the code:
from scipy import ndimage
import numpy as np
import cv2
import sys
from pylibfreenect2 import Freenect2, SyncMultiFrameListener
from pylibfreenect2 import FrameType, Registration, Frame
from pylibfreenect2 import createConsoleLogger, setGlobalLogger
from pylibfreenect2 import LoggerLevel
import os
from pylibfreenect2 import OpenGLPacketPipeline
pipeline = OpenGLPacketPipeline()
print("Packet pipeline:", type(pipeline).__name__)
enable_rgb = True
enable_depth = True
fn = Freenect2()
device = fn.openDevice("025159651347", pipeline=pipeline)
device2 = fn.openDevice("004404264147", pipeline=pipeline)
types = 0
if enable_rgb:
types |= FrameType.Color
if enable_depth:
types |= (FrameType.Ir | FrameType.Depth)
listener = SyncMultiFrameListener(types)
listener2 = SyncMultiFrameListener(types)
# Register listeners
device.setColorFrameListener(listener)
device.setIrAndDepthFrameListener(listener)
# Here problems starts...
device2.setColorFrameListener(listener2)
device2.setIrAndDepthFrameListener(listener2)
I register listeners for the second device, but it does not work after that. It goes further to a while loop but it does not iterate.
I haven't tried to run two kinects in a single process and I'm not sure if it's possible, but I think you should create packet pipeline for each device.
Hey!
I have connected two kinects and both of them are working just fine if I start each of them with a separate Protonect or multiframe_listener (each of them is connected to a separate USB controller and libfreenect2/issues/807 is implemented)
But I am trying to get frames from both kinects within a single script.
Here is the code:
I register listeners for the second device, but it does not work after that. It goes further to a while loop but it does not iterate.
Here is the remaining part of my code:
Is it correctly to do like this by the way:
Is there a way to sync kinects (not exactly, but at least somehow)?
I am using Ubuntu 16.04
Thanks a lot!
The text was updated successfully, but these errors were encountered: