Photon Pipeline Result¶
What is a Photon Pipeline Result?¶
PhotonPipelineResult is a container that contains all information about currently detected targets from a
PhotonCamera. You can retrieve the latest pipeline result using the
GetLatestResult() (Java and C++ respectively) on a
Checking for Existence of Targets¶
Each pipeline result has a
HasTargets() (Java and C++ respectively) method to inform the user as to whether the result contains any targets.
You must always check if the result has a target via
HasTargets() before getting targets or else you may get a null pointer exception. Further, you must use the same result in every subsequent call in that loop.
Getting a List of Targets¶
You can get a list of tracked targets using the
GetTargets() (Java and C++ respectively) method from a pipeline result.
Getting the Best Target¶
You can get the best target using
GetBestTarget() (Java and C++ respectively) method from the pipeline result.
Getting the Pipeline Latency¶
You can also get the pipeline latency from a pipeline result using the
GetLatency() (Java and C++ respectively) methods.
The C++ version of PhotonLib returns the latency in a unit container. For more information on the Units library, see here.