PhotonVision C++ dev-v2025.0.0-beta-8-2-gbd1c5c03
Loading...
Searching...
No Matches
photon::PhotonPipelineResult Class Reference

Represents a pipeline result from a PhotonCamera. More...

#include <photon/targeting/PhotonPipelineResult.h>

Inheritance diagram for photon::PhotonPipelineResult:
photon::PhotonPipelineResult_PhotonStruct

Public Member Functions

 PhotonPipelineResult ()
 
 PhotonPipelineResult (Base &&data)
 
 PhotonPipelineResult (const PhotonPipelineResult &other)
 
 PhotonPipelineResult (PhotonPipelineResult &other)
 
 PhotonPipelineResult (PhotonPipelineResult &&other)
 
auto & operator= (const PhotonPipelineResult &other)
 
auto & operator= (PhotonPipelineResult &&other)
 
template<typename... Args>
 PhotonPipelineResult (Args &&... args)
 
PhotonTrackedTarget GetBestTarget () const
 Returns the best target in this pipeline result.
 
units::millisecond_t GetLatency () const
 Returns the latency in the pipeline.
 
units::second_t GetTimestamp () const
 Returns the estimated time the frame was taken, This is much more accurate than using GetLatency()
 
const std::optional< MultiTargetPNPResult > & MultiTagResult () const
 Return the latest mulit-target result, as calculated on your coprocessor.
 
int64_t SequenceID () const
 The number of non-empty frames processed by this camera since boot.
 
void SetReceiveTimestamp (const units::second_t timestamp)
 Sets the FPGA timestamp this result was Received by robot code.
 
bool HasTargets () const
 Returns whether the pipeline has targets.
 
const std::span< const PhotonTrackedTargetGetTargets () const
 Returns a reference to the vector of targets.
 

Public Attributes

units::microsecond_t ntReceiveTimestamp = -1_s
 
- Public Attributes inherited from photon::PhotonPipelineResult_PhotonStruct
photon::PhotonPipelineMetadata metadata
 
std::vector< photon::PhotonTrackedTargettargets
 
std::optional< photon::MultiTargetPNPResultmultitagResult
 

Static Public Attributes

static bool HAS_WARNED = false
 

Friends

bool operator== (PhotonPipelineResult const &, PhotonPipelineResult const &)=default
 

Detailed Description

Represents a pipeline result from a PhotonCamera.

Constructor & Destructor Documentation

◆ PhotonPipelineResult() [1/6]

photon::PhotonPipelineResult::PhotonPipelineResult ( )
inline

◆ PhotonPipelineResult() [2/6]

photon::PhotonPipelineResult::PhotonPipelineResult ( Base && data)
inlineexplicit

◆ PhotonPipelineResult() [3/6]

photon::PhotonPipelineResult::PhotonPipelineResult ( const PhotonPipelineResult & other)
inline

◆ PhotonPipelineResult() [4/6]

photon::PhotonPipelineResult::PhotonPipelineResult ( PhotonPipelineResult & other)
inline

◆ PhotonPipelineResult() [5/6]

photon::PhotonPipelineResult::PhotonPipelineResult ( PhotonPipelineResult && other)
inline

◆ PhotonPipelineResult() [6/6]

template<typename... Args>
photon::PhotonPipelineResult::PhotonPipelineResult ( Args &&... args)
inlineexplicit

Member Function Documentation

◆ GetBestTarget()

PhotonTrackedTarget photon::PhotonPipelineResult::GetBestTarget ( ) const
inline

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.

Returns
The best target of the pipeline result.

◆ GetLatency()

units::millisecond_t photon::PhotonPipelineResult::GetLatency ( ) const
inline

Returns the latency in the pipeline.

Returns
The latency in the pipeline.

◆ GetTargets()

const std::span< const PhotonTrackedTarget > photon::PhotonPipelineResult::GetTargets ( ) const
inline

Returns a reference to the vector of targets.

Returned in the order set by target sort mode.

Returns
A reference to the vector of targets.

◆ GetTimestamp()

units::second_t photon::PhotonPipelineResult::GetTimestamp ( ) const
inline

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 photon::PhotonPipelineResult::HasTargets ( ) const
inline

Returns whether the pipeline has targets.

Returns
Whether the pipeline has targets.

◆ MultiTagResult()

const std::optional< MultiTargetPNPResult > & photon::PhotonPipelineResult::MultiTagResult ( ) const
inline

Return the latest mulit-target result, as calculated on your coprocessor.

Be sure to check getMultiTagResult().estimatedPose.isPresent before using the pose estimate!

◆ operator=() [1/2]

auto & photon::PhotonPipelineResult::operator= ( const PhotonPipelineResult & other)
inline

◆ operator=() [2/2]

auto & photon::PhotonPipelineResult::operator= ( PhotonPipelineResult && other)
inline

◆ SequenceID()

int64_t photon::PhotonPipelineResult::SequenceID ( ) const
inline

The number of non-empty frames processed by this camera since boot.

Useful to checking if a camera is alive.

◆ SetReceiveTimestamp()

void photon::PhotonPipelineResult::SetReceiveTimestamp ( const units::second_t timestamp)
inline

Sets the FPGA timestamp this result was Received by robot code.

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( PhotonPipelineResult const & ,
PhotonPipelineResult const &  )
friend

Member Data Documentation

◆ HAS_WARNED

bool photon::PhotonPipelineResult::HAS_WARNED = false
inlinestatic

◆ ntReceiveTimestamp

units::microsecond_t photon::PhotonPipelineResult::ntReceiveTimestamp = -1_s

The documentation for this class was generated from the following file: