## Description Back in https://github.com/PhotonVision/photonvision/pull/467#issuecomment-1280964529 and https://discord.com/channels/725836368059826228/725846784131203222/974498049609056266 we added code to poke our NT client every 5 seconds to "clicking the save button in the settings window makes Photon show up again over networktables". Total hack, but it seemed to work. We didn't at the time dig any deeper in Wireshark or debug-level NT logs. <img width="1373" height="679" alt="image" src="https://github.com/user-attachments/assets/8cb2102e-0bae-4bfd-b9ac-55d31f8421b6" /> Now, it's 2026. 4 years on from the OG bug. And this code seems linked to these issues - https://www.chiefdelphi.com/t/photonvision-coprocessor-not-sending-data-can-t-change-networking/516356/5 - https://www.chiefdelphi.com/t/photonvision-network-tables-known-issue/515966 Craig collected these log files as well: [craig-nt-never-connects.zip](https://github.com/user-attachments/files/26001809/craig-nt-never-connects.zip) The code path that handles TCP re-connection was also changed entirely since we first added this workaround. Regardless this hack was not removed as part of the NT3 to NT4 upgrade: - pre-NT4, reconnection was handled by `TCPConnector::connect_parallel` which delegates to `TCPConnector`. This uses raw socket APIs - post-NT4, reconnect is handled by `ParallelTcpConnector`. This uses libuv exclusively @crschardt did some really great debugging with a rio and radio in the loop with a luma p1. In this test setup, removing this code improves stability markedly. I'd still like to get this more on robot time, as well as try to understand from Peter why we might have needed this code in the first place. ## Changes - Remove periodic stop/restart of NetworkTables client every 5 seconds if `NetworkTablesInstance::isConnected` returns false. ## Meta Merge checklist: - [ ] Pull Request title is [short, imperative summary](https://cbea.ms/git-commit/) of proposed changes - [ ] The description documents the _what_ and _why_, including events that led to this PR - [ ] If this PR changes behavior or adds a feature, user documentation is updated - [ ] If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly - [ ] If this PR touches configuration, this is backwards compatible with all settings going back to the previous seasons's last release (seasons end after champs ends) - [ ] If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated - [ ] If this PR addresses a bug, a regression test for it is added - [ ] If this PR adds a dependency, the license has been checked for compatibility and steps taken to follow it --------- Co-authored-by: Craig Schardt <crschardt@fastem.com>
PhotonVision
PhotonVision is the free, fast, and easy-to-use computer vision solution for the FIRST Robotics Competition. You can read an overview of our features on our website. You can find our comprehensive documentation here.
The latest release of platform-specific jars and images is found here.
If you are interested in contributing code or documentation to the project, please read our getting started page for contributors and join the Discord to introduce yourself! We hope to provide a welcoming community to anyone who is interested in helping.
Documentation
- Our main documentation page: docs.photonvision.org
- Photon UI demo: demo.photonvision.org
- Javadocs: javadocs.photonvision.org
- C++ Doxygen: cppdocs.photonvision.org
Authors
Building
Gradle is used for all C++ and Java code, and pnpm is used for the web UI. Instructions to compile PhotonVision yourself can be found in our docs.
You can run one of the many built in examples straight from the command line, too! They contain a fully featured robot project, and some include simulation support. The projects can be found inside the photonlib-java-examples and photonlib-cpp-examples subdirectories, respectively. Instructions for running these examples directly from the repo are found in the docs.
Gradle Arguments
Note that these are case sensitive!
-PArchOverride=foobar: builds for a target system other than your current architecture. Valid overrides are:- winx64
- winarm64
- macx64
- macarm64
- linuxx64
- linuxarm64
- linuxathena
-PtgtIP: Specifies where./gradlew deployshould try to copy the fat JAR to-PtgtUser: Specifies custom username for./gradlew deployto SSH into-PtgtPw: Specifies custom password for./gradlew deployto SSH into-Pprofile: enables JVM profiling-PwithSanitizers: On Linux, enables-fsanitize=address,undefined,leak
If you're cross-compiling, you'll need the WPILib toolchain installed. This must be done via Gradle: for example ./gradlew installArm64Toolchain or ./gradlew installRoboRioToolchain
Out-of-Source Dependencies
PhotonVision uses the following additional out-of-source repositories for building code.
- Base system images for supported coprocessors: https://github.com/PhotonVision/photon-image-modifier
- C++ driver for Raspberry Pi CSI cameras: https://github.com/PhotonVision/photon-libcamera-gl-driver
- JNI code for mrcal: https://github.com/PhotonVision/mrcal-java
- JNI code for RKNN: https://github.com/PhotonVision/rknn_jni
- JNI code for Rubik Pi NPU: https://github.com/PhotonVision/rubik_jni
Acknowledgments
PhotonVision was forked from Chameleon Vision. Thank you to everyone who worked on the original project.
- WPILib - Specifically allwpilib and their build of OpenCV.
- Apache Commons - Specifically Commons IO, and Commons CLI
- diozero
- EJML
- Javalin
- JSON
- FasterXML - Specifically jackson
- MessagePack for Java
- OSHI
- QuickBuffers
- SQLite JDBC
- ZT ZIP
License
PhotonVision is licensed under the GNU General Public License.
Meeting Notes
Our meeting notes can be found in the wiki section of this repository.