-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Hi, I'm trying to run two devices at the same time, I have to following code:
void run () {
//first kinect
std::string device_id1 = "#"+boost::lexical_caststd::string(1);
pcl::io::OpenNI2Grabber interface1 (device_id1);
boost::function<void (const PointCloud::ConstPtr&)> f = boost::bind(&SimpleOpenNIViewer::grabberCallback,this, 1);
interface1.registerCallback (f);
interface1.start ();
//second kinect
std::string device_id2 = "#"+boost::lexical_caststd::string(2);
pcl::io::OpenNI2Grabber interface2 (device_id2);
boost::function<void (const PointCloud::ConstPtr&)> f2 = boost::bind(&SimpleOpenNIViewer::cloud_cb_2,this, _1);
interface2.registerCallback (f2);
interface2.start ();
while (!viewer.wasStopped())
{ sleep (1); }
interface2.stop ();
interface1.stop ();
}
This code works fine with two PrimeSense devices and with one Kinect2 and one PrimeSense, but with two kinect2 it open two times the same device.
It seams that when I have two kinect2 connected I can't adress them, nor with device id or serial number.
Thanks in advance.