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

Add matching by base-name only (fused off by only by path) #1238

Merged
merged 6 commits into from
Feb 19, 2024

Conversation

mcm001
Copy link
Contributor

@mcm001 mcm001 commented Feb 17, 2024

When migrating from 2024.2.5 to 6, VID/PID will not be set causing matching to never succeed. New matching output:

[2024-02-17 16:11:06] [Camera - VisionSourceManager] [INFO] Detected unmatched physical camera: CameraInfo [cameraType=UsbCamerabaseName=HD Pro Webcam C920, vid=1133, pid=2277, otherPaths=[/dev/v4l/by-id/usb-046d_HD_Pro_Webcam_C920_1AA0F86F-video-index0, /dev/v4l/by-path/platform-fc800000.usb-usb-0:1.3:1.0-video-index0]]
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [INFO] Detected unmatched physical camera: CameraInfo [cameraType=UsbCamerabaseName=Microsoft LifeCam HD-3000, vid=1118, pid=2064, otherPaths=[/dev/v4l/by-id/usb-Microsoft_Microsoft?_LifeCam_HD-3000-video-index0, /dev/v4l/by-path/platform-fc800000.usb-usb-0:1.4:1.0-video-index0]]
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] Trying to match 2 unmatched configs...
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [INFO] Matching by usb port & name & USB VID/PID...
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] Trying to find a match for loaded camera HD Pro Webcam C920 by strategy (path true vid/pid true basename true path false) with camera config: [baseName=HD Pro Webcam C920, uniqueName=HD_Pro_Webcam_C920, otherPaths=[/dev/v4l/by-id/usb-046d_HD_Pro_Webcam_C920_1AA0F86F-video-index0, /dev/v4l/by-path/platform-fc800000.usb-usb-0:1.3:1.0-video-index0], vid=0, pid=0]
[main] INFO io.javalin.Javalin - Listening on http://localhost:5800/
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] No camera found for the config HD Pro Webcam C920
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] Trying to find a match for loaded camera Microsoft LifeCam HD-3000 by strategy (path true vid/pid true basename true path false) with camera config: [baseName=Microsoft LifeCam HD-3000, uniqueName=Microsoft_LifeCam_HD-3000, otherPaths=[/dev/v4l/by-id/usb-Microsoft_Microsoft?_LifeCam_HD-3000-video-index0, /dev/v4l/by-path/platform-fc800000.usb-usb-0:1.4:1.0-video-index0], vid=0, pid=0]
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] No camera found for the config Microsoft LifeCam HD-3000
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [INFO] Matching by usb port & USB VID/PID...
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] Trying to find a match for loaded camera HD Pro Webcam C920 by strategy (path true vid/pid true basename false path false) with camera config: [baseName=HD Pro Webcam C920, uniqueName=HD_Pro_Webcam_C920, otherPaths=[/dev/v4l/by-id/usb-046d_HD_Pro_Webcam_C920_1AA0F86F-video-index0, /dev/v4l/by-path/platform-fc800000.usb-usb-0:1.3:1.0-video-index0], vid=0, pid=0]
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] No camera found for the config HD Pro Webcam C920
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] Trying to find a match for loaded camera Microsoft LifeCam HD-3000 by strategy (path true vid/pid true basename false path false) with camera config: [baseName=Microsoft LifeCam HD-3000, uniqueName=Microsoft_LifeCam_HD-3000, otherPaths=[/dev/v4l/by-id/usb-Microsoft_Microsoft?_LifeCam_HD-3000-video-index0, /dev/v4l/by-path/platform-fc800000.usb-usb-0:1.4:1.0-video-index0], vid=0, pid=0]
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] No camera found for the config Microsoft LifeCam HD-3000
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [INFO] Matching by base-name & USB VID/PID only...
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] Trying to find a match for loaded camera HD Pro Webcam C920 by strategy (path false vid/pid true basename true path false) with camera config: [baseName=HD Pro Webcam C920, uniqueName=HD_Pro_Webcam_C920, otherPaths=[/dev/v4l/by-id/usb-046d_HD_Pro_Webcam_C920_1AA0F86F-video-index0, /dev/v4l/by-path/platform-fc800000.usb-usb-0:1.3:1.0-video-index0], vid=0, pid=0]
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] No camera found for the config HD Pro Webcam C920
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] Trying to find a match for loaded camera Microsoft LifeCam HD-3000 by strategy (path false vid/pid true basename true path false) with camera config: [baseName=Microsoft LifeCam HD-3000, uniqueName=Microsoft_LifeCam_HD-3000, otherPaths=[/dev/v4l/by-id/usb-Microsoft_Microsoft?_LifeCam_HD-3000-video-index0, /dev/v4l/by-path/platform-fc800000.usb-usb-0:1.4:1.0-video-index0], vid=0, pid=0]
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] No camera found for the config Microsoft LifeCam HD-3000
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [INFO] Matching by base-name & USB VID/PID only...
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] Trying to find a match for loaded camera HD Pro Webcam C920 by strategy (path false vid/pid false basename true path false) with camera config: [baseName=HD Pro Webcam C920, uniqueName=HD_Pro_Webcam_C920, otherPaths=[/dev/v4l/by-id/usb-046d_HD_Pro_Webcam_C920_1AA0F86F-video-index0, /dev/v4l/by-path/platform-fc800000.usb-usb-0:1.3:1.0-video-index0], vid=0, pid=0]
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] Matched the config for HD Pro Webcam C920 to a physical camera!
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] Trying to find a match for loaded camera Microsoft LifeCam HD-3000 by strategy (path false vid/pid false basename true path false) with camera config: [baseName=Microsoft LifeCam HD-3000, uniqueName=Microsoft_LifeCam_HD-3000, otherPaths=[/dev/v4l/by-id/usb-Microsoft_Microsoft?_LifeCam_HD-3000-video-index0, /dev/v4l/by-path/platform-fc800000.usb-usb-0:1.4:1.0-video-index0], vid=0, pid=0]
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] Matched the config for Microsoft LifeCam HD-3000 to a physical camera!
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] Matched or created 2 camera configs!
[2024-02-17 16:11:06] [Camera - VisionSourceManager] [DEBUG] Creating VisionSource for [baseName=HD Pro Webcam C920, uniqueName=HD_Pro_Webcam_C920, otherPaths=[/dev/v4l/by-id/usb-046d_HD_Pro_Webcam_C920_1AA0F86F-video-index0, /dev/v4l/by-path/platform-fc800000.usb-usb-0:1.3:1.0-video-index0], vid=0, pid=0]

Also makes the switch disable creation of new VisionModules
image
image

@mcm001 mcm001 requested a review from a team as a code owner February 17, 2024 16:07
Copy link
Contributor

@mdurrani808 mdurrani808 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm but would be nice to have a good chunk of people test this before we pass this through so we're sure it actually fixes things

@mcm001 mcm001 merged commit 2a9502b into PhotonVision:master Feb 19, 2024
23 checks passed
@mcm001 mcm001 deleted the camera-matching-fix branch February 19, 2024 02:00
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.

2 participants