photonlibpy 2025.0.0b4__tar.gz → 2025.0.0b5__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/PKG-INFO +2 -2
  2. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimation/openCVHelp.py +5 -1
  3. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/PhotonPipelineResultSerde.py +1 -3
  4. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/photonCamera.py +34 -35
  5. photonlibpy-2025.0.0b5/photonlibpy/py.typed +1 -0
  6. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/simulation/simCameraProperties.py +3 -1
  7. photonlibpy-2025.0.0b5/photonlibpy/version.py +2 -0
  8. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy.egg-info/PKG-INFO +2 -2
  9. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy.egg-info/SOURCES.txt +1 -0
  10. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/setup.py +1 -0
  11. photonlibpy-2025.0.0b4/photonlibpy/version.py +0 -2
  12. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/__init__.py +0 -0
  13. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimatedRobotPose.py +0 -0
  14. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimation/__init__.py +0 -0
  15. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimation/cameraTargetRelation.py +0 -0
  16. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimation/rotTrlTransform3d.py +0 -0
  17. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimation/targetModel.py +0 -0
  18. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimation/visionEstimation.py +0 -0
  19. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/MultiTargetPNPResultSerde.py +0 -0
  20. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/PhotonPipelineMetadataSerde.py +0 -0
  21. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/PhotonTrackedTargetSerde.py +0 -0
  22. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/PnpResultSerde.py +0 -0
  23. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/TargetCornerSerde.py +0 -0
  24. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/__init__.py +0 -0
  25. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/networktables/NTTopicSet.py +0 -0
  26. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/networktables/__init__.py +0 -0
  27. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/packet.py +0 -0
  28. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/photonPoseEstimator.py +0 -0
  29. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/simulation/__init__.py +0 -0
  30. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/simulation/photonCameraSim.py +0 -0
  31. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/simulation/videoSimUtil.py +0 -0
  32. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/simulation/visionSystemSim.py +0 -0
  33. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/simulation/visionTargetSim.py +0 -0
  34. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/targeting/TargetCorner.py +0 -0
  35. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/targeting/__init__.py +0 -0
  36. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/targeting/multiTargetPNPResult.py +0 -0
  37. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/targeting/photonPipelineResult.py +0 -0
  38. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/targeting/photonTrackedTarget.py +0 -0
  39. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy.egg-info/dependency_links.txt +0 -0
  40. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy.egg-info/requires.txt +0 -0
  41. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy.egg-info/top_level.txt +0 -0
  42. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/pyproject.toml +0 -0
  43. {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/setup.cfg +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: photonlibpy
3
- Version: 2025.0.0b4
4
- Summary: Pure-python implementation of PhotonLib for interfacing with PhotonVision on coprocessors. Implemented with PhotonVision version v2025.0.0-beta-4 .
3
+ Version: 2025.0.0b5
4
+ Summary: Pure-python implementation of PhotonLib for interfacing with PhotonVision on coprocessors. Implemented with PhotonVision version v2025.0.0-beta-5 .
5
5
  Home-page: https://photonvision.org
6
6
  Author: Photonvision Development Team
7
7
  Description-Content-Type: text/markdown
@@ -1,3 +1,4 @@
1
+ import logging
1
2
  import math
2
3
  from typing import Any
3
4
 
@@ -11,6 +12,8 @@ from .rotTrlTransform3d import RotTrlTransform3d
11
12
  NWU_TO_EDN = Rotation3d(np.array([[0, -1, 0], [0, 0, -1], [1, 0, 0]]))
12
13
  EDN_TO_NWU = Rotation3d(np.array([[0, 0, 1], [-1, 0, 0], [0, -1, 0]]))
13
14
 
15
+ logger = logging.getLogger(__name__)
16
+
14
17
 
15
18
  class OpenCVHelp:
16
19
  @staticmethod
@@ -243,7 +246,7 @@ class OpenCVHelp:
243
246
 
244
247
  # solvePnP failed
245
248
  if reprojectionError is None or math.isnan(reprojectionError[0, 0]):
246
- print("SolvePNP_Square failed!")
249
+ logger.error("SolvePNP_Square failed!")
247
250
  return None
248
251
 
249
252
  if alt:
@@ -303,6 +306,7 @@ class OpenCVHelp:
303
306
  )
304
307
 
305
308
  if math.isnan(error):
309
+ logger.error("SolvePNP_SQPNP failed!")
306
310
  return None
307
311
 
308
312
  # We have no alternative so set it to best as well
@@ -42,9 +42,7 @@ class PhotonPipelineResultSerde:
42
42
  ret = Packet()
43
43
 
44
44
  # metadata is of non-intrinsic type PhotonPipelineMetadata
45
- ret.encodeBytes(
46
- PhotonPipelineMetadata.photonStruct.pack(value.metadata).getData()
47
- )
45
+ ret.encodeBytes(PhotonPipelineMetadata.photonStruct.pack(value.metadata).getData())
48
46
 
49
47
  # targets is a custom VLA!
50
48
  ret.encodeList(value.targets, PhotonTrackedTarget.photonStruct)
@@ -298,43 +298,42 @@ class PhotonCamera:
298
298
 
299
299
  # Check mdef UUID
300
300
  localUUID = PhotonPipelineResult.photonStruct.MESSAGE_VERSION
301
- remoteUUID = str(self._rawBytesEntry.getTopic().getProperty("message_uuid"))
301
+ remoteUUID = self._rawBytesEntry.getTopic().getProperty("message_uuid")
302
302
 
