Commit Graph

200 Commits

Author SHA1 Message Date
Matt
adb18fe711 Refactor program configuration broadcast hashmap spaghetti (#1592)
WAS: we used raw hash-maps to encode program state
S/B: we use Jackson to do this encoding for us for free. We have
Objects, and we should use them to represent structured data.

---------

Co-authored-by: Craig Schardt <crschardt@fastem.com>
2024-11-19 05:22:33 +00: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
37aaa49b32 Create timesync JNI for testing client (#1433) 2024-10-31 08:27:19 -07: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
Christopher Mahoney
27cb69c094 Support selecting Object Detection models (#1359)
This PR is for part 1 of #1354. It focuses on adding a model selection
interface for models that exist in `photonvision_config/models/`. Upon
completion we can ship more than 1 model and users could upload their
own through `ssh` without deleting the shipped model. This PR also adds
the abstractions need to support more DNN backends (say OpenCV, or RPI
AI Kit)

Up next is adding a CRUD interface for managing models through the UI.
2024-09-21 16:08:00 -04:00
Mohammad Durrani
c19d54c633 Removed CalibDB (#1396) 2024-08-31 12:31:49 -04:00
Craftzman7
9e58f5ed02 Disable Arm32 Builds (#1325)
Disables Arm32 builds and removes mention of the build option in the README.
2024-05-19 20:35:40 -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
5597f5acd9 Set default pipeline idx in PipelineManager constructor (#1286)
Addresses #1285
2024-03-18 13:21:41 -04:00
Matt
e125632960 Free native resources in apriltag pipelines (#1272)
Addresses memory leak when switching between apriltag/aruco pipelines
2024-03-14 01:22:32 -04:00
Matt
bad676f67c Pipe cscore logs through photonvision (#1260)
This means we can see even more logs about mjpeg server status as well
2024-03-04 23:27:39 -05:00
Matt
71128d1569 Create smoketest mode (#1264)
Create test mode that exists after confirming libraries load OK
2024-03-04 23:24:23 -05: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
Craig Schardt
cbbfbda59d clean up debugging println (#1193) 2024-01-22 22:59:42 -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
Mohammad Durrani
7b67f6bebf Add RKNN / Object Detection Pipeline (#1144)
Tested on Orange Pi 5 and Cool Pi 4B. Merge with parts of the OpenCV DNN PR. 

Adds support for YOLOv5s models for Rockchip CPUs with a NPU. Right now hard coded to a note model from alex_idk. Very much still incubating and largely untested.
2024-01-15 22:28:34 -05:00
Matt
68d8a943f7 Add 2024 test mode pictures (#1136) 2024-01-08 14:09:15 -05:00
Matt
6444ae884d Restart server on general settings change (#1137) 2024-01-08 13:02:31 -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
0af5a62d5e Use mrcal for camera-calibration (#1036)
Uses jars built from https://github.com/photonvision/mrcal-java/
See: https://mrcal.secretsauce.net/ and https://docs.photonvision.org/en/latest/docs/calibration/calibration.html#investigating-calibration-data-with-mrcal

---------

Co-authored-by: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com>
2024-01-05 14:26:17 -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
Programmers3539
341954c1eb Libcamera JNI Maven Support (#1105)
Download our libcamera JNI from Maven <3
2024-01-02 11:04:58 -07: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
Chris Gerth
ece521c9e1 Status leds round2 (#1076)
Continuation of #802

Support RGB status LED to indicate:

Running/no-running
NT connected
At least one target visible

Configured by manually uploading hardware config JSON
2023-12-28 14:24:28 -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
5a4eb54693 Check if WS is closing before sending message (#993) 2023-11-02 19:34:31 -04:00
amquake
76e3c6d5a5 Remove socket camera streaming (#985)
Removes websocket-based camera streaming functionality. 

Fixes #975. This was caused by destroying the camera streams and recreating them on nickname change. Even when directly using `MJPGFrameConsumer` and the streams were exactly the same, the freeze would occur when creating a new `MjpegServer` and require a refresh. I think this is simply how cscore works?
2023-10-29 23:03:05 -04:00
Sriman Achanta
0898dfe2f7 Aruco/Multitag 36h11 support (#981)
- Aruco pipeline now infers tag width from tag family like the AprilTag pipeline
- Removes unused Aruco and 200mm AprilTag models
- `VisionEstimation.estimateCamPosePNP()` now requires a target model instead of assuming 16h5
  - Multitarget pipeline similarly infers target model of tag family now
  - `PhotonPoseEstimator` can have target model set for on-rio multitarget

---------

Co-authored-by: amquake <noleetarrr@gmail.com>
2023-10-29 23:02:16 -04:00
Sriman Achanta
89908fc181 [photon-server] Fix journal-ctl export bug (#970)
* Update Server.java

* And this
2023-10-20 07:04:19 -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
ededc4f130 Take Snapshots from PhotonClient (#940) 2023-10-17 09:08:25 -04:00
Sriman Achanta
b3a3ab71bd Javalin v5 bump (#930) 2023-10-05 18:22:56 -04:00
amquake
3c85291610 Pi startup fix (#923) 2023-09-27 21:37:27 -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
Matt
306677e56f Advanced networking settings (#899)
Exposes NetworkManager interface name and more robustly handles device/interface names internally.

---------

Co-authored-by: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com>
2023-09-01 15:58:35 -04:00
Sriman Achanta
715ef62c85 Update backend to provide more useful info to frontend (#866) 2023-06-25 18:07:27 -07:00
Matt
b1546b8038 Add SQL config manager (#818)
Serializes settings using a sqlite database instead of just putting them on the filesystem. Ideally since sqlite deals with filesystem robustness stuff this should work a lot better

Merging this now so we have lots of time to stabilize pre-beta
2023-06-18 00:47:18 -04: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
person4268
6d2eae7f20 Add ignored cameras regex to command-line arguemnts (#849)
This adds a regex that ignores cameras if they match it, for if you have another piece of software running that needs a second camera, or if you have a webcam in your laptop that cscore hates.
2023-06-03 21:04:04 -04:00
Matt
9d6997180d Add calibdb upload button (#735)
* Add calibdb upload

* Fix distortion coefficients size
2023-01-18 16:29:58 -05:00
Matt
7c985e3a84 Remove force istestmode in Main (#723) 2023-01-10 09:13:59 -05:00
Matt
86b9d4b037 Add 2023 pics to test mode (#720) 2023-01-07 20:48:21 -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
Matt
7ff630dc44 Replace MMAL driver with Libcamera (#491)
Co-authored-by: Chris Gerth <gerth2@users.noreply.github.com>
2022-12-28 14:21:41 -05:00