Commit Graph

183 Commits

Author SHA1 Message Date
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
Craig Schardt
f37a0d0300 Add database migrations (fixes #1046) (#1065)
Add database version pragma to SQL database to automatically migrate between versions
2024-01-05 21:02:47 -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
b033f7e585 Publish API docs (#1094)
Redirects I want eventually ( @Bankst )

demo.photonvision.org redirected to https://photonvision.github.io/photonvision/built-client/
javadocs.photonvision.org redirected to https://photonvision.github.io/photonvision/built-docs/javadoc/
cppdocs.photonvision.org redirected to https://photonvision.github.io/photonvision/built-docs/doxygen/html/

For now this runs on all commits to master. Once we confirm it works, let's pull back to only tagged releases


---------

Co-authored-by: Mohammad Durrani <46766905+mdurrani808@users.noreply.github.com>
Co-authored-by: Chris <chrisgerth010592@gmail.com>
2024-01-05 14:14:22 -05:00
Programmers3539
4d9f2284da CSI Camera Timeout & Auto-Recreate (#1102)
Adds logic that will reset the CSI camera in the case that it doesn't receive any new frames from the camera in 3 seconds. This is very helpful for cases where the camera cable was bumped enough to cause a temporary disconnect. Most of the time (if not all the time) the camera needs to be recreated for it to start sending frames again.

Goes with PhotonVision/photon-libcamera-gl-driver#13
2024-01-05 09:27:12 -05:00
Sriman Achanta
d85bafa0eb fix naming (#1089) 2024-01-04 13:20:29 -05:00
Paul Rensing
dcf01f8b9e Enable detecting generic Linux ARM32 in Platform enum (#1110) 2024-01-03 18:25:15 -07: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
e685334baa Fix grayscale passthrough (#1083)
Fix grayscale passthrough with libcamera. Additionally fixes issue #1091.

Must go with PhotonVision/photon-libcamera-gl-driver#11.

When grayscale passthrough is used currently the frames that are returned do not have the type grayscale so calculations that need grayscale to not run. With these changes pipelines that need grayscale will now run and properly display fps.
2024-01-02 23:35:24 -05:00
Programmers3539
341954c1eb Libcamera JNI Maven Support (#1105)
Download our libcamera JNI from Maven <3
2024-01-02 11:04:58 -07:00
Programmers3539
2a1792e71a Allow 90-deg rotation of USB cameras on Pi (#1103)
UI would say that every camera on a Pi device was a CSI camera basically. It would not let you rotate usb cameras 90 degrees or 270 degrees because it thought that they were CSI cameras. Fixes: #1098
2024-01-02 10:27:09 -05:00
Drew Williams
96de176ba2 Changes sim to use 36h11 tags (#1056)
Fixes #1041

---------

Co-authored-by: Drew Williams <DrewW@iARx.com>
Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2024-01-02 08:09:32 -07:00
Programmers3539
a9f1e50a19 Fix Driver Mode Rotation (#1097)
Demoves duplicate image rotation. Frames are rotated from the frame source provided. Then were rotated again in the driver mode pipeline.
2023-12-31 22:07:07 -05:00
Sriman Achanta
2ecd988628 Add protobuf publish setting slider (#1075)
Allows logging software and live data view to see results. Also removes the requirement for AScope to keep up with the packet serde schema and instead just use the Protobuf descriptor.
2023-12-31 00:14:21 -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
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
7b8326beb1 Use exposure_time_absolute if present (#1079) 2023-12-28 10:42:52 -05:00
Programmers3539
0b98f02731 Enable multi-CSI-camera with libcamera (#1068)
We should continue being paranoid about multi-cam with all these changes


---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2023-12-24 21:05:11 -05:00
Sriman Achanta
5be9b8be2c Add PacketSerde interface and expand PacketUtils for more wpimath classes (#1058)
Follows a similar system to the current Protobuf implementation that helps make code more readable and expandable. Also wraps the NT topic to be more useful. Impl stuff is hidden so it can't be extended. Optimizes AT-specific classes by only serializing data when needed, won't save on size but will on time.

closes #1003
2023-12-24 19:56:08 -05:00
Matt
954ca9a577 Record standard deviations for multi-tag pose (#1019)
* Record standard deviations for multi-tag pose

* Add XYZ translation and angle to stdev uI

* create multitag result buffer in store

allows results to be stored in the background

* simplify logic in targeting tab

also adds a reset button

* Formatting fixes

* convert rad angles to deg

---------

Co-authored-by: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com>
2023-12-19 15:47:53 -05:00
Craig Schardt
796b8e73d5 Fix Logger - ConfigManager circular reference (#1054) 2023-12-18 12:59:14 -05:00
Craig Schardt
36ba8b5263 JSONAlias on old tag type enum names (#1055)
add aliases for older enum names

* two more aliases for 6.5" 36h11 tags

* added unit test for missing @JsonAlias

* use proper tempfiles

* check proper TargetModel enum
2023-12-18 12:42:43 -05:00
Programmers3539
82b82fe2f6 Raspberry Pi 5 Support (#1008)
Deals with new otherpaths on pi 5 CSI cameras and bumps libcamera driver to latest from the pi 5 PR

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2023-12-16 16:11:55 -05:00
Joseph Farkas
6db5bc5e0c Matching cameras by path ID (#1015)
Allows multiple cameras of the same model to be used while ensuring they stay tied to the physical camera and not the port. Matching occurs when first connecting cameras so swapping the ports while PV is running will swap the virtual cameras until a restart. Currently only tested on Linux.
2023-12-04 11:55:16 -05:00
Programmers3539
469bc0eeae Fix Camera Index Assignment. (#1031)
Fixes a bug where multiple cameras would receive identical stream indexes and would cause at least one camera to not function at all and the other to not display a stream.

One of the reasons the that usbcamerasource equals method used to incorrectly determine equality was because the quirkycamera object didn't have a basename. When a camera that had a quirk was found it would set equal to a predefined quirkycamera without changing the name first. Add unit test that will better test the equality of two usbcamerasources. This required a few changes to allow creating a fake usbcamerasource.
2023-12-01 07:58:38 -05:00
Matt
3268e0d689 Add pi5 to pi version enum (#1023)
---------

Co-authored-by: Technologyman00 <collinost@gmail.com>
2023-11-22 20:25:43 -05:00
Sriman Achanta
773c6352d0 [build] Gradle Cleanup (#1021)
Cleanup project-wide gradle configuration.

    removes native dependencies from java only projects
    increases readability
    Pass generated headers in setup instead of modifying model
2023-11-22 20:08:23 -05:00
Sriman Achanta
308fd801d4 [photon-targeting][photon-lib] Add tests to the targeting classes and cleanup photon-lib & photon-targeting (#1007)
* Make MultiTagPNPResult and PNPResult singular

* add java tests

* Formatting fixes

* bring in the rest of the little stuff

* final things

* Formatting fixes

* add multisubscriber back

* Formatting fixes

* make comments better about x and y relationship
2023-11-15 18:28:26 -05: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
superpenguin612
5136dad535 Add StickyFPS quirk for Arducam OV2311 (#994)
Disable setting first video mode on boot. Resolution is actually set immediately after
2023-11-02 22:36:24 -04:00
amquake
363e1d8fd4 [photon-core] Check for multitarget params (#988)
* require params in multitarget

* format
2023-10-30 21:55:35 -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
amquake
5b2be119e7 [photon-lib] Cleanup simulation Rotation3d usage (#982) 2023-10-25 18:19:48 -07:00
Sriman Achanta
63147786b9 Fix MacOS OpenCV library loading and use wpi buildTools versions (#978)
* Bump to beta 2

* Reduce copy paste spam going forwards

* Bump gradle

* oops

* fix gradlew

* update gradle wrapper props

* remove unused imports

* Update node task

* Fix shadowjar

* fix more deps

* ?

* core works

* revert changes to index

* Formatting fixes

* Update config.gradle

* Fix PhotonLib gradle

* fix tests and sim loading native libraries

* re-enable macos build

* fix?

* Update build.gradle

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2023-10-25 20:27:56 -04:00
Matt
cb401e1c7a Add 36h11 tag model for 2024 (#951)
* Add 36h11 model

* Formatting fixes

* Match frontend TargetModel enum with backend

* fix target model merge

* Update TargetModel.java

---------

Co-authored-by: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com>
2023-10-24 23:04:52 -04:00
amquake
df45bc2d73 Re-enable OpenCV ArUco detector for AprilTags (#916)
- Fixes ArUco on picam
- Adds `ArucoPoseEstimatorPipe` for single-tag pose estimation
  - Previously, `Aruco.estimatePoseSingleMarkers()` was used for tag pose estimation. This uses the default `SOLVEPNP_ITERATIVE` solver and I believe the method is removed in opencv 4.8. The `SOLVEPNP_IPPE_SQUARE` solver implemented is more appropriate for markers.
- Pipeline architecture cleanup
- Re-enables ArUco pipeline in UI
- Multi-tag support

ArUco detector support is still considered experimental at this time. This should enable a baseline of support for initial testing, but expect some quirks to remain across platforms.
2023-10-24 22:39:38 -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
amquake
ad4f462fd6 [photon-core] [2024] Cleanup and document coordinate system conversion (#894)
* cleanup and document coordinate conversion

* spotless

* bump wpilib version

* coordinate conversion tests

* fix/document SolvePNPPipe models and corners

* format

* run lint

---------

Co-authored-by: Matthew Morley <matthew.morley.ca@gmail.com>
2023-10-15 13:46:55 -04:00
amquake
c8c9e779ab [photon-core] 2D Detection data accuracy (#896)
Use calibration data for 2d target info when available (principal point, FOV)

Correct perspective distortion in 2d yaw/pitch info
2023-10-15 13:44:47 -04:00
Sriman Achanta
760de0ff86 [photon-core] [NFC] Code Cleanup, spelling, and grammar (#945) 2023-10-15 12:31:23 -04:00
Matt
9991f8670c Bump wpilib versions to 2024 beta 1 (#947) 2023-10-15 12:17:40 -04:00
amquake
5f3b5d2f19 Remove unused MathUtils.orthogonalizeRotationMatrix() (#944) 2023-10-10 07:12:03 -04:00
Sriman Achanta
0e06737272 move javalinVersion to a global version (#942) 2023-10-10 05:06:59 -04:00
Matt
43b78fae35 Remove un-needed NM-dbus dep (#919) 2023-10-10 04:36:02 -04:00
amquake
3c85291610 Pi startup fix (#923) 2023-09-27 21:37:27 -04:00
Ryan Blue
9d0f1a34a8 Use MemAvailable rather than MemFree (#914)
Fixes linux metrics reporting to report mem free before swap starts, instead of physical unused ram
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
2023-09-23 10:36:38 -04:00
Ryan Blue
9f3a735c59 Fix spotless divergence for FilterContoursPipe (#908)
Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2023-09-12 06:57:01 -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