Software Archive
Read-only legacy content
17060 Discussions

Can I using two RealSenseCameras on the same device ?

gong_a_
Beginner
609 Views
In fact, Unity have identified these Cameras, and I can using Unity API to display on Unity. But RSSDK couldn't identified two RealSenseCamera. when I Init PXCMSenseManager, only one camera could work for me, I checked PXCMSenseManager class, and I didn't find any available option for me to choose different RealSenseCamera. This situation is same for RSSDK samples. When I opened sample such as Hands Viewer, click the menu of Device, It's also only showed one RealSense Camera. Does RSSDK support that function? Thank You
0 Kudos
3 Replies
samontab
Valued Contributor II
609 Views

Maybe. Probably not very well supported if possible at all.

Start taking a look at QueryImpl:

The QueryImpl function enumerates available modules according to the search criteria (the module descriptor template, template). If there are multiple matches, the application needs to increase the idx number to retrieve additional matches, until the function returns PXC_STATUS_ITEM_UNAVAILABLE.

These parameters define a video camera, like the RealSense, or any other webcam.

PXCSession::ImplDesc desc={};
desc.group = PXCSession::IMPL_GROUP_SENSOR;
desc.subgroup = PXCSession::IMPL_SUBGROUP_VIDEO_CAPTURE;

Using that, and idx = 0, you will get the first camera. Using idx = 1 will get you the second camera, and so on until the function returns an error. Something like this:

for(unsigned int i=0;;i++)
{
PXCSession::ImplDesc desc1;
if (session->QueryImpl(&desc, i, &desc1) < PXC_STATUS_NO_ERROR) break;
// do something with desc1
}

With each desc1, you can go ahead an create a PXCCapture object like this:

PXCCapture *capture;
pxcStatus status = session->CreateImpl<PXCCapture>(&desc1, &capture);

Doing this, I am actually able to see both cameras being listed in my app, with different iuid (group, subgroup, and iuid define uniquely a resource). So far so good, I can actually see that there are two Intel RealSense Cameras in the computer.

But.... and it is a big but:

When I try to get some device information with:

PXCCapture::DeviceInfo dinfo;
pxcStatus err = capture->QueryDeviceInfo(i, &dinfo);

I get an error for the second camera. The first one, i=0, works fine.

The same is true when I try to create the device:

PXCCapture::Device *device = capture->CreateDevice(i);

The first one works, but the second does not work.

Did you actually get to see video data from both cameras in unity?, or they are only listed as IDs, like camera1, camera2?. If Unity can stream from both cameras, it should be possible to do it from RSSDK.

Also, there seems to be a few issues here related to the USB ports:

First, there isn't a concept of plugged in, as it seems that the SDK always thinks that the camera is connected. Once you plug a camera, it is available for ever, unless you uninstall it. This makes sense to Intel as they are designing this to be as an always connected device, but may cause problems for an application that uses multiple USB cameras that can be swapped and disconnected.

Second, it seems that the USB port where you first connect the camera is relevant. Not sure exactly how it affects the SDK, but try running the demos and plug and unplug the cameras in different ports to see what I mean. Sometimes the app will see the camera but will not be able to stream from it unless you change the USB port.

So, as you can see, it is maybe possible to use multiple cameras, because they are listed, but I have not seen anyone doing it yet. And then again, Intel is designing this camera to be only one camera, always on, which may explain why it is not possible to stream from two or more cameras. Having said that, I can stream from a laptop camera and the RealSense Camera without a problem with the demo apps.

0 Kudos
Tim_T_
Beginner
609 Views

The previous SDK (for the Senz3D camera) was able to support multiple cameras simultaneously with a small change that could be accomplished by the end user (in the header files of the SDK, if I recall).  You can see the fun result in action here, where I'm using two pairs of Senz3D cameras (each pair on a separate laptop):

        https://www.youtube.com/watch?v=M4Xd9TrcPE0 

I don't know whether this year's product and SDK can be changed (by the end user) to support multiple cameras, but based on this previous experience we should be optimistic, with the obvious caveats about CPU consumption and bandwidth on the USB controllers.  I'm not currently exploring whether it's possible with the current SDK, though supporting multiple devices simultaneously is a feature request I make regularly.

       ...Tim...

 

 

0 Kudos
Colleen_C_Intel
Employee
609 Views

The gold release R1 (current) of the RealSense SDK 2014 only supports one Realsense camera at this time.

0 Kudos
Reply