From 86e9678f623e7a33821bdb7b74792a36375dfbe8 Mon Sep 17 00:00:00 2001 From: Joe Lockwood Date: Sat, 16 May 2026 21:18:44 -0400 Subject: [PATCH 1/2] docs(photon-targeting): correct PhotonPipelineMetadata timestamp Javadocs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The getCaptureTimestampMicros / getPublishTimestampMicros Javadocs claim "coprocessor's time base", but NTDataPublisher applies the TimeSyncClient offset to both values before publishing — the on-wire value is in the Time Sync Server's nt::Now timebase, not the coprocessor's local clock. The field-level comment at PhotonPipelineMetadata.java:25-26 already states the correct timebase ("wpi::nt::Now on the time sync server"). This commit aligns the getter Javadocs (which users see in IDE autocomplete and online API docs) with that truth. The Python per-field comment carried the same misleading prose; updated to match. No code or behavior change. --- .../py/photonlibpy/targeting/photonPipelineResult.py | 5 +++-- .../photonvision/targeting/PhotonPipelineMetadata.java | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/photon-lib/py/photonlibpy/targeting/photonPipelineResult.py b/photon-lib/py/photonlibpy/targeting/photonPipelineResult.py index 24d5d709c0..6d0f68b3ec 100644 --- a/photon-lib/py/photonlibpy/targeting/photonPipelineResult.py +++ b/photon-lib/py/photonlibpy/targeting/photonPipelineResult.py @@ -11,8 +11,9 @@ @dataclass class PhotonPipelineMetadata: - # Image capture and NT publish timestamp, in microseconds and in the coprocessor timebase. As - # reported by WPIUtilJNI::now. + # Image capture and NT publish timestamp, in microseconds and in the Time Sync Server's + # timebase (wpi::nt::Now). The robot shall run a server, so this is FPGA-relative on a real + # robot. NTDataPublisher applies the time-sync offset before publishing. captureTimestampMicros: int = -1 publishTimestampMicros: int = -1 diff --git a/photon-targeting/src/main/java/org/photonvision/targeting/PhotonPipelineMetadata.java b/photon-targeting/src/main/java/org/photonvision/targeting/PhotonPipelineMetadata.java index e5687ca427..e6b4290aa5 100644 --- a/photon-targeting/src/main/java/org/photonvision/targeting/PhotonPipelineMetadata.java +++ b/photon-targeting/src/main/java/org/photonvision/targeting/PhotonPipelineMetadata.java @@ -58,7 +58,9 @@ public double getLatencyMillis() { } /** - * The time that this image was captured, in the coprocessor's time base. + * The time that this image was captured, in microseconds and in the Time Sync Server's time + * base ({@code wpi::nt::Now}). The robot shall run a server, so this is FPGA-relative on a real + * robot. NTDataPublisher applies the time-sync offset before publishing. * * @return The time in microseconds */ @@ -67,7 +69,9 @@ public long getCaptureTimestampMicros() { } /** - * The time that this result was published to NT, in the coprocessor's time base. + * The time that this result was published to NT, in microseconds and in the Time Sync Server's + * time base ({@code wpi::nt::Now}). The robot shall run a server, so this is FPGA-relative on a + * real robot. NTDataPublisher applies the time-sync offset before publishing. * * @return The time in microseconds */ From 78ba78874863180d26422c2d80aa36e5811c1862 Mon Sep 17 00:00:00 2001 From: Joe Lockwood Date: Sat, 16 May 2026 22:35:44 -0400 Subject: [PATCH 2/2] style(photon-targeting): rewrap PhotonPipelineMetadata getCaptureTimestampMicros Javadoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spotless (google-java-format) rejected the prior wrap because the first line fell under the 100-col target — its preferred split lands "time base" on line 1 and "real robot." on line 2. CI Java Formatting job failed on this file only. Pure whitespace reflow; identical wording. --- .../org/photonvision/targeting/PhotonPipelineMetadata.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/photon-targeting/src/main/java/org/photonvision/targeting/PhotonPipelineMetadata.java b/photon-targeting/src/main/java/org/photonvision/targeting/PhotonPipelineMetadata.java index e6b4290aa5..be4e73a31b 100644 --- a/photon-targeting/src/main/java/org/photonvision/targeting/PhotonPipelineMetadata.java +++ b/photon-targeting/src/main/java/org/photonvision/targeting/PhotonPipelineMetadata.java @@ -58,9 +58,9 @@ public double getLatencyMillis() { } /** - * The time that this image was captured, in microseconds and in the Time Sync Server's time - * base ({@code wpi::nt::Now}). The robot shall run a server, so this is FPGA-relative on a real - * robot. NTDataPublisher applies the time-sync offset before publishing. + * The time that this image was captured, in microseconds and in the Time Sync Server's time base + * ({@code wpi::nt::Now}). The robot shall run a server, so this is FPGA-relative on a real robot. + * NTDataPublisher applies the time-sync offset before publishing. * * @return The time in microseconds */