-
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
Multi-camera with RSUSB - Follow-up #6467
Merged
dorodnic
merged 4 commits into
IntelRealSense:development
from
dorodnic:radfordi-t265-config-serial
Jun 1, 2020
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b06fdd0
Support filtering USB devices (T265's) by serial number
radfordi c258646
Merge branch 't265-config-serial' of https://github.com/radfordi/libr…
dorodnic f717634
Fix unit-test for T265 with Serial, fix multicamera with LibUVC
dorodnic 5050f72
Fix rs-multicam with T265
dorodnic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,15 @@ namespace librealsense | |
{ | ||
bool filtered = false; | ||
auto data = dev->get_device_data(); | ||
for (const auto& usb : data.usb_devices) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So TM2 was just skipped... It is weird that the usb screening was not in place and yet it worked |
||
{ | ||
if (usb.vid == vid || vid == 0) | ||
{ | ||
result.push_back(dev); | ||
filtered = true; | ||
break; | ||
} | ||
} | ||
for (const auto& uvc : data.uvc_devices) | ||
{ | ||
if (uvc.vid == vid || vid == 0) | ||
|
@@ -71,21 +80,28 @@ namespace librealsense | |
{ | ||
// _camera_index is the curr device that the hub will expose | ||
auto d = _device_list[ (_camera_index + i) % _device_list.size()]; | ||
auto dev = d->create_device(_register_device_notifications); | ||
|
||
if(serial.size() > 0 ) | ||
try | ||
{ | ||
auto new_serial = dev->get_info(RS2_CAMERA_INFO_SERIAL_NUMBER); | ||
auto dev = d->create_device(_register_device_notifications); | ||
|
||
if(serial.size() > 0 ) | ||
{ | ||
auto new_serial = dev->get_info(RS2_CAMERA_INFO_SERIAL_NUMBER); | ||
|
||
if(serial == new_serial) | ||
if(serial == new_serial) | ||
{ | ||
res = dev; | ||
cycle_devices = false; // Requesting a device by its serial shall not invoke internal cycling | ||
} | ||
} | ||
else // Use the first selected if "any device" pattern was used | ||
{ | ||
res = dev; | ||
cycle_devices = false; // Requesting a device by its serial shall not invoke internal cycling | ||
} | ||
} | ||
else // Use the first selected if "any device" pattern was used | ||
} | ||
catch (const std::exception& ex) | ||
{ | ||
res = dev; | ||
LOG(WARNING) << "Could not open device " << ex.what(); | ||
} | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dorodnic, it would make this a much simpler change everywhere this change is needed to allow
enable_device()
to accept ars2::device
as well as a serial numberstring
. After all, we havedev
here and thers2::config
just wants a device. Doing the lookup again seems wasteful. It would be a bigger change to add support for this, but it would make it usage for users much cleaner going forward.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @radfordi
You are 100% right. I didn't want to expand the scope of this PR beyond simply getting your original work merged, but I also thought about it.