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.
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/PKG-INFO +2 -2
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimation/openCVHelp.py +5 -1
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/PhotonPipelineResultSerde.py +1 -3
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/photonCamera.py +34 -35
- photonlibpy-2025.0.0b5/photonlibpy/py.typed +1 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/simulation/simCameraProperties.py +3 -1
- photonlibpy-2025.0.0b5/photonlibpy/version.py +2 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy.egg-info/PKG-INFO +2 -2
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy.egg-info/SOURCES.txt +1 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/setup.py +1 -0
- photonlibpy-2025.0.0b4/photonlibpy/version.py +0 -2
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/__init__.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimatedRobotPose.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimation/__init__.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimation/cameraTargetRelation.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimation/rotTrlTransform3d.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimation/targetModel.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimation/visionEstimation.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/MultiTargetPNPResultSerde.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/PhotonPipelineMetadataSerde.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/PhotonTrackedTargetSerde.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/PnpResultSerde.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/TargetCornerSerde.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/__init__.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/networktables/NTTopicSet.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/networktables/__init__.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/packet.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/photonPoseEstimator.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/simulation/__init__.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/simulation/photonCameraSim.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/simulation/videoSimUtil.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/simulation/visionSystemSim.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/simulation/visionTargetSim.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/targeting/TargetCorner.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/targeting/__init__.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/targeting/multiTargetPNPResult.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/targeting/photonPipelineResult.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/targeting/photonTrackedTarget.py +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy.egg-info/dependency_links.txt +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy.egg-info/requires.txt +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy.egg-info/top_level.txt +0 -0
- {photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/pyproject.toml +0 -0
- {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.
|
4
|
-
Summary: Pure-python implementation of PhotonLib for interfacing with PhotonVision on coprocessors. Implemented with PhotonVision version v2025.0.0-beta-
|
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
|
-
|
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
|
{photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/PhotonPipelineResultSerde.py
RENAMED
@@ -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 =
|
301
|
+
remoteUUID = self._rawBytesEntry.getTopic().getProperty("message_uuid")
|
302
302
|
|
303
|
-
if
|
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
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
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)
|
@@ -0,0 +1 @@
|
|
1
|
+
|
{photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/simulation/simCameraProperties.py
RENAMED
@@ -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
|
-
|
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)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: photonlibpy
|
3
|
-
Version: 2025.0.
|
4
|
-
Summary: Pure-python implementation of PhotonLib for interfacing with PhotonVision on coprocessors. Implemented with PhotonVision version v2025.0.0-beta-
|
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
|
File without changes
|
File without changes
|
File without changes
|
{photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimation/cameraTargetRelation.py
RENAMED
File without changes
|
{photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimation/rotTrlTransform3d.py
RENAMED
File without changes
|
File without changes
|
{photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/estimation/visionEstimation.py
RENAMED
File without changes
|
{photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/MultiTargetPNPResultSerde.py
RENAMED
File without changes
|
File without changes
|
{photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/PhotonTrackedTargetSerde.py
RENAMED
File without changes
|
File without changes
|
{photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/generated/TargetCornerSerde.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/targeting/multiTargetPNPResult.py
RENAMED
File without changes
|
{photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/targeting/photonPipelineResult.py
RENAMED
File without changes
|
{photonlibpy-2025.0.0b4 → photonlibpy-2025.0.0b5}/photonlibpy/targeting/photonTrackedTarget.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|