-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Can't start T265 in seperate thread #4961
Comments
The link below discusses at length the subject of using separate threads with T265. A summary of the conversation would be: (a) if you are using T265 and depth cameras such as the D435 or D415 together, put them all in the same thread if possible; and (b) multiple T265 in separate processes is not currently supported. Also, if you are using a D435 with a T265, make sure the D435 does not activate first before the T265. |
Thanks for the info! I've looked through this and although similar, I'm not quite in this situation. In my current test I'm not using another camera (no other RealSense is connected to the machine). However the other limitations do in general make the T265 unusable for us since multiple threads would be needed for performance, and controlling the order that RealSense nodes are created in the software isn't possible since it's a user action. |
You may get better performance if you alter the frame queue size. You can reduce latency this way, though at the trade-off of a higher risk of dropping frames. https://dev.intelrealsense.com/docs/frame-management#section-frame-drops-vs-latency |
Have you tried using the callback mechanism?
Then, when you initialize the camera:
|
That's really great info. It would be great if the exception said this as I bet this ends up being my issue |
@ev-mp What are the ramifications of sharing contexts between pipelines for other devices? I have one thread that is responsible for enumerating the cameras, which is what creates the context. Currently this context isn't used by the other threads (one thread per camera), and this works for other cameras such as the D-series. Should I
|
@mbechard, sorry for the delayed response. |
@ev-mp, great that's very helpful. One clarification though, isn't the rs2::context already implicit a shared_ptr for the rs2_context, so passing it around by value should be fine, no? Thanks! |
I believe that's correct @mbechard. Has this issue been resolved? Are you able to bring up the T265 up in it's own thread now? |
Yep, using this workaround I'm able to open up the T265 now. Thanks! |
For those that encounter this bug in the future, once #5213 is released you should be able to use T265 from it's own thread or process as with D4XX. |
@bfulkers-i Thanks so much for your work on this! |
Issue Description
Using simple setup code, I'm unable to get the T265 started if I do this work in a thread. It works fine in the main thread though.
rs2::pipeline pipe; rs2::config cfg; cfg.enable_stream(RS2_STREAM_POSE, RS2_FORMAT_6DOF); try { auto res = pipe.start(cfg); } catch (rs2::error &e) { std::cerr << e.what() << endl; return false; }
All the other devices start fine in this other thread (using different setup code), just the T265 has this issue. Error is usually 'No device connected'. RS Viewer app and other sample apps work fine though.
Is there any per-thread requirements for it? Anything about the T265 that would explain the difference?
Thanks
The text was updated successfully, but these errors were encountered: