mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-03 03:01:40 +00:00
Supercedes https://github.com/PhotonVision/photonvision/pull/1223 --------- Co-authored-by: vladb <vlad.bondar@frc5113.com>
This commit is contained in:
@@ -58,5 +58,14 @@ class PhotonPipelineResult:
|
||||
def getTargets(self) -> list[PhotonTrackedTarget]:
|
||||
return self.targets
|
||||
|
||||
def getBestTarget(self) -> PhotonTrackedTarget:
|
||||
"""
|
||||
Returns the best target in this pipeline result. If there are no targets, this method will
|
||||
return null. The best target is determined by the target sort mode in the PhotonVision UI.
|
||||
"""
|
||||
if not self.hasTargets():
|
||||
return None
|
||||
return self.getTargets()[0]
|
||||
|
||||
def hasTargets(self) -> bool:
|
||||
return len(self.targets) > 0
|
||||
|
||||
Reference in New Issue
Block a user