Commit Graph

74 Commits

Author SHA1 Message Date
Sam Freund
6c9a142622 Propagate changes after modifying OD model (#2299)
## Description

<!-- What changed? Why? (the code + comments should speak for itself on
the "how") -->

<!-- Fun screenshots or a cool video or something are super helpful as
well. If this touches platform-specific behavior, this is where test
evidence should be collected. -->

<!-- Any issues this pull request closes or pull requests this
supersedes should be linked with `Closes #issuenumber`. -->

This PR adjusts how model modification is handled. Any updates to
metadata, or deletion is handled in the frontend after sending data to
the backend. Any creation of models occurs in the backend, and we push
an update to the frontend.

This PR also fixes a typo in PhotonUtils which meant we hit the wrong
endpoint when an IP was passed into the status check.

## 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
2026-01-19 11:58:23 -08:00
Sam Freund
3b57125d96 Update to 2026 (#2288) 2026-01-12 14:00:11 -08:00
Sam Freund
3f9e2a9fa8 Force reload after restart and switch URL after IP change (#2278)
## Description

Forces a reload after restarting PhotonVision, restarting the
coprocessor, performing an offline update, or nuking the install. We
wait until we are reconnected to the coprocessor to reload, this is
accomplished by the addition of a status API endpoint.

This is being implemented due to issues experienced when the webpage is
not updated (particularly during offline updates).

---

Using the same statusCheck, we also wait until a new IP is available,
then change to it, after changing our static IP.

---

closes #2169
closes #903

## 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
2026-01-07 02:53:05 -05:00
Craig Schardt
5409573f0d Rewrite system monitoring to use OSHI (#2255)
## Description

[OSHI](https://github.com/oshi/oshi) is a free (MIT license) JNA-based
library for accessing hardware and system performance information. This
PR includes a re-write of the metrics monitoring code to be based on
OSHI. The original intent was to gain access to data about network
traffic for addition to the Settings tab. An additional benefit is that
collecting the data is now around two orders of magnitude (or more)
faster!

## 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
- [x] If this PR touches configuration, this is backwards compatible
with settings back to v2025.3.2
- [x] 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>
2026-01-02 17:55:12 -05:00
Matt Morley
fddff5dbca Show board outliers in calibration info card (#1267) 2025-12-26 21:20:36 -05:00
Gold856
6285f1ee24 Consistently serialize neural network data (#2224) 2025-12-07 17:45:14 -06:00
Sam Freund
017b074eae Add playwright E2E tests (#2174) 2025-12-04 22:25:48 -06:00
Sam Freund
dad7f0a82d Add support for removing calib coefficients (#2150)
## Description

Adds the ability to remove old calibrations. This might be helpful if
you have a bad calibration.

closes #1262

## 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: Gold856 <117957790+Gold856@users.noreply.github.com>
2025-11-02 21:17:22 +00:00
Sam Freund
6f2603f0cb Fix bug with import nickname (#2176)
## Description

`.` is a special regex character, which means we weren't actually
matching the `.` in the string, but rather the character before it. This
resulted in the last letter in a model nickname getting cut off on
import. This fix resolves that issue.

## 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_
- [x] This PR has been
[linted](https://docs.photonvision.org/en/latest/docs/contributing/linting.html).
- [ ] 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
2025-11-02 20:14:57 +00:00
Gold856
82d6b6b845 Make exported journalctl logs less verbose and always display everything (#2101)
## Description

There was a recent occurance of journalctl logs saying something like
`[66B blob data]`. We don't log anything binary, so journalctl might be
hiding some lines, thinking they're actually binary data when they're
actually plain text. Use `-a` to always log everything. If it's binary
data anyways, we'll want to know what it is anyways. Use `--output cat`
because we output our own timestamps and we don't want journalctl's own
timestamping. Filter the output through `sed` to remove ANSI color codes
to make reading logs easier.

## 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_
- [x] 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
2025-10-11 00:25:54 -04:00
Gold856
da608a5070 Fix file uploads not overwriting existing files (#2116)
## Description

#2023 changed how file uploads were handled to use `Files.copy`, but
incorrectly didn't specify the `REPLACE_EXISTING` copy option, causing
file uploads to fail if the file already existed.

## 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
2025-10-10 04:44:43 +00:00
Kevin Cooney
7d927aca3b Fix 'Resource leak: <variable> is never closed' warnings (#2023)
Fix numerous places where using AutoCloseable objects without closing
them.

Changes:
- Upgrade JUnit from 5.10.0 to 5.11.4 (so `@AutoClose` can be used)
- Use `Files.copy()` to copy files
- Use try-with-resources when calling `Files.list()` or `Files.walk()`
- Use try-with-resources or `@AutoClose` to close `PhotonCamera` and
  `PhotonCameraSim` objects created by tests
- Update `SQLConfigTest` to use `@TempDir`

## 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
2025-08-18 23:37:00 -04:00
Rikhil Chilka
2eb224a55f Preload OD models before import to check quantization (#2056)
Co-authored-by: samfreund <samf.236@proton.me>
Co-authored-by: Sam Freund <techguy763@gmail.com>
2025-08-16 00:59:22 -05:00
Sam Freund
c7f5edc262 Exclude license from being loaded as a model (#2063) 2025-08-15 15:17:21 -05:00
Sam Freund
9277960018 Add support for object detection on Rubik Pi 3 (#2005) 2025-08-09 10:02:55 -05:00
Sam Freund
4a648b302a Migrate NNM Settings to SQLITE (#1894)
Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
Co-authored-by: Chris Gerth <gerth2@users.noreply.github.com>
2025-06-30 22:02:44 -05:00
Sam Freund
73cd2ab62c Standardize API (#1942)
## Description

closes #1941

Rewrite the API to use the payload method , and use records in the
``RequestHandler``. There's a couple places where this isn't the place,
that's where the front end is making a get request, and so a payload
doesn't make sense.

This is meant to encourage more static typing. 

Additionally, fix some typos in params in ``CameraSettingsStore``

## 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_
- [x] If this PR changes behavior or adds a feature, user documentation
is updated
- [x] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [x] If this PR touches configuration, this is backwards compatible
with settings back to v2024.3.1
- [x] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [x] If this PR addresses a bug, a regression test for it is added
- [x] Everything changed got tested

---------

Co-authored-by: Matt Morley <matthew.morley.ca@gmail.com>
2025-05-03 22:15:32 -07:00
Gold856
ad1f51ba06 Miscellanous clean up 2025-04-19 17:17:34 -07:00
Sam Freund
00fb4bdf07 Update Allowed Naming Conventions For Object Detection Models (#1749) 2025-02-09 07:12:47 -08:00
Sam Freund
7067c75525 Add YOLO11 Support (#1736) 2025-02-08 17:11:01 -08:00
Gold856
1303a0eaae Fix typos and incorrect param order in Javadoc (#1740) 2025-01-19 22:56:47 -05:00
Sam Freund
966b9e8c61 Yolo duplication fix (#1713)
Somebody wanted a description, so here I am.

This PR fixes an error which caused the discoverModels function to be
rerun after each upload of a new model, but without clearing the list of
available models. This causes any models that were on the list prior to
the import to be duplicated. This PR also makes it so that uploading a
model automatically updates the list of available models.

---------

Co-authored-by: Matt Morley <matthew.morley.ca@gmail.com>
Co-authored-by: Chris Gerth <gerth2@users.noreply.github.com>
2025-01-12 19:48:39 -06:00
Sam Freund
27684eef60 Add custom models (#1687) 2025-01-08 11:44:06 -07:00
Cameron (3539)
ab844a77b8 Remove camera index in ui (#1677)
With the new camera matching, this is SUPER BAD! Convert to using camera
uuid.

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2025-01-03 15:50:25 -08:00
oh-yes-0-fps
418eada0b5 Convert to user selected camera matching (#1556) 2025-01-01 03:04:20 -05:00
Craig Schardt
31ec9baa95 Include kernel logs when downloading logs (#1551)
Instead of writing the kernel logs to the photonvision logs, this will
download them in the same zip file as the photonvision logs. Only includes dmesg logs from the current boot, which is fine since we should capture most of them in our logs now.
2024-11-12 00:41:22 -05:00
Matt
8dcf0b31a2 Create FileLogger JNI (#1517) 2024-11-06 20:16:36 -05:00
Matt
385059c233 Big scary buttons (#1471) 2024-10-24 20:48:02 -07:00
Cameron (3539)
b38de6b506 Calibration Rotation! (#1464)
Rotate camera calibration coefficients based on camera rotation. Probably. Seems to work. Maybe.

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2024-10-19 01:23:23 -04:00
Cameron (3539)
0766d0e802 Fix large calibration datasets crashes (#1453)
The target list in networktables is limited to 127 items. When you
capture more than 127 calibration images it breaks this limit and errors
out and dies. Do not publish calibration targets to nt. And also move cal images into their own folder
2024-10-13 01:29:17 -04:00
Mohammad Durrani
c19d54c633 Removed CalibDB (#1396) 2024-08-31 12:31:49 -04:00
Matt
713fad6f6b Allow file uploads of any size and better report active cameras in PhotonCamera error print (#1298)
Previously reported itself which was confusing. New print:

```
Error at org.photonvision.PhotonCamera.verifyVersion(PhotonCamera.java:378): Found the following PhotonVision cameras active on NetworkTables:
 ==> HD_Pro_Webcam_C920
 ==> Arducam_OV9281_USB_Camera
```
2024-05-10 14:58:18 -04:00
Matt
62112cd2fd Reduce initial connection bandwidth (#1200)
Reduces bandwidth requirements by being much lazier about how much calibration data is sent to the UI.
2024-02-01 21:42:54 -05:00
Matt
57f02f31a5 Dont flush settings on exit after import (#1179)
Fixes bug when importing settings zip that would have the new settings be over written, and would not actually update
2024-01-20 20:49:51 -05:00
Sriman Achanta
bf156f544e Update HTTP based settings when new fullsettings are emited (#1122)
Previously, if someone were changing network or camera settings while the backend sent an update request, the frontend wouldn't update the UI until the HTTP request was sent, likely leading to an error or confusion, now, values will be reset whenever new settings are sent. It also checks that settings were changed before allowing the user to click the save button.
2024-01-06 09:43:29 -05:00
Matt
4068025572 Check all new prop names not just exposure time (#1080)
Fixes v4l renaming prop names and OV9281 exposure min/max being wrong by introducing new UI control
2024-01-05 23:40:06 -05:00
Matt
7f09f9e4f5 Save calibration data and show preliminary GUI (#1078)
* Serialize all calibration data

* Run lint

* typing nit

* fix code

* move these tables around some

* Add cool formatting

* add request to get snapshots by resolution and camera

* re-enable all resolutions

* add wip so i can change computers (SQUASH ME AND KILL ME AHHHH)

* Get everything working but viewing snapshots

* Update RequestHandler.java

* Update CameraCalibrationInfoCard.vue

* Update CameraCalibrationInfoCard.vue

* add observation viewer

* round

* fix illiegal import

* Swap to PNG and serialize insolution

* move import/export buttons TO THE TOP

* Update WebsocketDataTypes.ts

* Add snapshotname to observation

* Refactor to serialize snapshot image itself

* Run lint

* Use new base64 image data in info card

* Update SettingTypes.ts

* Create calibration json -> mrcal converter script

* Update calibrationUtils.py

* Fix calibrate NPEs in teest

* Run lint

* Always run cornersubpix

* Update CameraCalibrationInfoCard.vue

Update CameraCalibrationInfoCard.vue

* Update OpenCVHelp.java

* Update OpenCVHelp.java

* Replace test mode camera JSONs

* Run wpiformat

* Revert intrinsics but keep other data

* Remove misc comments

* Rename JsonMat->JsonImageMat and add calobject_warp

* Update Server.java

* Rename cameraExtrinsics to distCoeffs

* fix typing issues

* use util methods

* Formatting fixes

* fix styling

* move to devTools

* remove unneeded or unused imports

* Remove fixed-right css

If its really that big of a deal, we can add it back later, kind of a drag to fix rn.

* Create util method

* Remove extra legacy calibration things

---------

Co-authored-by: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com>
2024-01-03 16:32:04 -05:00
Chris Gerth
ef039da728 Uploaded .json settings bug fixups (#1082)
Resolved race condition between saveGlobal and saveOneFile modifying settings on shutdown. Previously, saveGlobal would overwrite the action of saveOneFile on a clean shutdown.
2023-12-28 23:36:15 -05:00
Matt
5d93515429 Update RequestHandler.java (#1020)
Co-authored-by: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com>
2023-11-21 22:01:59 -06:00
Sriman Achanta
623b4e5b84 Show Saved Snapshots in UI (#995)
Add Camera Control tab to Cameras for the button to live in
2023-11-05 11:33:45 -05:00
Matt
441caf03c0 More carefully check file creation status (#958) 2023-10-17 16:23:05 -04:00
Matt
47bd077bbb Run multitag on coprocessor (#816) 2023-10-17 10:20:00 -04:00
Sriman Achanta
b3a3ab71bd Javalin v5 bump (#930) 2023-10-05 18:22:56 -04:00
Sriman Achanta
43eefcf1c5 Correctly stringify numbers in textboxes (#921)
* fix an issue where the fov isnt reset on error

* Fix issue with incorrectly reading fov on update

* Properly handle NPE in case of error

* Fix issue with vuetify comps not converting strings to numbers

* Formatting fixes
2023-09-26 08:02:18 -04:00
Sriman Achanta
715ef62c85 Update backend to provide more useful info to frontend (#866) 2023-06-25 18:07:27 -07:00
Sriman Achanta
7b8fb3385b [PhotonClient] Update dependencies to latest, update assets, and styling fixes (#767)
Currently, there is a difficult-to-reproduce bug where the backend reports that camera calibration was successful in logs via the logger but then throws an exception causing the backend to return a 500 error code with no request body which causes the frontend to interpret this as a failed calibration attempt. This ultimately leads to the entire instance of photonvision crashing and requiring the entire pi to be restarted. It is believed this issue resides inside the ConfigManager's saving action following the calibration update but is not confirmed.
2023-06-09 10:09:41 -07:00
Matt
9d6997180d Add calibdb upload button (#735)
* Add calibdb upload

* Fix distortion coefficients size
2023-01-18 16:29:58 -05:00
Matt
af6f5eb0c4 Add journalctl export button (#693)
* Add journalctl export button

* Run spotless

* Split into 2 tabs
2023-01-03 21:42:19 -06:00
Chris Gerth
b1905954bc Fix isRaspian() to properly detect Buster image (#637)
* Revised isRaspian() call to look in multiple spots to check if we're a Pi or not

* wpiformat

* linefeed fixup

* whoops

* WIP updating platform

* More platform fixups WIP

* Condensed metrics classes, but expanded the configuration to default to file, but fall back on hardcoded commands for certain platforms

* Migrate unixSupported to isLinux

* applied spotless

* wpiformat

* Linux metrics (#641)

* Move generic commands from PiCmds to LinuxCmds; have PiCmds inherit from LinuxCmds

* Better names for variables to save the total memory values

* Remove "Bionic" from the architecture; that is not actually determined.

* Trigger PhotonVision CI

* Dummy change to trigger CI

* Run format

Update index.html

Co-authored-by: Mohammad Durrani <46766905+mdurrani808@users.noreply.github.com>
Co-authored-by: Paul Rensing <prensing@gmail.com>
Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2022-12-26 22:51:34 -05:00
Mohammad Durrani
548f52e117 Allow JAR update/restart on all linux platforms (#651)
* Added linux support

* Changed to just check linux
2022-12-26 21:40:36 -05:00