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
```
* 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>
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
* 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
- 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>
> there is a problem if the found tags are a valid one plus an invalid tag, so eg it sees a tag but finds noise on the wall, and so lists tags 2 and 15. Lines 90-99 will ignore tag 15, and put 4 corners into the list. It will get past the test on line 100 (there are 4 corners). BUT then at line 106, there are 2 entries in visTags, so it will go to the "else" and try to use solvePNP_SQPNP().
- `PNPResults` can now be empty (`isPresent` = false)
- solvePNP methods actually handle errors and return empty `PNPResults`
- This reveals an odd error where some inputs to `solvePNP_SQUARE()` resulted in an estimated transform with NaN values, and attempts to handle it
- Overwrites java changes from #817 since #742 had duplicate fixes
- Minor bugfixes
### What does this do?
- Deprecates previous sim classes
- Has a `CameraProperties` class for describing a camera's basic/calibration info, and performance values for simulation. Calibration values can be loaded from the `config.json` in the settings exported by photonvision.
- `OpenCVHelp` provides convenience functions for using opencv methods with wpilib/photonvision classes, mainly to project 3d points to a camera's 2d image and perform solvePnP with the above camera calibration info.
- `TargetModel`s describe the 3d shape of a target, both for projecting into the camera's 2d image and use in solvePnP.
- `PhotonCameraSim` uses camera properties to simulate how 3d targets would appear in its view, and has simulated noise, latency, and FPS. For apriltags, the best/alternate camera-to-target transform is also estimated with solvePnP.
- `VideoSimUtil` has helper functions for drawing apriltags to a simulated raw and processed MJPEG stream for each camera using the projected tag corners.
- `VisionSystemSim` stores `VisionTargetSim`s and `PhotonCameraSim`s, and is periodically updated with the robot's simulated pose. When updating, camera sims are automatically processed and published with their visible targets from their respective poses with proper latency.
### What's still not working?
- Mac Arm builds are broken
- More examples
- Update website/docs
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.
- Made alternate constructor for ```PhotonPoseEstimator``` that doesn't need ```PhotonCamera```
- Changed ```update``` function to take in missing cameraMatrixData and coeffsData that were previously received from PhotonCamera.
- Changed the internal ```update``` and ```multiTagPNP``` function to take in cameraMatrixData & coeffsData
- If not needed for the specified strategy then the parameters are simply not used. Also if PhotonCamera is used in constructor it instead backs up to that.
Co-authored-by: Matt <matthew.morley.ca@gmail.com>
* Add pose caching to Java
* Refactor strategy fallthrough
* Hopefully add pose caching to C++
* Make Java switch same order as enum and C++ switch
* C++ absolute value in timestamp check
* Fix Java NPE
* Use `units::second_t` in timestamp
Co-authored-by: Matt <matthew.morley.ca@gmail.com>
* Expand Java unit test
* Copy comments into C++
* Add tests to C++
* Run format
* Update PhotonCamera.cpp
* Probably fix bad access exception
* a
* init timestamp
* Remove prints
---------
Co-authored-by: Matt <matthew.morley.ca@gmail.com>
Co-authored-by: Joseph Eng <joseng2358@gmail.com>
Allows teams with a mechanism that moves the camera's position (eg, a pan and tilt mechanism) to update the location of their camera for their pose calculations.
---------
Co-authored-by: Matthew Morley <matthew.morley.ca@gmail.com>
* update documentation
* add suggested changes
* rename April Tag to AprilTag
* Update RobotPoseEstimator.java
Co-authored-by: Mohammad Durrani <46766905+mdurrani808@users.noreply.github.com>