photonlibpy 2025.0.0b7__tar.gz → 2025.1.1rc1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/PKG-INFO +3 -2
- photonlibpy-2025.1.1rc1/photonlibpy/__init__.py +28 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/generated/MultiTargetPNPResultSerde.py +23 -16
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/generated/PhotonPipelineMetadataSerde.py +23 -16
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/generated/PhotonPipelineResultSerde.py +23 -16
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/generated/PhotonTrackedTargetSerde.py +23 -16
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/generated/PnpResultSerde.py +23 -16
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/generated/TargetCornerSerde.py +23 -16
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/photonCamera.py +4 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/simulation/photonCameraSim.py +5 -2
- photonlibpy-2025.1.1rc1/photonlibpy/timesync/__init__.py +1 -0
- photonlibpy-2025.1.1rc1/photonlibpy/timesync/timeSyncServer.py +94 -0
- photonlibpy-2025.1.1rc1/photonlibpy/version.py +2 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy.egg-info/PKG-INFO +3 -2
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy.egg-info/SOURCES.txt +3 -1
- photonlibpy-2025.1.1rc1/photonlibpy.egg-info/requires.txt +9 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/setup.py +9 -6
- photonlibpy-2025.0.0b7/photonlibpy/__init__.py +0 -21
- photonlibpy-2025.0.0b7/photonlibpy/version.py +0 -2
- photonlibpy-2025.0.0b7/photonlibpy.egg-info/requires.txt +0 -9
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/estimatedRobotPose.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/estimation/__init__.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/estimation/cameraTargetRelation.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/estimation/openCVHelp.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/estimation/rotTrlTransform3d.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/estimation/targetModel.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/estimation/visionEstimation.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/generated/__init__.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/networktables/NTTopicSet.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/networktables/__init__.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/packet.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/photonPoseEstimator.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/py.typed +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/simulation/__init__.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/simulation/simCameraProperties.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/simulation/videoSimUtil.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/simulation/visionSystemSim.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/simulation/visionTargetSim.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/targeting/TargetCorner.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/targeting/__init__.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/targeting/multiTargetPNPResult.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/targeting/photonPipelineResult.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/targeting/photonTrackedTarget.py +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy.egg-info/dependency_links.txt +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy.egg-info/top_level.txt +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/pyproject.toml +0 -0
- {photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/setup.cfg +0 -0
@@ -1,9 +1,10 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: photonlibpy
|
3
|
-
Version: 2025.
|
4
|
-
Summary: Pure-python implementation of PhotonLib for interfacing with PhotonVision on coprocessors. Implemented with PhotonVision version v2025.
|
3
|
+
Version: 2025.1.1rc1
|
4
|
+
Summary: Pure-python implementation of PhotonLib for interfacing with PhotonVision on coprocessors. Implemented with PhotonVision version v2025.1.1-rc1 .
|
5
5
|
Home-page: https://photonvision.org
|
6
6
|
Author: Photonvision Development Team
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
7
8
|
Description-Content-Type: text/markdown
|
8
9
|
|
9
10
|
A Pure-python implementation of PhotonLib
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#
|
2
|
+
# MIT License
|
3
|
+
#
|
4
|
+
# Copyright (c) PhotonVision
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
#
|
24
|
+
|
25
|
+
from .estimatedRobotPose import EstimatedRobotPose # noqa
|
26
|
+
from .packet import Packet # noqa
|
27
|
+
from .photonCamera import PhotonCamera # noqa
|
28
|
+
from .photonPoseEstimator import PhotonPoseEstimator, PoseStrategy # noqa
|
@@ -1,19 +1,26 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
1
|
+
#
|
2
|
+
# MIT License
|
3
|
+
#
|
4
|
+
# Copyright (c) PhotonVision
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
#
|
17
24
|
|
18
25
|
###############################################################################
|
19
26
|
## THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py.
|
@@ -1,19 +1,26 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
1
|
+
#
|
2
|
+
# MIT License
|
3
|
+
#
|
4
|
+
# Copyright (c) PhotonVision
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
#
|
17
24
|
|
18
25
|
###############################################################################
|
19
26
|
## THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py.
|
@@ -1,19 +1,26 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
1
|
+
#
|
2
|
+
# MIT License
|
3
|
+
#
|
4
|
+
# Copyright (c) PhotonVision
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
#
|
17
24
|
|
18
25
|
###############################################################################
|
19
26
|
## THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py.
|
{photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/generated/PhotonTrackedTargetSerde.py
RENAMED
@@ -1,19 +1,26 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
1
|
+
#
|
2
|
+
# MIT License
|
3
|
+
#
|
4
|
+
# Copyright (c) PhotonVision
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
#
|
17
24
|
|
18
25
|
###############################################################################
|
19
26
|
## THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py.
|
@@ -1,19 +1,26 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
1
|
+
#
|
2
|
+
# MIT License
|
3
|
+
#
|
4
|
+
# Copyright (c) PhotonVision
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
#
|
17
24
|
|
18
25
|
###############################################################################
|
19
26
|
## THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py.
|
{photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/generated/TargetCornerSerde.py
RENAMED
@@ -1,19 +1,26 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
1
|
+
#
|
2
|
+
# MIT License
|
3
|
+
#
|
4
|
+
# Copyright (c) PhotonVision
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
#
|
17
24
|
|
18
25
|
###############################################################################
|
19
26
|
## THIS FILE WAS AUTO-GENERATED BY ./photon-serde/generate_messages.py.
|
@@ -27,6 +27,7 @@ from wpilib import RobotController, Timer
|
|
27
27
|
|
28
28
|
from .packet import Packet
|
29
29
|
from .targeting.photonPipelineResult import PhotonPipelineResult
|
30
|
+
from .timesync.timeSyncServer import inst
|
30
31
|
from .version import PHOTONLIB_VERSION # type: ignore[import-untyped]
|
31
32
|
|
32
33
|
|
@@ -104,6 +105,9 @@ class PhotonCamera:
|
|
104
105
|
self._prevHeartbeat = 0
|
105
106
|
self._prevHeartbeatChangeTime = Timer.getFPGATimestamp()
|
106
107
|
|
108
|
+
# Start the time sync server
|
109
|
+
inst.start()
|
110
|
+
|
107
111
|
def getAllUnreadResults(self) -> List[PhotonPipelineResult]:
|
108
112
|
"""
|
109
113
|
The list of pipeline results sent by PhotonVision since the last call to getAllUnreadResults().
|
{photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/simulation/photonCameraSim.py
RENAMED
@@ -36,6 +36,9 @@ class PhotonCameraSim:
|
|
36
36
|
self,
|
37
37
|
camera: PhotonCamera,
|
38
38
|
props: SimCameraProperties = SimCameraProperties.PERFECT_90DEG(),
|
39
|
+
tagLayout: AprilTagFieldLayout = AprilTagFieldLayout.loadField(
|
40
|
+
AprilTagField.kDefaultField
|
41
|
+
),
|
39
42
|
minTargetAreaPercent: float | None = None,
|
40
43
|
maxSightRange: meters | None = None,
|
41
44
|
):
|
@@ -64,7 +67,7 @@ class PhotonCameraSim:
|
|
64
67
|
self.videoSimProcEnabled: bool = False
|
65
68
|
self.heartbeatCounter: int = 0
|
66
69
|
self.nextNtEntryTime = wpilib.Timer.getFPGATimestamp()
|
67
|
-
self.tagLayout =
|
70
|
+
self.tagLayout = tagLayout
|
68
71
|
|
69
72
|
self.cam = camera
|
70
73
|
self.prop = props
|
@@ -420,9 +423,9 @@ class PhotonCameraSim:
|
|
420
423
|
now_micros = wpilib.Timer.getFPGATimestamp() * 1e6
|
421
424
|
return PhotonPipelineResult(
|
422
425
|
metadata=PhotonPipelineMetadata(
|
423
|
-
self.heartbeatCounter,
|
424
426
|
int(now_micros - latency * 1e6),
|
425
427
|
int(now_micros),
|
428
|
+
self.heartbeatCounter,
|
426
429
|
# Pretend like we heard a pong recently
|
427
430
|
int(np.random.uniform(950, 1050)),
|
428
431
|
),
|
@@ -0,0 +1 @@
|
|
1
|
+
# no one but us chickens
|
@@ -0,0 +1,94 @@
|
|
1
|
+
import logging
|
2
|
+
import socket
|
3
|
+
import struct
|
4
|
+
import threading
|
5
|
+
from typing import Callable, Optional
|
6
|
+
|
7
|
+
from wpilib import Timer
|
8
|
+
|
9
|
+
|
10
|
+
class TspPing:
|
11
|
+
def __init__(self, version: int, message_id: int, client_time: int):
|
12
|
+
self.version = version
|
13
|
+
self.message_id = message_id
|
14
|
+
self.client_time = client_time
|
15
|
+
|
16
|
+
@staticmethod
|
17
|
+
def unpack(data: bytes) -> "TspPing":
|
18
|
+
# Unpack using struct.unpack
|
19
|
+
version, message_id, client_time = struct.unpack("<BBQ", data)
|
20
|
+
return TspPing(version, message_id, client_time)
|
21
|
+
|
22
|
+
def pack(self) -> bytes:
|
23
|
+
# Pack using struct.pack
|
24
|
+
return struct.pack("<BBQ", self.version, self.message_id, self.client_time)
|
25
|
+
|
26
|
+
|
27
|
+
class TspPong:
|
28
|
+
def __init__(self, ping: "TspPing", server_time: int):
|
29
|
+
self.version = ping.version
|
30
|
+
self.message_id = 2 # Pong message ID
|
31
|
+
self.client_time = ping.client_time
|
32
|
+
self.server_time = server_time
|
33
|
+
|
34
|
+
def pack(self) -> bytes:
|
35
|
+
# Pack using struct.pack
|
36
|
+
return struct.pack(
|
37
|
+
"<BBQQ", self.version, self.message_id, self.client_time, self.server_time
|
38
|
+
)
|
39
|
+
|
40
|
+
@staticmethod
|
41
|
+
def unpack(data: bytes) -> "TspPong":
|
42
|
+
# Unpack using struct.unpack
|
43
|
+
version, message_id, client_time, server_time = struct.unpack("<BBQQ", data)
|
44
|
+
ping = TspPing(version, message_id, client_time)
|
45
|
+
return TspPong(ping, server_time)
|
46
|
+
|
47
|
+
|
48
|
+
class TimeSyncServer:
|
49
|
+
"""This class is a python re-write of the UDP time sync server protocol
|
50
|
+
which runs on a roboRIO to establish a timebase for all PhotonVision coprocessors.
|
51
|
+
"""
|
52
|
+
|
53
|
+
PORT = 5810
|
54
|
+
|
55
|
+
def __init__(self, time_provider: Optional[Callable[[], int]] = None):
|
56
|
+
self.time_provider = time_provider or Timer.getFPGATimestamp
|
57
|
+
self._process: Optional[threading.Thread] = None
|
58
|
+
self.logger = logging.getLogger("PhotonVision-TimeSyncServer")
|
59
|
+
|
60
|
+
def _udp_server(self):
|
61
|
+
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as udp_socket:
|
62
|
+
udp_socket.bind(("0.0.0.0", self.PORT))
|
63
|
+
while True:
|
64
|
+
data, addr = udp_socket.recvfrom(1024) # Buffer size of 1024 bytes
|
65
|
+
|
66
|
+
if len(data) < 10:
|
67
|
+
self.logger.error("Too few bytes")
|
68
|
+
continue # Ignore incomplete packets
|
69
|
+
|
70
|
+
ping = TspPing.unpack(data)
|
71
|
+
if ping.version != 1 or ping.message_id != 1:
|
72
|
+
self.logger.error("Invalid Version/ID")
|
73
|
+
continue # Ignore invalid pings
|
74
|
+
|
75
|
+
server_time = int(self.time_provider() * 1e6) # Convert to microseconds
|
76
|
+
pong = TspPong(ping, server_time)
|
77
|
+
udp_socket.sendto(pong.pack(), addr)
|
78
|
+
|
79
|
+
def start(self):
|
80
|
+
if self._process is not None and self._process.is_alive():
|
81
|
+
return # Nothing to do
|
82
|
+
|
83
|
+
self._process = threading.Thread(target=self._udp_server, daemon=True)
|
84
|
+
self._process.start()
|
85
|
+
self.logger.info("Server Started")
|
86
|
+
|
87
|
+
def stop(self):
|
88
|
+
if self._process is not None:
|
89
|
+
self._process.join()
|
90
|
+
self._process = None
|
91
|
+
self.logger.info("Server Stopped")
|
92
|
+
|
93
|
+
|
94
|
+
inst = TimeSyncServer()
|
@@ -1,9 +1,10 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: photonlibpy
|
3
|
-
Version: 2025.
|
4
|
-
Summary: Pure-python implementation of PhotonLib for interfacing with PhotonVision on coprocessors. Implemented with PhotonVision version v2025.
|
3
|
+
Version: 2025.1.1rc1
|
4
|
+
Summary: Pure-python implementation of PhotonLib for interfacing with PhotonVision on coprocessors. Implemented with PhotonVision version v2025.1.1-rc1 .
|
5
5
|
Home-page: https://photonvision.org
|
6
6
|
Author: Photonvision Development Team
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
7
8
|
Description-Content-Type: text/markdown
|
8
9
|
|
9
10
|
A Pure-python implementation of PhotonLib
|
@@ -37,4 +37,6 @@ photonlibpy/targeting/TargetCorner.py
|
|
37
37
|
photonlibpy/targeting/__init__.py
|
38
38
|
photonlibpy/targeting/multiTargetPNPResult.py
|
39
39
|
photonlibpy/targeting/photonPipelineResult.py
|
40
|
-
photonlibpy/targeting/photonTrackedTarget.py
|
40
|
+
photonlibpy/targeting/photonTrackedTarget.py
|
41
|
+
photonlibpy/timesync/__init__.py
|
42
|
+
photonlibpy/timesync/timeSyncServer.py
|
@@ -29,7 +29,7 @@ if m:
|
|
29
29
|
split = gitDescribeResult.split("-")
|
30
30
|
if len(split) == 3:
|
31
31
|
year, commits, sha = split
|
32
|
-
# Chop off leading v from "v2024.1.2", and use "post" for commits to
|
32
|
+
# Chop off leading v from "v2024.1.2", and use "post" for commits to main since
|
33
33
|
versionString = f"{year[1:]}post{commits}"
|
34
34
|
print("using dev release " + versionString)
|
35
35
|
else:
|
@@ -59,11 +59,11 @@ setup(
|
|
59
59
|
version=versionString,
|
60
60
|
install_requires=[
|
61
61
|
"numpy~=2.1",
|
62
|
-
"wpilib<2026,>=2025.
|
63
|
-
"robotpy-wpimath<2026,>=2025.
|
64
|
-
"robotpy-apriltag<2026,>=2025.
|
65
|
-
"robotpy-cscore<2026,>=2025.
|
66
|
-
"pyntcore<2026,>=2025.
|
62
|
+
"wpilib<2026,>=2025.2.1",
|
63
|
+
"robotpy-wpimath<2026,>=2025.2.1",
|
64
|
+
"robotpy-apriltag<2026,>=2025.2.1",
|
65
|
+
"robotpy-cscore<2026,>=2025.2.1",
|
66
|
+
"pyntcore<2026,>=2025.2.1",
|
67
67
|
"opencv-python;platform_machine!='roborio'",
|
68
68
|
],
|
69
69
|
description=descriptionStr,
|
@@ -71,4 +71,7 @@ setup(
|
|
71
71
|
author="Photonvision Development Team",
|
72
72
|
long_description="A Pure-python implementation of PhotonLib",
|
73
73
|
long_description_content_type="text/markdown",
|
74
|
+
classifiers=[
|
75
|
+
"License :: OSI Approved :: MIT License",
|
76
|
+
],
|
74
77
|
)
|
@@ -1,21 +0,0 @@
|
|
1
|
-
###############################################################################
|
2
|
-
## Copyright (C) Photon Vision.
|
3
|
-
###############################################################################
|
4
|
-
## This program is free software: you can redistribute it and/or modify
|
5
|
-
## it under the terms of the GNU General Public License as published by
|
6
|
-
## the Free Software Foundation, either version 3 of the License, or
|
7
|
-
## (at your option) any later version.
|
8
|
-
##
|
9
|
-
## This program is distributed in the hope that it will be useful,
|
10
|
-
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
## GNU General Public License for more details.
|
13
|
-
##
|
14
|
-
## You should have received a copy of the GNU General Public License
|
15
|
-
## along with this program. If not, see <https://www.gnu.org/licenses/>.
|
16
|
-
###############################################################################
|
17
|
-
|
18
|
-
from .estimatedRobotPose import EstimatedRobotPose # noqa
|
19
|
-
from .packet import Packet # noqa
|
20
|
-
from .photonCamera import PhotonCamera # noqa
|
21
|
-
from .photonPoseEstimator import PhotonPoseEstimator, PoseStrategy # noqa
|
File without changes
|
File without changes
|
{photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/estimation/cameraTargetRelation.py
RENAMED
File without changes
|
File without changes
|
{photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/estimation/rotTrlTransform3d.py
RENAMED
File without changes
|
File without changes
|
{photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/estimation/visionEstimation.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
|
{photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/simulation/simCameraProperties.py
RENAMED
File without changes
|
File without changes
|
{photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/simulation/visionSystemSim.py
RENAMED
File without changes
|
{photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/simulation/visionTargetSim.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/targeting/multiTargetPNPResult.py
RENAMED
File without changes
|
{photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/targeting/photonPipelineResult.py
RENAMED
File without changes
|
{photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy/targeting/photonTrackedTarget.py
RENAMED
File without changes
|
{photonlibpy-2025.0.0b7 → photonlibpy-2025.1.1rc1}/photonlibpy.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|