Class VisionSourceManager
java.lang.Object
org.photonvision.vision.processes.VisionSourceManager
-
Method Summary
Modifier and TypeMethodDescriptionprotected List<CameraInfo>
Retrieve the list of csi cameras from libcamera.protected List<CameraInfo>
Pre filter out any csi cameras to return just USB Cameras.static VisionSourceManager
matchCameras
(List<CameraInfo> detectedCamInfos, List<CameraConfiguration> loadedCamConfigs) CreateCameraConfiguration
s based on a list of detected USB cameras and the configs on disk.matchCameras
(List<CameraInfo> detectedCamInfos, List<CameraConfiguration> loadedCamConfigs, boolean matchCamerasOnlyByPath) CreateCameraConfiguration
s based on a list of detected USB cameras and the configs on disk.void
Register new camera configs loaded from disk.void
registerLoadedConfigs
(CameraConfiguration... configs) void
void
setIgnoredCamerasRegex
(String ignoredCamerasRegex) protected List<VisionSource>
protected List<VisionSource>
tryMatchCamImpl
(ArrayList<CameraInfo> cameraInfos) protected List<VisionSource>
tryMatchCamImpl
(ArrayList<CameraInfo> cameraInfos, Platform platform) protected void
-
Method Details
-
getInstance
-
registerTimedTask
public void registerTimedTask() -
registerLoadedConfigs
-
registerLoadedConfigs
Register new camera configs loaded from disk. This will add them to the list of configs to try to match, and also automatically spawn new vision processes as necessary.- Parameters:
configs
- The loaded camera configs.
-
getConnectedUSBCameras
Pre filter out any csi cameras to return just USB Cameras. Allow defining the camerainfo.- Returns:
- a list containing usbcamerainfo.
-
getConnectedCSICameras
Retrieve the list of csi cameras from libcamera.- Returns:
- a list containing csicamerainfo.
-
tryMatchCams
protected void tryMatchCams() -
tryMatchCamImpl
-
tryMatchCamImpl
-
tryMatchCamImpl
- Parameters:
cameraInfos
- Used to feed camera info for unit tests.- Returns:
- New VisionSources.
-
matchCameras
public List<CameraConfiguration> matchCameras(List<CameraInfo> detectedCamInfos, List<CameraConfiguration> loadedCamConfigs) CreateCameraConfiguration
s based on a list of detected USB cameras and the configs on disk.- Parameters:
detectedCamInfos
- Information about currently connected USB cameras.loadedCamConfigs
- The USBCameraConfiguration
s loaded from disk.- Returns:
- the matched configurations.
-
matchCameras
public List<CameraConfiguration> matchCameras(List<CameraInfo> detectedCamInfos, List<CameraConfiguration> loadedCamConfigs, boolean matchCamerasOnlyByPath) CreateCameraConfiguration
s based on a list of detected USB cameras and the configs on disk.- Parameters:
detectedCamInfos
- Information about currently connected USB cameras.loadedCamConfigs
- The USBCameraConfiguration
s loaded from disk.matchCamerasOnlyByPath
- If we should never try to match only by (base name, vid, pid)- Returns:
- the matched configurations.
-
setIgnoredCamerasRegex
-