mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
Expose NT entry change time in PhotonLib (#562)
Adds target change timestamp to PhotonPipelineResult Co-authored-by: Matt <matthew.morley.ca@gmail.com>
This commit is contained in:
@@ -32,6 +32,9 @@ public class PhotonPipelineResult {
|
||||
// Latency in milliseconds.
|
||||
private double latencyMillis;
|
||||
|
||||
// Timestamp in milliseconds.
|
||||
private double timestampSeconds = -1;
|
||||
|
||||
/** Constructs an empty pipeline result. */
|
||||
public PhotonPipelineResult() {}
|
||||
|
||||
@@ -83,6 +86,25 @@ public class PhotonPipelineResult {
|
||||
return latencyMillis;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the estimated time the frame was taken, This is more accurate than using <code>
|
||||
* getLatencyMillis()</code>
|
||||
*
|
||||
* @return The timestamp in seconds, or -1 if this result has no timestamp set.
|
||||
*/
|
||||
public double getTimestampSeconds() {
|
||||
return timestampSeconds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the FPGA timestamp of this result in seconds.
|
||||
*
|
||||
* @param timestampSeconds The timestamp in seconds.
|
||||
*/
|
||||
public void setTimestampSeconds(double timestampSeconds) {
|
||||
this.timestampSeconds = timestampSeconds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the pipeline has targets.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user