303
- if not remoteUUID:
303
+ if remoteUUID is None:
304
304
  wpilib.reportWarning(
305
305
  f"PhotonVision coprocessor at path {self._path} has not reported a message interface UUID - is your coprocessor's camera started?",
306
306
  True,
307
307
  )
308
-
309
- assert isinstance(remoteUUID, str)
310
- # ntcore hands us a JSON string with leading/trailing quotes - remove those
311
- remoteUUID = remoteUUID.replace('"', "")
312
-
313
- if localUUID != remoteUUID:
314
- # Verified version mismatch
315
-
316
- bfw = """
317
- \n\n\n
318
- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
319
- >>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
320
- >>>
321
- >>> You are running an incompatible version
322
- >>> of PhotonVision on your coprocessor!
323
- >>>
324
- >>> This is neither tested nor supported.
325
- >>> You MUST update PhotonVision,
326
- >>> PhotonLib, or both.
327
- >>>
328
- >>> Your code will now crash.
329
- >>> We hope your day gets better.
330
- >>>
331
- >>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
332
- >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
333
- \n\n
334
- """
335
-
336
- wpilib.reportWarning(bfw)
337
-
338
- errText = f"Photonlibpy version {PHOTONLIB_VERSION} (With message UUID {localUUID}) does not match coprocessor version {versionString} (with message UUID {remoteUUID}). Please install photonlibpy version {versionString}, or update your coprocessor to {PHOTONLIB_VERSION}."
339
- wpilib.reportError(errText, True)
340
- raise Exception(errText)
308
+ else:
309
+ # ntcore hands us a JSON string with leading/trailing quotes - remove those
310
+ remoteUUID = str(remoteUUID).replace('"', "")
311
+
312
+ if localUUID != remoteUUID:
313
+ # Verified version mismatch
314
+
315
+ bfw = """
316
+ \n\n\n
317
+ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
318
+ >>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
319
+ >>>
320
+ >>> You are running an incompatible version
321
+ >>> of PhotonVision on your coprocessor!
322
+ >>>
323
+ >>> This is neither tested nor supported.
324
+ >>> You MUST update PhotonVision,
325
+ >>> PhotonLib, or both.
326
+ >>>
327
+ >>> Your code will now crash.
328
+ >>> We hope your day gets better.
329
+ >>>
330
+ >>> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
331
+ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
332
+ \n\n
333
+ """
334
+
335
+ wpilib.reportWarning(bfw)
336
+
337
+ errText = f"Photonlibpy version {PHOTONLIB_VERSION} (With message UUID {localUUID}) does not match coprocessor version {versionString} (with message UUID {remoteUUID}). Please install photonlibpy version {versionString}, or update your coprocessor to {PHOTONLIB_VERSION}."
338
+ wpilib.reportError(errText, True)
339
+ raise Exception(errText)
@@ -9,6 +9,8 @@ from wpimath.units import hertz, seconds
9
9
 
10
10
  from ..estimation import RotTrlTransform3d
11
11
 
12
+ logger = logging.getLogger(__name__)
13
+
12
14
 
13
15
  class SimCameraProperties:
14
16
  """Calibration and performance values for this camera.
@@ -46,7 +48,7 @@ class SimCameraProperties:
46
48
  ) -> None:
47
49
  if fovDiag.degrees() < 1.0 or fovDiag.degrees() > 179.0:
48
50
  fovDiag = Rotation2d.fromDegrees(max(min(fovDiag.degrees(), 179.0), 1.0))
49
- logging.error("Requested invalid FOV! Clamping between (1, 179) degrees...")
51
+ logger.error("Requested invalid FOV! Clamping between (1, 179) degrees...")
50
52
 
51
53
  resDiag = math.sqrt(width * width + height * height)
52
54
  diagRatio = math.tan(fovDiag.radians() / 2.0)
@@ -0,0 +1,2 @@
1
+ PHOTONLIB_VERSION="v2025.0.0.beta.5"
2
+ PHOTONVISION_VERSION="v2025.0.0-beta-5"
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: photonlibpy
3
- Version: 2025.0.0b4
4
- Summary: Pure-python implementation of PhotonLib for interfacing with PhotonVision on coprocessors. Implemented with PhotonVision version v2025.0.0-beta-4 .
3
+ Version: 2025.0.0b5
4
+ Summary: Pure-python implementation of PhotonLib for interfacing with PhotonVision on coprocessors. Implemented with PhotonVision version v2025.0.0-beta-5 .
5
5
  Home-page: https://photonvision.org
6
6
  Author: Photonvision Development Team
7
7
  Description-Content-Type: text/markdown
@@ -5,6 +5,7 @@ photonlibpy/estimatedRobotPose.py
5
5
  photonlibpy/packet.py
6
6
  photonlibpy/photonCamera.py
7
7
  photonlibpy/photonPoseEstimator.py
8
+ photonlibpy/py.typed
8
9
  photonlibpy/version.py
9
10
  photonlibpy.egg-info/PKG-INFO
10
11
  photonlibpy.egg-info/SOURCES.txt
@@ -55,6 +55,7 @@ descriptionStr = f"Pure-python implementation of PhotonLib for interfacing with
55
55
  setup(
56
56
  name="photonlibpy",
57
57
  packages=find_packages(),
58
+ package_data={"photonlibpy": ["py.typed"]},
58
59
  version=versionString,
59
60
  install_requires=[
60
61
  "numpy~=2.1",
@@ -1,2 +0,0 @@
1
- PHOTONLIB_VERSION="v2025.0.0.beta.4"
2
- PHOTONVISION_VERSION="v2025.0.0-beta-4"