Sam Freund
30645803e6
chore: bump wpilib to 2025.3.2 and fix mypy errors ( #1819 )
2025-03-19 01:31:59 -04:00
David Vo
ab41d2d1ed
photonlibpy: Explicitly re-export ( #1737 )
2025-01-17 18:28:16 -08:00
David Vo
a08dc374c8
photonlibpy: License under MIT ( #1700 )
...
Everything under the `photon-lib` directory is intended to all be
licensed under MIT:
e40c8fbca0/photon-lib/.styleguide-license (L2)
Presumably we don't want to force teams to release their robot code
under GPL.
2025-01-13 12:00:09 -05:00
mythgarr
159b848234
[python] Fix PhotonPipelineMetadata constructor arg order ( #1698 )
...
Relates to https://github.com/PhotonVision/photonvision/pull/1578
2025-01-11 23:29:19 -05:00
David Vo
53e6890f20
photon-serde: Relicense generated files under MIT ( #1709 )
2025-01-11 16:55:55 -07:00
Jochem
cc740c92c9
Added constructor overload to PhotonCameraSim for AprilTagFieldLayout ( #1692 )
2025-01-08 11:43:46 -07:00
Chris Gerth
6c7a174424
Adding timeSyncServer for Python ( #1675 )
2025-01-03 12:23:27 -06:00
Jade
7c254ec5dc
Change from k2024Crescendo to kDefaultField for AprilTagFieldLayout ( #1667 )
...
This reduces the things we need to update each year
Signed-off-by: Jade Turner <spacey-sooty@proton.me >
Co-authored-by: Matt <matthew.morley.ca@gmail.com >
2025-01-03 22:03:00 +08:00
Craig Schardt
6a8d638853
Fix typehint problem with ndarrays ( #1631 )
...
mypy was inferring the wrong type for ndarrays in photonCameraSim.py.
This fixes the problem by adding typehints using numpy.typing.NDArray.
2024-12-09 05:21:37 +00:00
Craig Schardt
4997ad9115
Fix formating errors that are in master ( #1627 )
...
A few files with format mistakes were merged into master and they cause
spotless and wpiformat to fail. This PR fixes those files.
2024-12-06 22:21:05 +00:00
James Ward
1dbd2e5990
[python] Correct time units ( #1605 )
2024-11-28 16:12:52 +00:00
Lucien Morey
61552ad6ca
Tidy up of python autogenerated messages ( #1594 )
...
This fixes mostly formatting issues so there is no longer any diff with
things after rerunning the generation script. Yes, most of this can be
fixed by running wpiformat but that doesn't exist as a pre-commit hook
atm, so I think this is nicer.
It also removes any reference to the java encode/decode within the
python message gen
2024-11-21 04:43:33 +00:00
Lucien Morey
fa66ed866c
add file marker for type checking ( #1598 )
...
I think this is the correct way to do this based on my understanding of
the guide to making a [pep561 compliant
package](https://mypy.readthedocs.io/en/stable/installed_packages.html#creating-pep-561-compatible-packages )
and this example in
[black](https://github.com/psf/black/pull/1395/files ). Given that I get
all the type-checking info from a local installation, I don't know if
this is testable until it's published on Pypi.
resolves #1210
2024-11-21 04:43:05 +00:00
Lucien Morey
c536a1c312
add missing log and use logger over print ( #1596 )
...
This is closer to a port of the Java/C++ stuff and will mean we get a
more standard print output with the rest of the logging in the lib
2024-11-21 03:01:08 +00:00
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
James Ward
f107c94d05
[python] Fix population of metadata ( #1578 )
2024-11-16 18:25:43 -08:00
Lucien Morey
04191efc51
sphinxify java docs for python code ( #1575 )
2024-11-15 18:01:33 -08:00
Lucien Morey
dfed7e3621
Break up masssive python overload hacks ( #1573 )
...
What it says on the tin. This is all stuff from our initial effort to
port the sim things. Right now it is coupled to #1557 because this fixes
things up in that. Lets merge that one before dealing with this one
2024-11-14 14:59:55 -08:00
Lucien Morey
c50c657193
Add Python test harness for openCVHelp class ( #1557 )
2024-11-14 11:10:08 -05:00
Lucien Morey
a64491a59e
[photonlibpy] add mypy to ci ( #1570 )
...
Co-authored-by: James Ward <james@thedropbears.org.au >
2024-11-13 10:39:02 -05:00
Lucien Morey
a7319ce1d6
[photonlibpy] bump python dependencies for 2025 ( #1567 )
...
I tasked my team with updating our upcoming Reefscape codebase to target
2025 packages, only to realise we have created an unsolvable dependency
nightmare with these things being neglected...
2024-11-13 10:38:44 -05:00
James Ward
744e522aea
Correct yet more python type hinting ( #1555 )
2024-11-12 11:17:27 -05:00
David Vo
af03ae0a8b
photonlibpy: Fix some type check failures ( #1548 )
...
This fixes a variety of type check failures raised by both mypy and pyright. See #1548
2024-11-12 00:53:43 -05:00
Lucien Morey
b3d74e56a0
Add python simulation ( #1532 )
2024-11-10 14:16:02 -08:00
Jade
d8de4a7863
[build] Update wpiformat to 2024.45 ( #1545 )
...
Signed-off-by: Jade Turner <spacey-sooty@proton.me >
2024-11-10 13:42:16 +08:00
Lucien Morey
d188c37466
Fix missing vars and catch bad shim ( #1541 )
...
I made a mistake when cherry-picking things into #1534 . Fixing it also
prompted me to regenerate message things without thinking even though it
wasn't needed here but it helped me catch an issue with a bad shim. I
must not have saved it properly on my computer and missed it before
review.
2024-11-09 17:32:35 -05:00
Lucien Morey
14fcc5d485
generate packing for python messages ( #1535 )
...
Generate packet serialization in Python, too.
2024-11-09 13:08:45 -05:00
Lucien Morey
1d8d934a8a
Enable Python tests, standardise variable spelling and fix arg checking ( #1533 )
...
I found these with a quick find-and-replace and checked against the inbuilt Python type checking. I am away from my robot and can't really
confirm there are no flow-on effects. There are no other active usages of the bad casing in the Python code, so we should be good. The generated serde messages already use this casing, so we don't need to update there.
2024-11-09 08:08:57 +08:00
Lucien Morey
bdb2949b4b
Stop type hinting members as optional in PhotonTrackedTarget ( #1539 )
...
List types should never be optional if sent to NT because an empty list conveys the same
thing.
The equivalent C++ struct takes the same approach with empty vectors rather than an optional vector.
2024-11-09 07:58:56 +08:00
Lucien Morey
150561abf2
Add missing var to dataclass ( #1534 )
2024-11-07 18:31:21 -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
f33218c49c
Add message UUID and type names to hash and message defintion ( #1409 )
2024-09-22 22:27:13 -04:00
Chris Gerth
9e6a066561
Examples Clean-Up ( #1408 )
2024-09-15 00:10:02 -04:00
Matt
169595e56e
Auto-generate packet dataclasses with Jinja ( #1374 )
2024-08-31 13:44:19 -04:00
Matt
738e3646f7
Photonlibpy - Best Target Function #1223 ( #1406 )
...
Supercedes https://github.com/PhotonVision/photonvision/pull/1223
---------
Co-authored-by: vladb <vlad.bondar@frc5113.com >
2024-08-31 12:30:09 -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
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
1708376df8
Expose object detection class id/conf in photonlib ( #1266 )
...
* Implement class id/conf in photonlib
* Maybe fix things
* run lint
* Update Packet.java comments
* Update Packet.java comments again
* Update comments
* oops
* Update packet.py
---------
Co-authored-by: Chris Gerth <gerth2@users.noreply.github.com >
2024-05-10 14:52:16 -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
Chris Gerth
3738e7821b
fix latency calculation ( #1227 )
2024-02-09 18:45:38 -06:00
Chris Gerth
5851509a9e
Python tweaks ( #1211 )
...
* Increasing api parity with java/cpp by adding hasTargets
* type hints fixed up
* wpiFormat
2024-02-02 14:17:53 -06:00
Ethan Wall
90773e0e4a
[photonlib-py] Begin implementing PhotonPoseEstimator in Python ( #1178 )
...
* [photonlib-py] Initial impl of PhotonPoseEstimator
---------
Co-authored-by: Matt <matthew.morley.ca@gmail.com >
2024-01-21 06:57:32 -06:00
Max Worrall
5f591a51c4
[photonlib-py] Remove print statement ( #1171 )
2024-01-18 11:21:42 -05:00
Chris Gerth
851f2e4e68
Update Python rawBytes parsing ( #1119 )
...
* data updates to capture multiple rawBytes packets associated with serde updates from late this past month
---------
Co-authored-by: Matt <matthew.morley.ca@gmail.com >
2024-01-06 06:17:06 -06: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
Chris Gerth
e3eff8731f
Version mismatch is harder to miss. ( #1088 )
2023-12-30 15:34:52 -05:00
Chris Gerth
f7f304ca7a
fix bad implementation of global variables and version check, which prevented python version checks from working ( #1050 )
2023-12-17 08:27:41 -05:00
Chris Gerth
47aea29b6b
Add photonlibpy ( #1040 )
...
* Added a pure-python implementation of photonlib, named photonlibpy and hosted on pypi
---------
Co-authored-by: Matt <matthew.morley.ca@gmail.com >
2023-12-16 12:32:49 -06:00