Class CameraConfiguration

java.lang.Object
org.photonvision.common.configuration.CameraConfiguration

public class CameraConfiguration extends Object
  • Field Details

    • uniqueName

      public String uniqueName
      A unique name (ostensibly an opaque UUID) to identify this particular configuration
    • matchedCameraInfo

      public PVCameraInfo matchedCameraInfo
      The info of the camera we last matched to. We still match by unique path (where we can), but this is useful to provide warnings to users
    • nickname

      public String nickname
      User-set nickname
    • deactivated

      public boolean deactivated
      Deactivated vision modules do not open camera hardware or lock USB ports
    • cameraQuirks

      public QuirkyCamera cameraQuirks
    • FOV

      public double FOV
    • calibrations

      public List<CameraCalibrationCoefficients> calibrations
    • currentPipelineIndex

      public int currentPipelineIndex
    • streamIndex

      public int streamIndex
    • pipelineSettings

      public List<CVPipelineSettings> pipelineSettings
    • driveModeSettings

      public DriverModePipelineSettings driveModeSettings
  • Constructor Details

    • CameraConfiguration

      public CameraConfiguration(PVCameraInfo cameraInfo, String uniqueName, String nickname)
    • CameraConfiguration

      public CameraConfiguration(String uniqueName, PVCameraInfo matchedCameraInfo, String nickname, boolean deactivated, QuirkyCamera cameraQuirks, double FOV, List<CameraCalibrationCoefficients> calibrations, int currentPipelineIndex)
    • CameraConfiguration

      public CameraConfiguration(String uniqueName, PVCameraInfo camInfo)
    • CameraConfiguration

      public CameraConfiguration(PVCameraInfo camInfo)
      Constructor for when we don't know anything about the camera yet. Generates a UUID for the unique name
  • Method Details

    • addPipelineSettings

      public void addPipelineSettings(List<CVPipelineSettings> settings)
    • addPipelineSetting

      public void addPipelineSetting(CVPipelineSettings setting)
    • setPipelineSettings

      public void setPipelineSettings(List<CVPipelineSettings> settings)
    • addCalibration

      public void addCalibration(CameraCalibrationCoefficients calibration)
      Replace a calibration in our list with the same unrotatedImageSize with a new one, or add it if none exists yet. If we are replacing an existing calibration, the old one will be "released" and the underlying data matrices will become invalid.
      Parameters:
      calibration - The calibration to add.
    • getDevicePath

      public String getDevicePath()
      cscore will auto-reconnect to the camera path we give it. v4l does not guarantee that if i swap cameras around, the same /dev/videoN ID will be assigned to that camera. So instead default to pinning to a particular USB port, or by "path" (appears to be a global identifier on Windows).

      This represents our best guess at an immutable path to detect a camera at.

    • toShortString

      public String toShortString()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toUiConfig

      public UICameraConfiguration toUiConfig()
      UICameraConfiguration has some stuff particular to VisionModule, but enough of it's common to warrant this helper