Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues connecting D435 and T265 together using Python. #6184

Closed
asb2111991 opened this issue Apr 2, 2020 · 3 comments
Closed

Issues connecting D435 and T265 together using Python. #6184

asb2111991 opened this issue Apr 2, 2020 · 3 comments

Comments

@asb2111991
Copy link

asb2111991 commented Apr 2, 2020

Required Info
Camera Model D435 and T265
Firmware Version D435 - 05.12.03.00, T265 - 0.2.0.926
Operating System & Version Win 10
Kernel Version (Linux Only) NA
Platform PC
SDK Version 2.34.0
Language Python

Issue Description

When I connect both devices D435 and T265 together and try to run one of the examples, it gives me an error saying 'No device connected'. I did not have any issues accessing both devices individually. Below is the code followed by its output:

Code:

import pyrealsense2 as rs
import numpy as np

context = rs.context()
pipelines = []
for device in context.query_devices():
    print(device)
    pipe = rs.pipeline(context)
    config = rs.config()
    config.enable_device(device.get_info(rs.camera_info.serial_number))
    pipe.start(config)
    pipelines.append(pipe)

Output:
<pyrealsense2.device: Intel RealSense D435 (S/N: 920312070806)>
<pyrealsense2.device: Intel RealSense T265 (S/N: 947122110515)>
Traceback (most recent call last):

File "C:\Users\AppSa001\Google Drive\Staples\Python\Intel\MultiCam.py", line 18, in
pipe.start(config)

RuntimeError: No device connected

@asb2111991
Copy link
Author

I wanted to add that I can hear two alert sounds from windows (this sound is common when any USB device is connected to windows computer) one for each device before I start running the code. As soon as I run the code, I hear only one 'USB device disconnected' alert from Windows. It feels like running the code disconnects T265 momentarily for some reason. I do not hear this disconnect device when I use the devices individually.

@asb2111991
Copy link
Author

Update:

Following the comments in issue #1735 I tried to use a part of it to see if it works and found something interesting and will be very helpful for users trying to work with D435 and T265 together.

Here is the code:

import pyrealsense2 as rs

# Configure depth and color streams...
# ...from Camera 1
pipeline_1 = rs.pipeline()
config_1 = rs.config()
config_1.enable_device('920312070806')
config_1.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30)
config_1.enable_stream(rs.stream.color, 640, 480, rs.format.bgr8, 30)
# Start streaming
pipeline_1.start(config_1)

# ...from Tracking Camera
pipeline_2 = rs.pipeline()
config_2 = rs.config()
#config_2.enable_device('947122110515')
config_2.enable_stream(rs.stream.pose)
# Start streaming 
pipeline_2.start(config_2)

# Stop streaming
pipeline_1.stop()
pipeline_2.stop()

Observations:

  1. When using tracking camera the running the line config_2.enable_device('947122110515') throws an error, hence I commented it.
  2. With my kernel restarted, when I run this code iteratively, I get errors in some runs and runs without issues in other runs. The error has no definitive pattern (as far as I know). Here are the outputs:
[1] runfile('****PATH****/untitled0.py', wdir='****PATH****')

[2] runfile('****PATH****/untitled0.py', wdir='****PATH****')
Traceback (most recent call last):

  File "****PATH****\untitled0.py", line 30, in <module>
    pipeline_2.start(config_2)

RuntimeError: Couldn't resolve requests


[3] runfile('****PATH****/untitled0.py', wdir='****PATH****')

[4] runfile('****PATH****/untitled0.py', wdir='****PATH****')

[5] runfile('****PATH****/untitled0.py', wdir='****PATH****')
Traceback (most recent call last):

  File "****PATH****\untitled0.py", line 30, in <module>
    pipeline_2.start(config_2)

RuntimeError: Couldn't resolve requests

As I am testing the the device for my application, I can keep pressing F5 till it runs, but, this has to be fixed.

Hope that helps some one.

@RealSenseSupport
Copy link
Collaborator

Hi,

Will you be needing further help with this? If we don’t hear from you in 7 days, this issue will be closed.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants