From 78cc25fa537129daea1612883d309e1211029fc4 Mon Sep 17 00:00:00 2001 From: Chris Gerth Date: Wed, 22 Apr 2026 19:59:34 -0500 Subject: [PATCH 1/3] Update latency retrieval to use timestamp method --- .../docs/programming/photonlib/driver-mode-pipeline-index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/docs/programming/photonlib/driver-mode-pipeline-index.md b/docs/source/docs/programming/photonlib/driver-mode-pipeline-index.md index fbb22095a7..e2c2a75e1c 100644 --- a/docs/source/docs/programming/photonlib/driver-mode-pipeline-index.md +++ b/docs/source/docs/programming/photonlib/driver-mode-pipeline-index.md @@ -55,12 +55,12 @@ You can also get the pipeline latency from a pipeline result using the `getLaten .. code-block:: java // Get the pipeline latency. - double latencySeconds = result.getLatencyMillis() / 1000.0; + double latencySeconds = result.getTimestampSeconds() / 1000.0; .. code-block:: c++ // Get the pipeline latency. - units::second_t latency = result.GetLatency(); + units::second_t latency = result.GetTimestampSeconds(); .. code-block:: python From 6aaa81fb395082df25416974ea61b85162cca353 Mon Sep 17 00:00:00 2001 From: Chris Gerth Date: Wed, 22 Apr 2026 20:02:38 -0500 Subject: [PATCH 2/3] moar words --- .../programming/photonlib/driver-mode-pipeline-index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/docs/programming/photonlib/driver-mode-pipeline-index.md b/docs/source/docs/programming/photonlib/driver-mode-pipeline-index.md index e2c2a75e1c..23f470ac1f 100644 --- a/docs/source/docs/programming/photonlib/driver-mode-pipeline-index.md +++ b/docs/source/docs/programming/photonlib/driver-mode-pipeline-index.md @@ -46,9 +46,9 @@ You can use the `setPipelineIndex()`/`SetPipelineIndex()` (Java and C++ respecti # Coming Soon! ``` -## Getting the Pipeline Latency +## Getting the Pipeline Image Capture Time -You can also get the pipeline latency from a pipeline result using the `getLatencyMillis()`/`GetLatency()` (Java and C++ respectively) methods on a `PhotonPipelineResult`. +You can also get the pipeline's image capture time from a pipeline result using the `getTimestampSeconds()`/`GetTimestamp()` (Java and C++ respectively) methods on a `PhotonPipelineResult`. ```{eval-rst} .. tab-set-code:: @@ -60,7 +60,7 @@ You can also get the pipeline latency from a pipeline result using the `getLaten .. code-block:: c++ // Get the pipeline latency. - units::second_t latency = result.GetTimestampSeconds(); + units::second_t latency = result.GetTimestamp(); .. code-block:: python From 6236d896f9d70248434e37d68459f50719915105 Mon Sep 17 00:00:00 2001 From: Chris Gerth Date: Thu, 23 Apr 2026 19:01:49 -0500 Subject: [PATCH 3/3] ctrl-f `latency` and nuke yeetus the latencius --- .../photonlib/driver-mode-pipeline-index.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/source/docs/programming/photonlib/driver-mode-pipeline-index.md b/docs/source/docs/programming/photonlib/driver-mode-pipeline-index.md index 23f470ac1f..79262fe324 100644 --- a/docs/source/docs/programming/photonlib/driver-mode-pipeline-index.md +++ b/docs/source/docs/programming/photonlib/driver-mode-pipeline-index.md @@ -48,19 +48,19 @@ You can use the `setPipelineIndex()`/`SetPipelineIndex()` (Java and C++ respecti ## Getting the Pipeline Image Capture Time -You can also get the pipeline's image capture time from a pipeline result using the `getTimestampSeconds()`/`GetTimestamp()` (Java and C++ respectively) methods on a `PhotonPipelineResult`. +You can also get the pipeline's image capture time from a pipeline result using the `getTimestampSeconds()`/`GetTimestamp()` (Java and C++ respectively) methods on a `PhotonPipelineResult`. This is useful when adding vision pose estimates to a pose estimator or Kalman Filter, to help express the idea that camera image for the estimates was taken some time in the past. ```{eval-rst} .. tab-set-code:: .. code-block:: java - // Get the pipeline latency. - double latencySeconds = result.getTimestampSeconds() / 1000.0; + // Get the pipeline image capture timestamp. + double resultTime = result.getTimestampSeconds() / 1000.0; .. code-block:: c++ - // Get the pipeline latency. - units::second_t latency = result.GetTimestamp(); + // Get the pipeline image capture timestamp. + units::second_t resultTime = result.GetTimestamp(); .. code-block:: python @@ -68,5 +68,5 @@ You can also get the pipeline's image capture time from a pipeline result using ``` :::{note} -The C++ version of PhotonLib returns the latency in a unit container. For more information on the Units library, see [here](https://docs.wpilib.org/en/stable/docs/software/basic-programming/cpp-units.html). +The C++ version of PhotonLib returns the image capture time in a unit container. For more information on the Units library, see [here](https://docs.wpilib.org/en/stable/docs/software/basic-programming/cpp-units.html). :::