Repository navigation
Fix config resolution issue on initial T265 plug in - #4506
pietroglyph wants to merge 2 commits into
Conversation
|
@pietroglyph , thanks for the proposal but there is already a work undertaken by @orshefi #4302 that should address the root cause of non-deterministic T265 connections. |
|
Why doesn't the result of |
The |
|
This should be fixed by #5213. |
$ rs-enumerate-devices --version
rs-enumerate-devices version: 2.32.1
$ rs-enumerate-devices -d
Device info:
Name : Intel RealSense T265
Serial Number : 0000929122110084
Firmware Version : 0.2.0.926
Physical Port : 2-1-17
Product Id : 0B37
Usb Type Descriptor : 3.1
Product Line : T200
Default streams:
RealSense error calling rs2_config_resolve(config:0x56340e8e1040, pipe:0x56340e8e64a0):
No device connected
AFAIU #5213 is part of 2.32.1 release but the problem with |
If you plug in your T265 camera and run the following code you will get a "No device connected" exception:
The program will work fine on all subsequent runs until you disconnect and reconnect the T265 camera. If you attempt to add code to retry the
config.resolvestep you will still encounter this failure.This bug was consistently reproducible on librealsense v2.24.0 on my system (Linux 5.1.16-200.fc29.x86_64) and another more exotic (and unsupported) armv7 system I am cross compiling to.
After some light debugging it became clear that you could resolve your config on the initial plug in of the T265 if you had already started streaming from a
rs2::pipeline. Further inspection of the librealsense source made it clear thatrs2::pipeline::startandrs2::config::resolvewere calling the internallibrealsense::pipeline::config::resolvemethod in all the same ways, except thatrs2::pipeline::start(i.e. one that worked) called resolve with a 5 second timeout and would retry 3 times.That meant that the most minimal fix was copying the retry code to
rs2_config_resolve. That is what is included in this PR.Another less minimal fix that I would be happy to submit instead would be to factor all the retrying code into
librealsense::pipeline::config::resolve, and always use a timeout of 5 seconds. This may be better because a) it reduces code duplication, and b) it means that you can no longer calllibrealsense::pipeline::config::resolvein a buggy way. You can preview this change here.Let me know if you have any questions or comments, and please review the two possible fixes and indicate which you would prefer I submit. (Note that all of the options to fix this that I've presented still don't fix the root of this issue; it may be more appropriate to fix this at a lower level instead of propagating the retry hack included in this PR.)
Thanks!