PhotonPipelineResult

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

Bases: pybind11_object

Represents a pipeline result from a PhotonCamera.

Overloaded function.

  1. __init__(self: photonvision._photonvision.PhotonPipelineResult) -> None

Constructs an empty pipeline result.

  1. __init__(self: photonvision._photonvision.PhotonPipelineResult, latency: seconds, targets: List[photonvision._photonvision.PhotonTrackedTarget]) -> None

Constructs a pipeline result.

Parameters:
  • latency – The latency in the pipeline.

  • targets – The list of targets identified by the pipeline.

getBestTarget() photonvision._photonvision.PhotonTrackedTarget

Returns the best target in this pipeline result. If there are no targets, this method will return an empty target with all values set to zero. The best target is determined by the target sort mode in the PhotonVision UI.

Returns:

The best target of the pipeline result.

getLatency() seconds

Returns the latency in the pipeline.

Returns:

The latency in the pipeline.

getTargets() List[photonvision._photonvision.PhotonTrackedTarget]

Returns a reference to the vector of targets.

Returns:

A reference to the vector of targets.

getTimestamp() seconds

Returns the estimated time the frame was taken, This is much more accurate than using GetLatency()

Returns:

The timestamp in seconds or -1 if this result was not initiated with a timestamp.

hasTargets() bool

Returns whether the pipeline has targets.

Returns:

Whether the pipeline has targets.

setTimestamp(timestamp: seconds) None

Sets the timestamp in seconds

Parameters:

timestamp – The timestamp in seconds