Double t265 connection
I am trying to connect 2 trackers t265 on the same PC. While with the Viewer everything works just fine, I have problems in Python. I tried a couple of different possibilities, always with the same result, the second unit cannot be opened...
Here's the code:
import pyrealsense2 as rs
import numpy as np
import transformations as tf
import math as m
import time
H_aeroRef_T265Ref = np.array([[0,0,-1,0],[1,0,0,0],[0,-1,0,0],[0,0,0,1]])
H_T265body_aeroBody = np.linalg.inv(H_aeroRef_T265Ref)
### FIRST UNIT
ctx1 = rs.context()
###devices = ctx.query_devices()
print ctx1
time.sleep(1)
### Declare RealSense pipeline, encapsulating the actual device and sensors
pipe1 = rs.pipeline(ctx1)
### Build config object and request pose data
cfg1 = rs.config()
cfg1.enable_stream(rs.stream.pose)
### SECOND UNIT
ctx2 = rs.context()
###devices = ctx.query_devices()
print ctx2
time.sleep(1)
### Declare RealSense pipeline, encapsulating the actual device and sensors
pipe2 = rs.pipeline(ctx2)
### Build config object and request pose data
cfg2 = rs.config()
cfg2.enable_stream(rs.stream.pose)
### Start streaming with requested config
pipe1.start(cfg1)
pipe2.start(cfg2)
### Wait for the next set of frames from the camera
frame1 = pipe1.wait_for_frames()
frame2 = pipe2.wait_for_frames()
### Fetch pose frame
pose1 = frame1.get_pose_frame()
pose2 = frame1.get_pose_frame()
### Close
pipe1.stop()
pipe2.stop()
and here's the output
<pyrealsense2.pyrealsense2.context object at 0x0000000004CE56F8>
<pyrealsense2.pyrealsense2.context object at 0x0000000004CFC228>
Traceback (most recent call last):
File "double_t265_example.py", line 40, in
@stino78 hello,
For T265 there is a limitation that requires the sensors to be mapped to the first context created in code.
To make your code run you just need to reuse the first context when opening the second device:
pipe2 = rs.pipeline(~~ctx2~~ctx1)
It seem that you can drop the second context altogether.
Note that this doesn't apply to the other Realsense devices - D400 and SR300.
See more discussions on this topic in #3892, #3734, #3434, #3437, #3892
P.S: The original snippet was re-formatted for readability
Hi ev-mp, thanks for the quick feedback!
Sadly I get a similar error...
11:04:50:536 [011440] [E] Device-0C40: State [ACTIVE_STATE] got event [ON_PLAYBACK_SET] ==> [ERROR_STATE]
11:04:50:536 [011440] [E] Device-0C40: Entered state [ERROR_STATE]
Traceback (most recent call last):
File "double_t265_example.py", line 40, in
I am looking at the other related discussion, but I could not find a solution.
Can you help me with this?
Thank you,
Agostino
This will have to be resolved via a code fix, and not a trivial one, unfortunately. We are working on it, but it can take more time.
@stino78 I am facing the exact issue right now. I was using a ros package called realsense-ros to launch multiple cameras using (rs_multiple_devices.launch) but I guess that doesn't support t265 cameras. Were you able to extract any pose information from t265 using your code. Thanks
Hi Kartik,
Intel released this code, that is working for me: https://github.com/IntelRealSense/realsense-ros/files/3461264/more_devices_test.py.zip
I use it with 2 cameras on Win 10 and Ubuntu 18
Best,
Agostino
On Tue, Jan 14, 2020 at 10:13 AM Kartik Prakash [email protected] wrote:
@stino78 https://github.com/stino78 I am facing the exact issue right now. I was using a ros package called realsense-ros to launch multiple cameras using (rs_multiple_devices.launch) but I guess that doesn't support t265 cameras. Were you able to extract any pose information from t265 using your code. Thanks
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/IntelRealSense/librealsense/issues/4183?email_source=notifications&email_token=ADYMIIMUG2N6JRFWEZDVYA3Q5X6EFA5CNFSM4HWZ55IKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI5S3IA#issuecomment-574303648, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADYMIINKIFYPWDT6M4PE57DQ5X6EFANCNFSM4HWZ55IA .
Thanks for the prompt reply . I will definitey check this out. Appreciate your help.
On Tue, Jan 14, 2020, 5:02 PM Agostino Gibaldi [email protected] wrote:
Hi Kartik,
Intel released this code, that is working for me:
https://github.com/IntelRealSense/realsense-ros/files/3461264/more_devices_test.py.zip
I use it with 2 cameras on Win 10 and Ubuntu 18
Best,
Agostino
On Tue, Jan 14, 2020 at 10:13 AM Kartik Prakash [email protected] wrote:
@stino78 https://github.com/stino78 I am facing the exact issue right now. I was using a ros package called realsense-ros to launch multiple cameras using (rs_multiple_devices.launch) but I guess that doesn't support t265 cameras. Were you able to extract any pose information from t265 using your code. Thanks
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/IntelRealSense/librealsense/issues/4183?email_source=notifications&email_token=ADYMIIMUG2N6JRFWEZDVYA3Q5X6EFA5CNFSM4HWZ55IKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI5S3IA#issuecomment-574303648 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ADYMIINKIFYPWDT6M4PE57DQ5X6EFANCNFSM4HWZ55IA
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/IntelRealSense/librealsense/issues/4183?email_source=notifications&email_token=AKLHQT65TABSD3GKLAQDMNLQ5ZABXA5CNFSM4HWZ55IKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI6OAXI#issuecomment-574414941, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKLHQT7MUT5COLMXAM5E3P3Q5ZABXANCNFSM4HWZ55IA .
@stino78 Do I need any other dependencies / files installed for this to work. Or is there a command line argument that I need to pass for connecting two devices. Currently just running the python file gives some syntax error :
File "more_devices_test.py", line 18 def get_devices_serial_numbers(device_suffix:str='T265') -> [str]: ^ SyntaxError: invalid syntax
Please let me know if you faced similar issues.
Mmm...if you installed the sdk and the Realsense Viewer is working properly, you should be good to go
Did you check if you can import the librealsense2 properly?
What is tour level with Python? This looks like an error of cosing, maybe due to python versioning. What version are you running? OS?
On Wed, Jan 15, 2020, 20:16 Kartik Prakash [email protected] wrote:
@stino78 https://github.com/stino78 Do I need any other dependencies / files installed for this to work. Or is there a command line argument that I need to pass for connecting two devices. Currently just running the python file gives some syntax error :
File "more_devices_test.py", line 18 def get_devices_serial_numbers(device_suffix:str='T265') -> [str]: ^ SyntaxError: invalid syntax
Please let me know if you faced similar issues.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/IntelRealSense/librealsense/issues/4183?email_source=notifications&email_token=ADYMIIMUOR5IANTKIID4TYTQ55OKRA5CNFSM4HWZ55IKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJBPFYY#issuecomment-574812899, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADYMIINR3I6FIHW2G55Y6ILQ55OKRANCNFSM4HWZ55IA .
@stino78 I think python version was the issue now , I was running on Python 2.7 I ran with python 3 now. It gives the following output, Were you also getting something similar:
[DEBUG] 15:48:22.070: (MainThread) T265 (943222110577) camera is ready. [DEBUG] 15:48:22.111: (MainThread) T265 (845412111129) camera is ready. Serial experiment -------------------------------------------------- serial_numbers ['943222110577', '845412111129'] 0 0 943222110577 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.537152 1 0 943222110577 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.544937 0 1 845412111129 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.642573 1 1 845412111129 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.651024 Parallel experiment -------------------------------------------------- 0 0 943222110577 (0.00025890962569974363, -0.002097188727930188, 0.00010264413140248507) 2020-01-15 15:48:22.651212 0 1 845412111129 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.652803 1 0 943222110577 (0.00034518822212703526, -0.001163087203167379, 0.0002176408306695521) 2020-01-15 15:48:22.656179 1 1 845412111129 (-5.85176576350932e-06, -0.00012395156954880804, -4.087463821633719e-06) 2020-01-15 15:48:22.657700
Honestly, I have no idea...I started months ago and I modofoed quite much the code
The good thing with yours is that you can read the SN, which means that everything is probably working fine
On Wed, Jan 15, 2020, 22:50 Kartik Prakash [email protected] wrote:
@stino78 https://github.com/stino78 I think python version was the issue now , I was running on Python 2.7 I ran with python 3 now. It gives the following output, Were you also getting something similar:
[DEBUG] 15:48:22.070: (MainThread) T265 (943222110577) camera is ready. [DEBUG] 15:48:22.111: (MainThread) T265 (845412111129) camera is ready. Serial experiment -------------------------------------------------- serial_numbers ['943222110577', '845412111129'] 0 0 943222110577 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.537152 1 0 943222110577 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.544937 0 1 845412111129 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.642573 1 1 845412111129 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.651024 Parallel experiment -------------------------------------------------- 0 0 943222110577 (0.00025890962569974363, -0.002097188727930188, 0.00010264413140248507) 2020-01-15 15:48:22.651212 0 1 845412111129 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.652803 1 0 943222110577 (0.00034518822212703526, -0.001163087203167379, 0.0002176408306695521) 2020-01-15 15:48:22.656179 1 1 845412111129 (-5.85176576350932e-06, -0.00012395156954880804, -4.087463821633719e-06) 2020-01-15 15:48:22.657700
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/IntelRealSense/librealsense/issues/4183?email_source=notifications&email_token=ADYMIIPUZ2XGS27ITOU3FHDQ56AJRA5CNFSM4HWZ55IKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJB5W5A#issuecomment-574872436, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADYMIIPX5VA2SBY4BTQJVC3Q56AJRANCNFSM4HWZ55IA .
Thanks for your help I got it to work finally. I had to merge the code that you sent me and extract_pose code on T265's documentation. Greatly appreciate your assistance.
On Wed, Jan 15, 2020 at 4:00 PM Agostino Gibaldi [email protected] wrote:
Honestly, I have no idea...I started months ago and I modofoed quite much the code
The good thing with yours is that you can read the SN, which means that everything is probably working fine
On Wed, Jan 15, 2020, 22:50 Kartik Prakash [email protected] wrote:
@stino78 https://github.com/stino78 I think python version was the issue now , I was running on Python 2.7 I ran with python 3 now. It gives the following output, Were you also getting something similar:
[DEBUG] 15:48:22.070: (MainThread) T265 (943222110577) camera is ready. [DEBUG] 15:48:22.111: (MainThread) T265 (845412111129) camera is ready. Serial experiment -------------------------------------------------- serial_numbers ['943222110577', '845412111129'] 0 0 943222110577 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.537152 1 0 943222110577 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.544937 0 1 845412111129 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.642573 1 1 845412111129 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.651024 Parallel experiment -------------------------------------------------- 0 0 943222110577 (0.00025890962569974363, -0.002097188727930188, 0.00010264413140248507) 2020-01-15 15:48:22.651212 0 1 845412111129 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.652803 1 0 943222110577 (0.00034518822212703526, -0.001163087203167379, 0.0002176408306695521) 2020-01-15 15:48:22.656179 1 1 845412111129 (-5.85176576350932e-06, -0.00012395156954880804, -4.087463821633719e-06) 2020-01-15 15:48:22.657700
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/IntelRealSense/librealsense/issues/4183?email_source=notifications&email_token=ADYMIIPUZ2XGS27ITOU3FHDQ56AJRA5CNFSM4HWZ55IKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJB5W5A#issuecomment-574872436 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ADYMIIPX5VA2SBY4BTQJVC3Q56AJRANCNFSM4HWZ55IA
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/IntelRealSense/librealsense/issues/4183?email_source=notifications&email_token=AKLHQT6TWWYPBVZTJTE3JRDQ56BPNA5CNFSM4HWZ55IKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJB6VAA#issuecomment-574876288, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKLHQTZC5UTMDSIUV54C52TQ56BPNANCNFSM4HWZ55IA .
Glad it worked!!
On Fri, Jan 17, 2020 at 12:29 PM Kartik Prakash [email protected] wrote:
Thanks for your help I got it to work finally. I had to merge the code that you sent me and extract_pose code on T265's documentation. Greatly appreciate your assistance.
On Wed, Jan 15, 2020 at 4:00 PM Agostino Gibaldi <[email protected]
wrote:
Honestly, I have no idea...I started months ago and I modofoed quite much the code
The good thing with yours is that you can read the SN, which means that everything is probably working fine
On Wed, Jan 15, 2020, 22:50 Kartik Prakash [email protected] wrote:
@stino78 https://github.com/stino78 I think python version was the issue now , I was running on Python 2.7 I ran with python 3 now. It gives the following output, Were you also getting something similar:
[DEBUG] 15:48:22.070: (MainThread) T265 (943222110577) camera is ready. [DEBUG] 15:48:22.111: (MainThread) T265 (845412111129) camera is ready. Serial experiment -------------------------------------------------- serial_numbers ['943222110577', '845412111129'] 0 0 943222110577 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.537152 1 0 943222110577 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.544937 0 1 845412111129 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.642573 1 1 845412111129 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.651024 Parallel experiment -------------------------------------------------- 0 0 943222110577 (0.00025890962569974363, -0.002097188727930188, 0.00010264413140248507) 2020-01-15 15:48:22.651212 0 1 845412111129 (0.0, 0.0, 0.0) 2020-01-15 15:48:22.652803 1 0 943222110577 (0.00034518822212703526, -0.001163087203167379, 0.0002176408306695521) 2020-01-15 15:48:22.656179 1 1 845412111129 (-5.85176576350932e-06, -0.00012395156954880804, -4.087463821633719e-06) 2020-01-15 15:48:22.657700
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <
https://github.com/IntelRealSense/librealsense/issues/4183?email_source=notifications&email_token=ADYMIIPUZ2XGS27ITOU3FHDQ56AJRA5CNFSM4HWZ55IKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJB5W5A#issuecomment-574872436
, or unsubscribe <
https://github.com/notifications/unsubscribe-auth/ADYMIIPX5VA2SBY4BTQJVC3Q56AJRANCNFSM4HWZ55IA
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/IntelRealSense/librealsense/issues/4183?email_source=notifications&email_token=AKLHQT6TWWYPBVZTJTE3JRDQ56BPNA5CNFSM4HWZ55IKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJB6VAA#issuecomment-574876288 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AKLHQTZC5UTMDSIUV54C52TQ56BPNANCNFSM4HWZ55IA
.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/IntelRealSense/librealsense/issues/4183?email_source=notifications&email_token=ADYMIIKK5R5GNPPLEMY7U7TQ6IIJDA5CNFSM4HWZ55IKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJI4DAI#issuecomment-575783297, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADYMIIKP5NLP6DNXTZJVKXTQ6IIJDANCNFSM4HWZ55IA .