Commit Graph

61 Commits

Author SHA1 Message Date
James Ward
3a9d22c76b Handle remote UUID mismatch properly (#1590)
Check for no response
Only throw if incorrect version, and not when missing

Resolves #1569
2024-11-18 21:28:07 -05:00
Matt
14f7155a23 [TSP] Move Bind() to Start (#1538)
Fixes UB with static init. Turns out starting threads in static init doesn't work on windows.
2024-11-09 17:35:38 -05:00
Matt
fc8ecac376 Create TSP Server in C++ photonlib (#1516)
Automatically starts a TCP server in C++. Also adds warnings to Python.
2024-11-01 23:32:38 -07:00
Matt
37aaa49b32 Create timesync JNI for testing client (#1433) 2024-10-31 08:27:19 -07:00
Matt
7da2ec1948 Fix PhotonCamera typestring checks (#1480)
Previously NT would quietly drop readQueue changes.
2024-10-20 22:21:24 -07:00
Matt
169595e56e Auto-generate packet dataclasses with Jinja (#1374) 2024-08-31 13:44:19 -04:00
Matt
67463a020a Use ReadQueue for PhotonCamera timestamps (#1316)
This removes the extra GetLastChange call to keep everything properly
atomic.

Closes #1303
2024-08-04 14:23:46 -04:00
Matt
974a926e75 Run wpiformat (#1379) 2024-08-02 11:57:34 -04:00
Matt
19b4802094 Allow opencv8 distortion model in PhotonCamera (#1317)
We previously assumed only OpenCV5 but mrcal uses opencv8
2024-05-29 17:28:35 -04:00
Matt
ed08e2a78f Move PhotonVersion to C++ file (#949)
This was supposed to speed up incremental compilation, but not sure it actually does. It's better form tm tho and fixes a robotpy-wrapper weirdness
2024-05-24 23:22:31 -04:00
Drew Williams
74a051d721 [PhotonLib C++] Fix SetVersionCheckEnabled to actually disable version checking (#1323)
* change verifyversion to use member variable

* Revert "change verifyversion to use member variable"

This reverts commit 4439839c8f.

* Removed inline specifier for versioncheck variable

---------

Co-authored-by: Drew Williams <DrewW@iARx.com>
2024-05-19 20:36:44 -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
113951100e Add sequence ID, capture, publish and recieve timestamp to PhotonPipelineResult (#1305)
Closes #1304
2024-05-10 14:04:34 -04:00
Tim Winters
0eb0a4e3c5 Store the last pose on update (#1207)
* Store the last pose on update

* Don't clear lastPose if pose isn't calculated

---------

Co-authored-by: Mohammad Durrani <46766905+mdurrani808@users.noreply.github.com>
2024-02-05 09:50:36 -05:00
Chris Gerth
b9c2d839f4 Update big friendly warning to look better. (#1101)
The driver station supports neither monospace fonts nor unicode, so we can't be as... ummm... artistic... with what we put there.
2024-01-01 17:30:57 -05:00
Tyler Veness
f9437123b4 Remove redundant parts of bfw string declaration (#1100) 2024-01-01 16:31:23 -05:00
Chris Gerth
e3eff8731f Version mismatch is harder to miss. (#1088) 2023-12-30 15:34:52 -05:00
Sriman Achanta
6b8882fe53 Report cpp usage (#1045) 2023-12-16 15:26:00 -05:00
Drew Williams
cba4db0bce Update C++ Simulation to match Java (#1026) 2023-12-16 13:41:27 -05:00
Sriman Achanta
994ea1e76b [photon-targeting] Move C++ targeting classes to photon-targetting (#1009)
* add classes to targeting and update gradle

* rename me

* Finish cleanup

* Formatting fixes

* just use common.gradle

* Update build.gradle

* Update config.gradle

* remove typo

* simplify

* Add Packet Headers

* move simulation classes into simulation folder

* draw in dependency

* fix

* Everything working minus tests cause im lazy

* formatting fixes

REMEMBER TO REMOVE UNUSED IMPORTS, IM JUST TOO LAZY TO CHECK RN

* move packet test to targeting

* Formatting fixes

* remove TargetCorner from c++

im not 100% sure but just doing std::pair<double, double> is sufficient and shouldnt conflict with protobuf

* think i added packet

* fix namespace issue

* organize imports in photon-targeting

* Formatting fixes

* remove ctors

* fix typo

* Add PNP and Multitag packet tests

* revert TargetCorner class

* Add Test placeholders

* remove annoying print

* Reorganize build and publish process

channeling inner Thad

* add targeting as flag

* Update config.gradle

* fix issue with platform binaries not building

* Update photonlib.json.in

casing still needs to be checked

* add minimum level back

* add back UTF-8 encoding of javadoc

* simplify publish model for photon-lib

* fix windows symbol generation

* formatting fixes

* move task from main gradle to config

* Update config.gradle
2023-11-19 15:16:22 -05:00
Matt
47bd077bbb Run multitag on coprocessor (#816) 2023-10-17 10:20:00 -04:00
Matt
9991f8670c Bump wpilib versions to 2024 beta 1 (#947) 2023-10-15 12:17:40 -04:00
Mohammad Durrani
9e371de1cb Remove casts to double in SetLEDMode and set pipeline (#906)
* Remove casts to double

* Run wpiformat
2023-09-16 10:17:28 -04:00
Matt
6e8e379b71 [photon-lib] Fix camera/distortion matrix mixup in C++ (#909) 2023-09-12 06:56:38 -04:00
Matt
f6756bdb9a Don't add bad corners to multi-tag solution (#817)
Closes #837


---------

Co-authored-by: Chris Gerth <gerth2@users.noreply.github.com>
2023-06-18 01:16:10 -04:00
Sriman Achanta
a723d3dc5c [PhotonPoseEstimator] Check for CalibData before adding Tags when using SolvePNP method (#826)
Closes #825 by re-organizing multi-tag strategy order. Should be NFC


---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2023-06-18 00:00:30 -04:00
Sriman Achanta
c148331b69 Bump License year to 2023 (#841)
* Bump version

* remove year entirely
2023-04-18 18:49:40 -04:00
Murad
2d586fe1c0 Add PhotonPoseEstimator constructor without a PhotonCamera instance (#840)
- 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>
2023-04-18 13:50:23 -04:00
David Vo
14224574cf Add missing PhotonCamera::GetCameraName impl (#844) 2023-04-17 11:27:40 -04:00
Joseph Eng
545e016d04 Cache pose calculations in PhotonPoseEstimator (#788)
* 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>
2023-02-13 21:22:22 -05:00
Matt
5b86360b9b Multi-tag pnp in robot code (#787)
---------

Co-authored-by: Banks Troutman <btrout.dhrs@gmail.com>
Co-authored-by: Joseph Farkas <16584585+MrRedness@users.noreply.github.com>
2023-02-13 17:57:01 -05:00
David Vo
3edc8750ec PhotonPoseEstimator: Stop manually iterating targets (#796) 2023-02-11 07:44:22 -05:00
PJ Reiniger
0255798d6c Add ability query camera results outside of PhotonPoseEstimator (#786) 2023-02-09 14:43:52 -05:00
Matt
6886663688 Robustify setting pipeline index (#790) 2023-02-08 21:07:12 -05:00
Matt
f6e3c9b3ee Fix desync between web UI and NT (#778)
Actually calls VisionModule::setPipeline when changing pipelines (needed to change video modes)
2023-01-29 23:30:34 -05:00
Matt
37a7d378fd Fix publish type in photoncamera (#760) 2023-01-22 10:56:41 -05:00
Andrew Gasser
357d8a518a Return named type from PhotonPoseEstimator (#734)
Adds PhotonPoseEstimator class, and deprecates RobotPoseEstimator
2023-01-14 10:06:15 -05:00
Matt
967be84b4b Expose detected tag corners (#702)
Removes GetCorners, replaces with getMinAreaRectCorners and getDetectedCorners
2023-01-06 22:20:27 -05:00
Matt
087429dab9 [Workaround] Publish rawBytes as periodic (#707)
Closes #704 -- addressed by upstream PR https://github.com/wpilibsuite/allwpilib/pull/4903 (not released yet)
2023-01-06 17:53:19 -05:00
Nick Hadley
0f427bb52b Update PhotonCamera error messages to be more specific (#697)
Closes #692
2023-01-05 19:28:32 -05:00
Nick Hadley
0b5256df12 RobotPoseEstimator Enhancements (#677)
* Use List for RobotPoseEstimator constructor

* Update `RobotPoseEstimator` constructor to accept wpilib `AprilTagFieldLayout` java

* Initial cpp changes

* Java return optional from update

* Fix java test

* Clean up strategy switch

* small lint

* Actually link to vision_shared

* Fix auto optimized imports

* format

* report error

* small method changes

* format and clean up

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2023-01-02 18:22:39 -06:00
Chris Gerth
d0bf64af6c Convert input/output image save to integers (#664)
Changes image saving technique to use integers, not booleans
2022-12-30 22:48:28 -05:00
Jack
550194152a Add RobotPoseEstimator (#571)
RobotPoseEstimator can pick the most likely pose for the robot given a number of possible poses, using a number of different strategies. Examples are still WIP.
2022-12-30 01:40:13 -05:00
Lavi Arzi
8330bf9d92 Expose camera name in PhotonCamera (#523)
Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2022-12-25 00:01:57 -05:00
shueja-personal
bb63af601d Update to wpilib 2023 beta 7 (#607)
We now need platform specific jars -- reworks actions to support that. Currently only generates 32 bit pi images.
2022-12-16 20:05:23 -05:00
Noah
7dd1719fbd Expose NT entry change time in PhotonLib (#562)
Adds target change timestamp to PhotonPipelineResult

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
2022-11-07 13:09:55 -05:00
Chris Gerth
b408a58e9e Sim Updates for 2023 (#512)
* WIP updating sim stuff for 2023 and pose3d's

* vision system build fixups, but test not yet passing.

* WIP Sim fixups and working on testcases

* Still doesn't work, but closer

* tests pass

* removed C++ sim support

* formatting update

* adjusted target height above ground per review

* Turns out its unused

* missed example removal
2022-11-03 15:05:37 -05:00
Matt
2d7a88e231 Expose both pose solutions (#521)
* Half-add second pose

* add c++

* run wpiformat

* Fix c++
2022-10-22 06:42:45 -05:00
Matt
def40484e3 Add delay to version check (#466)
Rate limits version check spam print

Co-authored-by: Chris Gerth <gerth2@users.noreply.github.com>
2022-10-21 20:53:28 -04:00
Matt
2c6b0ddac3 Expose pose ambiguity (#483)
* Expose pose ambiguity

* Run spotless

* Add tooltips and expose number of iterations
2022-10-08 09:27:00 -04:00