Class VisionSourceManager

java.lang.Object
org.photonvision.vision.processes.VisionSourceManager

public class VisionSourceManager extends Object
  • Method Details

    • getInstance

      public static VisionSourceManager getInstance()
    • registerTimedTask

      public void registerTimedTask()
    • registerLoadedConfigs

      public void registerLoadedConfigs(CameraConfiguration... configs)
    • registerLoadedConfigs

      public void registerLoadedConfigs(Collection<CameraConfiguration> configs)
      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

      protected List<CameraInfo> getConnectedUSBCameras()
      Pre filter out any csi cameras to return just USB Cameras. Allow defining the camerainfo.
      Returns:
      a list containing usbcamerainfo.
    • getConnectedCSICameras

      protected List<CameraInfo> getConnectedCSICameras()
      Retrieve the list of csi cameras from libcamera.
      Returns:
      a list containing csicamerainfo.
    • tryMatchCams

      protected void tryMatchCams()
    • tryMatchCamImpl

      protected List<VisionSource> tryMatchCamImpl()
    • tryMatchCamImpl

      protected List<VisionSource> tryMatchCamImpl(ArrayList<CameraInfo> cameraInfos)
      Parameters:
      cameraInfos - Used to feed camera info for unit tests.
      Returns:
      New VisionSources.
    • matchCameras

      public List<CameraConfiguration> matchCameras(List<CameraInfo> detectedCamInfos, List<CameraConfiguration> loadedCamConfigs)
      Create CameraConfigurations based on a list of detected USB cameras and the configs on disk.
      Parameters:
      detectedCamInfos - Information about currently connected USB cameras.
      loadedCamConfigs - The USB CameraConfigurations loaded from disk.
      Returns:
      the matched configurations.
    • matchCameras

      public List<CameraConfiguration> matchCameras(List<CameraInfo> detectedCamInfos, List<CameraConfiguration> loadedCamConfigs, boolean matchCamerasOnlyByPath)
      Create CameraConfigurations based on a list of detected USB cameras and the configs on disk.
      Parameters:
      detectedCamInfos - Information about currently connected USB cameras.
      loadedCamConfigs - The USB CameraConfigurations loaded from disk.
      matchCamerasOnlyByPath - If we should never try to match only by (base name, vid, pid)
      Returns:
      the matched configurations.
    • setIgnoredCamerasRegex

      public void setIgnoredCamerasRegex(String ignoredCamerasRegex)