PhotonCamera

class photonvision.PhotonCamera(*args, **kwargs)

Bases: pybind11_builtins.pybind11_object

Represents a camera that is connected to PhotonVision.ß

Overloaded function.

  1. __init__(self: photonvision._photonvision.PhotonCamera, instance: _pyntcore._ntcore.NetworkTablesInstance, cameraName: str) -> None

Constructs a PhotonCamera from a root table.

Parameters
  • instance – The NetworkTableInstance to pull data from. This can be a custom instance in simulation, but should usually be the default NTInstance from {@link NetworkTableInstance::getDefault}

  • cameraName – The name of the camera, as seen in the UI. over.

  1. __init__(self: photonvision._photonvision.PhotonCamera, cameraName: str) -> None

Constructs a PhotonCamera from the name of the camera.

Parameters

cameraName – The nickname of the camera (found in the PhotonVision UI).

getDriverMode() bool

Returns whether the camera is in driver mode.

Returns

Whether the camera is in driver mode.

getLEDMode() photonvision._photonvision.LEDMode

Returns the current LED mode.

Returns

The current LED mode.

getLatestResult() photonvision._photonvision.PhotonPipelineResult

Returns the latest pipeline result.

Returns

The latest pipeline result.

getPipelineIndex() int

Returns the active pipeline index.

Returns

The active pipeline index.

hasTargets() bool
setDriverMode(driverMode: bool) None

Toggles driver mode.

Parameters

driverMode – Whether to set driver mode.

setLEDMode(led: photonvision._photonvision.LEDMode) None

Sets the LED mode.

Parameters

led – The mode to set to.

setPipelineIndex(index: int) None

Allows the user to select the active pipeline index.

Parameters

index – The active pipeline index.

static setVersionCheckEnabled(enabled: bool) None
takeInputSnapshot() None

Request the camera to save a new image file from the input camera stream with overlays. Images take up space in the filesystem of the PhotonCamera. Calling it frequently will fill up disk space and eventually cause the system to stop working. Clear out images in /opt/photonvision/photonvision_config/imgSaves frequently to prevent issues.

takeOutputSnapshot() None

Request the camera to save a new image file from the output stream with overlays. Images take up space in the filesystem of the PhotonCamera. Calling it frequently will fill up disk space and eventually cause the system to stop working. Clear out images in /opt/photonvision/photonvision_config/imgSaves frequently to prevent issues.