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

Actually properly match cameras by name fr this time #1237

Merged
merged 12 commits into from
Feb 16, 2024

Conversation

mcm001
Copy link
Contributor

@mcm001 mcm001 commented Feb 16, 2024

Our current code matches cameras in this order (which I think is objectively wrong and stupid)

  • by-id (/dev/v4l/by-id/product-string)
  • by path (/dev/videoN)
  • product string/name, but ascii only
  • asks cscore to reconnect to cameras using path, which on linux is actually /dev/videoN. This isn't guaranteed to stick to a camera if you replug them weirdly at runtime.

This is silly and does not consider the actual physical usb port. I propose instead, in this order:

  • By physical usb port path and base name
  • by physical usb port path and USB VID/PID
  • By base name only (with a toggle switch to disable this, and create a new VisionModule instead)
  • Give cscore /dev/video/by-path on Linux systems, pinning Photon USBCameras to a particular usb port once created.

@mcm001 mcm001 requested a review from a team as a code owner February 16, 2024 04:48
@mcm001 mcm001 merged commit 428f926 into PhotonVision:master Feb 16, 2024
23 checks passed
@mcm001 mcm001 deleted the camera-matching-fix branch February 16, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants