PhotonVision / photonvision

PhotonVision is the free, fast, and easy-to-use computer vision solution for the FIRST Robotics Competition.
https://photonvision.org
GNU General Public License v3.0
264 stars 180 forks source link

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

Closed mcm001 closed 6 months ago

mcm001 commented 6 months ago

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