Skip to content

Commit ef5e646

Browse files
Clarify and fix OpenCV/WPILib version checking error (#1963)
## Description Fixed the error in the OpenCV/WPILib version checking crash and clarified it, since it's not PhotonVision that needs updating, but rather WPILib. Reported on chief https://www.chiefdelphi.com/t/opencv-is-version-4-6-0-and-needs-to-be-4-10-0/501751/7 ## 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 v2024.3.1 - [ ] 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 --------- Signed-off-by: Jade Turner <[email protected]> Co-authored-by: Gold856 <[email protected]>
1 parent 7f6edcd commit ef5e646

File tree

2 files changed

+42
-14
lines changed

2 files changed

+42
-14
lines changed

photon-lib/src/main/java/org/photonvision/PhotonCamera.java

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,18 @@ public static void verifyDependencies() {
195195
+ ">>> but you are using WPILib "
196196
+ WPILibVersion.Version
197197
+ """
198-
>>> \s
198+
\n>>> \s
199199
>>> This is neither tested nor supported. \s
200-
>>> You MUST update PhotonVision, \s
201-
>>> PhotonLib, or both. \s
202-
>>> Verify the output of `./gradlew dependencies`
200+
>>> You MUST update WPILib, PhotonLib, or both.
201+
>>> Check `./gradlew dependencies` and ensure\s
202+
>>> all mentions of OpenCV match the version \s
203+
>>> that PhotonLib was built for. If you find a
204+
>>> a mismatched version in a dependency, you\s
205+
>>> must take steps to update the version of \s
206+
>>> OpenCV used in that dependency. If you do\s
207+
>>> not control that dependency and an updated\s
208+
>>> version is not available, contact the \s
209+
>>> developers of that dependency. \s
203210
>>> \s
204211
>>> Your code will now crash. \s
205212
>>> We hope your day gets better. \s
@@ -232,11 +239,18 @@ public static void verifyDependencies() {
232239
+ ">>> but you are using OpenCV "
233240
+ Core.VERSION
234241
+ """
235-
>>> \s
242+
\n>>> \s
236243
>>> This is neither tested nor supported. \s
237-
>>> You MUST update PhotonVision, \s
238-
>>> PhotonLib, or both. \s
239-
>>> Verify the output of `./gradlew dependencies`
244+
>>> You MUST update WPILib, PhotonLib, or both.
245+
>>> Check `./gradlew dependencies` and ensure\s
246+
>>> all mentions of OpenCV match the version \s
247+
>>> that PhotonLib was built for. If you find a
248+
>>> a mismatched version in a dependency, you\s
249+
>>> must take steps to update the version of \s
250+
>>> OpenCV used in that dependency. If you do\s
251+
>>> not control that dependency and an updated\s
252+
>>> version is not available, contact the \s
253+
>>> developers of that dependency. \s
240254
>>> \s
241255
>>> Your code will now crash. \s
242256
>>> We hope your day gets better. \s

photon-lib/src/main/native/cpp/photon/PhotonCamera.cpp

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,16 @@ inline void verifyDependencies() {
6969
bfw +=
7070
"\n>>> \n"
7171
">>> This is neither tested nor supported. \n"
72-
">>> You MUST update PhotonVision, \n"
73-
">>> PhotonLib, or both. \n"
74-
">>> Verify the output of `./gradlew dependencies` \n"
72+
">>> You MUST update WPILib, PhotonLib, or both.\n"
73+
">>> Check `./gradlew dependencies` and ensure\n"
74+
">>> all mentions of WPILib match the version \n"
75+
">>> that PhotonLib was built for. If you find a"
76+
">>> a mismatched version in a dependency, you\n"
77+
">>> must take steps to update the version of \n"
78+
">>> WPILib used in that dependency. If you do\n"
79+
">>> not control that dependency and an updated\n"
80+
">>> version is not available, contact the \n"
81+
">>> developers of that dependency. \n"
7582
">>> \n"
7683
">>> Your code will now crash. \n"
7784
">>> We hope your day gets better. \n"
@@ -104,9 +111,16 @@ inline void verifyDependencies() {
104111
bfw +=
105112
"\n>>> \n"
106113
">>> This is neither tested nor supported. \n"
107-
">>> You MUST update PhotonVision, \n"
108-
">>> PhotonLib, or both. \n"
109-
">>> Verify the output of `./gradlew dependencies` \n"
114+
">>> You MUST update WPILib, PhotonLib, or both.\n"
115+
">>> Check `./gradlew dependencies` and ensure\n"
116+
">>> all mentions of OpenCV match the version \n"
117+
">>> that PhotonLib was built for. If you find a"
118+
">>> a mismatched version in a dependency, you\n"
119+
">>> must take steps to update the version of \n"
120+
">>> OpenCV used in that dependency. If you do\n"
121+
">>> not control that dependency and an updated\n"
122+
">>> version is not available, contact the \n"
123+
">>> developers of that dependency. \n"
110124
">>> \n"
111125
">>> Your code will now crash. \n"
112126
">>> We hope your day gets better. \n"

0 commit comments

Comments
 (0)