librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

Can't stream RSdevice besides 0 and -1 index

Open MatthewLKomar opened this issue 5 years ago • 4 comments

  • Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):

  • All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)


Required Info
Camera Model D455 * 2
Firmware Version 5.12.14.50
Operating System & Version Win 10
Platform PC
SDK Version 2.47.0.3309
Language Unity
Segment C#

Issue Description

image

In RSDevice.cs any stream index > 0 causes cfg to be effectively null. The culprit is in line 70 - 71.

using (var cfg = DeviceConfiguration.ToPipelineConfig())
            ActiveProfile = m_pipeline.Start(cfg); 

The error code is:

rs2_pipeline_start_with_config(pipe:000001B735A2C0B0, config:000001B72011BD20) 
Rethrow as Exception: couldn't resolve requests

I've looked at #2203 I've looked at #2333 I've looked at https://community.intel.com/t5/Items-with-no-label/Can-I-use-multiple-Intel-RealSense-cameras-in-a-single-Unity3d/m-p/684416

I have both devices plugged into the USB 3.2 ports on my computer and the Intel Real Sense Viewer sees both cameras. Unity and Viewer are not running concurrently. The C++ rs-example multicam shows the cameras.

Any ideas on how I can go about fixing this?

MatthewLKomar avatar Jul 24 '21 04:07 MatthewLKomar

Hi @MatthewLKomar The error Couldn't resolve requests means that the RealSense SDK could not provide a requested camera configuration, either because the requested configuration is not currently supported on that particular camera model or because there is a typing error in the stream definition instruction that the SDK cannot understand.

For a multiple camera setup in the RealSense Unity wrapper, the link below advises to use multiple device components with their own unique serial number.

https://github.com/IntelRealSense/librealsense/issues/8347#issuecomment-778745413

Expanding upon this advice, a detailed guide shared by a RealSense user for creating a Unity multicam setup is provided here:

https://support.intelrealsense.com/hc/en-us/community/posts/360047049173-Community-contribution-for-using-multiple-cameras-in-RealSense-Unity-wrapper

You may also find interesting a recently released project for calibrating together multiple RealSense cameras in Unity using Apriltag image tags.

https://github.com/ababilinski/realsense-apriltags-calibration-unity

MartyG-RealSense avatar Jul 24 '21 08:07 MartyG-RealSense

Hi @MartyG-RealSense, thanks for getting back to me.

What does StreamIndex do? Looking at ababilinski's implementation and fixing mine, I noticed that the serial number needs to change, but the stream index stays constant at -1. Why isn't serial number tied to Stream Index?

Also: the github link was the motherlode thanks a lot. Will you guys add that into the community projects tab in the Intel Real Sense documentation? This seems like a very commonly done thing, but there isn't easy access to this knowledge unless you look to the forums.

MatthewLKomar avatar Jul 27 '21 04:07 MatthewLKomar

In the RealSense Unity wrapper, Stream Index can be used to differentiate more than one stream profile of the same type - for example, having two Infrared profiles but giving one of them an index of '1' and the other an index of '2' so that they represent the left and right infrared streams. This is described in a recent Unity case in the link below.

https://github.com/IntelRealSense/librealsense/issues/9427#issuecomment-881515532

Therefore, the Stream Index can define how multiple streams of the same format are handled, whilst the Serial Number will determine which device in a multiple set of cameras the settings in that particular RsDevice component will be applied to.

I have added a Documentation tag to this case so that the RealSense team can at a future date consider your suggestion to add the link below to the Community Projects section of the SDK examples page. This case should be kept open whilst that documentation request is active, but you do not need to take any further action about it.

https://github.com/ababilinski/realsense-apriltags-calibration-unity

MartyG-RealSense avatar Jul 27 '21 12:07 MartyG-RealSense

Issue closed due to RealSense no longer updating support for Unity.

MartyG-RealSense avatar Jan 30 '26 13:01 MartyG-RealSense