Class VisionSourceManager
java.lang.Object
org.photonvision.vision.processes.VisionSourceManager
This class manages starting up VisionModules for serialized devices (
loadVisionSourceFromCamConfig(org.photonvision.common.configuration.CameraConfiguration)
), as well as handling requests from users to
disable (release the camera device, but keep the configuration around) (deactivateVisionSource(java.lang.String)
), reactivate (recreate a VisionModule from a saved
and currently disabled configuration) (reactivateDisabledCameraConfig(java.lang.String)
), and create a new VisionModule from a PVCameraInfo
(assignUnmatchedCamera(org.photonvision.vision.camera.PVCameraInfo)
).
We now require user interaction for pretty much every operation this undertakes.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
assignUnmatchedCamera
(PVCameraInfo cameraInfo) Assign a camera that currently has no associated CameraConfiguration loaded.boolean
deactivateVisionSource
(String uniqueName) boolean
deleteVisionSource
(String uniqueName) protected List<PVCameraInfo>
static VisionSourceManager
protected VisionSource
loadVisionSourceFromCamConfig
(CameraConfiguration configuration) Convert a configuration into a VisionSource.protected void
boolean
reactivateDisabledCameraConfig
(String uniqueName) Reactivate a previously created vision sourcevoid
Register new camera configs loaded from disk.void
-
Field Details
-
disabledCameraConfigs
-
vmm
-
-
Constructor Details
-
VisionSourceManager
public VisionSourceManager()
-
-
Method Details
-
getInstance
-
registerTimedTasks
public void registerTimedTasks() -
registerLoadedConfigs
Register new camera configs loaded from disk. This will create vision modules for each camera config and start them.- Parameters:
configs
- The loaded camera configs.
-
reactivateDisabledCameraConfig
Reactivate a previously created vision source- Parameters:
uniqueName
-
-
assignUnmatchedCamera
Assign a camera that currently has no associated CameraConfiguration loaded.- Parameters:
cameraInfo
-
-
deleteVisionSource
-
deactivateVisionSource
-
getVsmState
-
pushUiUpdate
protected void pushUiUpdate() -
getConnectedCameras
-
loadVisionSourceFromCamConfig
Convert a configuration into a VisionSource. The VisionSource type is pulled from theCameraConfiguration
's matchedCameraInfo. We depend on the underlyingVisionSource
to be robust to disconnected sources at bootVerify that nickname is unique within the set of deserialized camera configurations, adding random characters if this isn't the case
-
getVisionModules
-