From 18391bb6fe40d965ce6d06d9447f1db5c682a0d0 Mon Sep 17 00:00:00 2001 From: Charlotte <69423184+tqpcharlie@users.noreply.github.com> Date: Thu, 6 Nov 2025 10:33:00 -0500 Subject: [PATCH 1/4] nt api docs update Signed-off-by: Charlotte <69423184+tqpcharlie@users.noreply.github.com> --- docs/source/docs/additional-resources/nt-api.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/source/docs/additional-resources/nt-api.md b/docs/source/docs/additional-resources/nt-api.md index e89c26b356..05c6f6f22c 100644 --- a/docs/source/docs/additional-resources/nt-api.md +++ b/docs/source/docs/additional-resources/nt-api.md @@ -3,13 +3,15 @@ ## About :::{warning} -PhotonVision interfaces with PhotonLib, our vendor dependency, using NetworkTables. If you are running PhotonVision on a robot (ie. with a RoboRIO), you should **turn the NetworkTables server switch (in the settings tab) off** in order to get PhotonLib to work. Also ensure that you set your team number. The NetworkTables server should only be enabled if you know what you're doing! +PhotonVision interfaces with PhotonLib, our vendor dependency, using NetworkTables. If you are running PhotonVision on a robot (ie. with a RoboRIO), you should **turn the NetworkTables server switch (in the settings tab) off** in order to get PhotonLib to work. Also ensure that you set your team number. **The NetworkTables server should only be enabled if you know what you're doing!** ::: ## API :::{warning} -NetworkTables is not a supported setup/viable option when using PhotonVision as we only send one target at a time (this is problematic when using AprilTags, which will return data from multiple tags at once). We recommend using PhotonLib. +NetworkTables is not a supported setup/viable option when using PhotonVision as we only send one target at a time (this is problematic when using AprilTags, which will return data from multiple tags at once). + +**We strongly recommend using PhotonLib instead, as the NetworkTables API will most likely be removed in 2027.** ::: The tables below contain the the name of the key for each entry that PhotonVision sends over the network and a short description of the key. The entries should be extracted from a subtable with your camera's nickname (visible in the PhotonVision UI) under the main `photonvision` table. From 9e4886b4dc88b88757bd705a4f980682939166b9 Mon Sep 17 00:00:00 2001 From: Charlotte <69423184+tqpcharlie@users.noreply.github.com> Date: Thu, 18 Dec 2025 19:57:49 -0500 Subject: [PATCH 2/4] not good at C here --- .../org/photonvision/common/networktables/NTTopicSet.java | 1 + .../main/native/include/photon/networktables/NTTopicSet.h | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/photon-targeting/src/main/java/org/photonvision/common/networktables/NTTopicSet.java b/photon-targeting/src/main/java/org/photonvision/common/networktables/NTTopicSet.java index da45f7e9b5..abfd529963 100644 --- a/photon-targeting/src/main/java/org/photonvision/common/networktables/NTTopicSet.java +++ b/photon-targeting/src/main/java/org/photonvision/common/networktables/NTTopicSet.java @@ -40,6 +40,7 @@ *

