## Description On the RubikPi3, PhotonVision starts before NetworkManager has fully initialized. This causes it to fail to identify the network interfaces available on the board, which leads to problems with configuring and controling networking from the UI. The failure can be detected by the call to `nmcli` returning an [exit status of 8](https://networkmanager.dev/docs/api/latest/nmcli.html#exit_status), which means "NetworkManager is not running." This PR retries the call to nmcli every 0.5 seconds until the exit status does not equal 8, or a maximum of 10 attempts have been made. The retry only occurs the first time `getAllInterfaces()` is called. Subsequent calls to this method will only make one attempt to avoid locking up the program if networking isn't responding as expected. In my testing on the RubikPi3, the code has to retry for less than 2 seconds in order to get a valid response from NetworkManager. The need for this is greatly reduced by https://github.com/PhotonVision/photon-image-modifier/pull/114, but this code adds an additional layer of robustness against slow network startup. Closes #2212 ## Meta Merge checklist: - [x] Pull Request title is [short, imperative summary](https://cbea.ms/git-commit/) of proposed changes - [x] The description documents the _what_ and _why_ - [ ] 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 settings back to v2025.3.2 - [ ] 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 --------- Co-authored-by: samfreund <samf.236@proton.me>
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.
Authors
Documentation
- Our main documentation page: docs.photonvision.org
- Photon UI demo: demo.photonvision.org
- Javadocs: javadocs.photonvision.org
- C++ Doxygen cppdocs.photonvision.org
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:- winx32
- 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 can 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 Raspberry Pi & Orange Pi: 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
- Custom build of OpenCV with GStreamer/Protobuf/other custom flags: https://github.com/PhotonVision/thirdparty-opencv
- JNI code for aruco-nano: https://github.com/PhotonVision/aruconano-jni
Acknowledgments
PhotonVision was forked from Chameleon Vision. Thank you to everyone who worked on the original project.
-
WPILib - Specifically cscore, CameraServer, NTCore, and OpenCV.
-
Apache Commons - Specifically Commons Math, and Commons Lang
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.