However, we do expect that the actual logic which fills out values in the entries will be * different for sim vs. real camera */ +@Deprecated(since = "2025", forRemoval = true) public class NTTopicSet { public NetworkTable subTable; diff --git a/photon-targeting/src/main/native/include/photon/networktables/NTTopicSet.h b/photon-targeting/src/main/native/include/photon/networktables/NTTopicSet.h index e3f79a91e2..4b01f1cb02 100644 --- a/photon-targeting/src/main/native/include/photon/networktables/NTTopicSet.h +++ b/photon-targeting/src/main/native/include/photon/networktables/NTTopicSet.h @@ -28,6 +28,7 @@ #include #include #include +#include namespace photon { const std::string PhotonPipelineResult_TYPE_STRING = @@ -64,6 +65,7 @@ class NTTopicSet { nt::DoubleArrayPublisher cameraDistortionPublisher; void UpdateEntries() { + nt::PubSubOptions options; options.periodic = 0.01; options.sendAll = true; @@ -101,6 +103,12 @@ class NTTopicSet { subTable->GetDoubleArrayTopic("cameraIntrinsics").Publish(); cameraDistortionPublisher = subTable->GetDoubleArrayTopic("cameraDistortion").Publish(); + + fmt::println( + "NetworkTables is not a supported setup/viable option when using" + "PhotonVision as we only send one target at a time. We strongly" + "recommend using PhotonLib instead, as the NetworkTables API will" + "most likely be removed in 2027."); } private: From 069ba16e120e445fb055f339202330210d8f6963 Mon Sep 17 00:00:00 2001 From: Charlotte <69423184+tqpcharlie@users.noreply.github.com> Date: Thu, 18 Dec 2025 20:05:25 -0500 Subject: [PATCH 3/4] wpiformat + front end lint (just missing Spotless check) --- docs/source/docs/additional-resources/nt-api.md | 2 +- .../native/include/photon/networktables/NTTopicSet.h | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/source/docs/additional-resources/nt-api.md b/docs/source/docs/additional-resources/nt-api.md index 05c6f6f22c..2455274f60 100644 --- a/docs/source/docs/additional-resources/nt-api.md +++ b/docs/source/docs/additional-resources/nt-api.md @@ -9,7 +9,7 @@ PhotonVision interfaces with PhotonLib, our vendor dependency, using NetworkTabl ## API :::{warning} -NetworkTables is not a supported setup/viable option when using PhotonVision as we only send one target at a time (this is problematic when using AprilTags, which will return data from multiple tags at once). +NetworkTables is not a supported setup/viable option when using PhotonVision as we only send one target at a time (this is problematic when using AprilTags, which will return data from multiple tags at once). **We strongly recommend using PhotonLib instead, as the NetworkTables API will most likely be removed in 2027.** ::: diff --git a/photon-targeting/src/main/native/include/photon/networktables/NTTopicSet.h b/photon-targeting/src/main/native/include/photon/networktables/NTTopicSet.h index 4b01f1cb02..e9a4a8105d 100644 --- a/photon-targeting/src/main/native/include/photon/networktables/NTTopicSet.h +++ b/photon-targeting/src/main/native/include/photon/networktables/NTTopicSet.h @@ -65,7 +65,6 @@ class NTTopicSet { nt::DoubleArrayPublisher cameraDistortionPublisher; void UpdateEntries() { - nt::PubSubOptions options; options.periodic = 0.01; options.sendAll = true; @@ -105,10 +104,10 @@ class NTTopicSet { subTable->GetDoubleArrayTopic("cameraDistortion").Publish(); fmt::println( - "NetworkTables is not a supported setup/viable option when using" - "PhotonVision as we only send one target at a time. We strongly" - "recommend using PhotonLib instead, as the NetworkTables API will" - "most likely be removed in 2027."); + "NetworkTables is not a supported setup/viable option when using" + "PhotonVision as we only send one target at a time. We strongly" + "recommend using PhotonLib instead, as the NetworkTables API will" + "most likely be removed in 2027."); } private: From 5d952d8c066a3d7e38a2a2c1fb80e4b7395277e8 Mon Sep 17 00:00:00 2001 From: Charlotte <69423184+tqpcharlie@users.noreply.github.com> Date: Thu, 18 Dec 2025 20:15:33 -0500 Subject: [PATCH 4/4] Revert "not good at C here" This reverts commit 9e4886b4dc88b88757bd705a4f980682939166b9. --- .../org/photonvision/common/networktables/NTTopicSet.java | 1 - .../main/native/include/photon/networktables/NTTopicSet.h | 7 ------- 2 files changed, 8 deletions(-) diff --git a/photon-targeting/src/main/java/org/photonvision/common/networktables/NTTopicSet.java b/photon-targeting/src/main/java/org/photonvision/common/networktables/NTTopicSet.java index abfd529963..da45f7e9b5 100644 --- a/photon-targeting/src/main/java/org/photonvision/common/networktables/NTTopicSet.java +++ b/photon-targeting/src/main/java/org/photonvision/common/networktables/NTTopicSet.java @@ -40,7 +40,6 @@ *

However, we do expect that the actual logic which fills out values in the entries will be * different for sim vs. real camera */ -@Deprecated(since = "2025", forRemoval = true) public class NTTopicSet { public NetworkTable subTable; diff --git a/photon-targeting/src/main/native/include/photon/networktables/NTTopicSet.h b/photon-targeting/src/main/native/include/photon/networktables/NTTopicSet.h index e9a4a8105d..e3f79a91e2 100644 --- a/photon-targeting/src/main/native/include/photon/networktables/NTTopicSet.h +++ b/photon-targeting/src/main/native/include/photon/networktables/NTTopicSet.h @@ -28,7 +28,6 @@ #include #include #include -#include namespace photon { const std::string PhotonPipelineResult_TYPE_STRING = @@ -102,12 +101,6 @@ class NTTopicSet { subTable->GetDoubleArrayTopic("cameraIntrinsics").Publish(); cameraDistortionPublisher = subTable->GetDoubleArrayTopic("cameraDistortion").Publish(); - - fmt::println( - "NetworkTables is not a supported setup/viable option when using" - "PhotonVision as we only send one target at a time. We strongly" - "recommend using PhotonLib instead, as the NetworkTables API will" - "most likely be removed in 2027."); } private: