photonlibpy 2025.0.0b8__tar.gz → 2025.1.1.post20__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/PKG-INFO +3 -2
  2. photonlibpy-2025.1.1.post20/photonlibpy/__init__.py +36 -0
  3. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/generated/MultiTargetPNPResultSerde.py +23 -16
  4. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/generated/PhotonPipelineMetadataSerde.py +23 -16
  5. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/generated/PhotonPipelineResultSerde.py +23 -16
  6. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/generated/PhotonTrackedTargetSerde.py +23 -16
  7. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/generated/PnpResultSerde.py +23 -16
  8. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/generated/TargetCornerSerde.py +23 -16
  9. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/photonCamera.py +4 -0
  10. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/simulation/__init__.py +8 -0
  11. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/simulation/photonCameraSim.py +5 -2
  12. photonlibpy-2025.1.1.post20/photonlibpy/targeting/__init__.py +13 -0
  13. photonlibpy-2025.1.1.post20/photonlibpy/timesync/__init__.py +1 -0
  14. photonlibpy-2025.1.1.post20/photonlibpy/timesync/timeSyncServer.py +94 -0
  15. photonlibpy-2025.1.1.post20/photonlibpy/version.py +2 -0
  16. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy.egg-info/PKG-INFO +3 -2
  17. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy.egg-info/SOURCES.txt +3 -1
  18. photonlibpy-2025.1.1.post20/photonlibpy.egg-info/requires.txt +9 -0
  19. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/setup.py +12 -7
  20. photonlibpy-2025.0.0b8/photonlibpy/__init__.py +0 -21
  21. photonlibpy-2025.0.0b8/photonlibpy/targeting/__init__.py +0 -6
  22. photonlibpy-2025.0.0b8/photonlibpy/version.py +0 -2
  23. photonlibpy-2025.0.0b8/photonlibpy.egg-info/requires.txt +0 -9
  24. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/estimatedRobotPose.py +0 -0
  25. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/estimation/__init__.py +0 -0
  26. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/estimation/cameraTargetRelation.py +0 -0
  27. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/estimation/openCVHelp.py +0 -0
  28. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/estimation/rotTrlTransform3d.py +0 -0
  29. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/estimation/targetModel.py +0 -0
  30. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/estimation/visionEstimation.py +0 -0
  31. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/generated/__init__.py +0 -0
  32. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/networktables/NTTopicSet.py +0 -0
  33. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/networktables/__init__.py +0 -0
  34. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/packet.py +0 -0
  35. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/photonPoseEstimator.py +0 -0
  36. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/py.typed +0 -0
  37. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/simulation/simCameraProperties.py +0 -0
  38. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/simulation/videoSimUtil.py +0 -0
  39. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/simulation/visionSystemSim.py +0 -0
  40. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/simulation/visionTargetSim.py +0 -0
  41. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/targeting/TargetCorner.py +0 -0
  42. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/targeting/multiTargetPNPResult.py +0 -0
  43. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/targeting/photonPipelineResult.py +0 -0
  44. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy/targeting/photonTrackedTarget.py +0 -0
  45. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy.egg-info/dependency_links.txt +0 -0
  46. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/photonlibpy.egg-info/top_level.txt +0 -0
  47. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/pyproject.toml +0 -0
  48. {photonlibpy-2025.0.0b8 → photonlibpy-2025.1.1.post20}/setup.cfg +0 -0
@@ -1,9 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: photonlibpy
3
- Version: 2025.0.0b8
4
- Summary: Pure-python implementation of PhotonLib for interfacing with PhotonVision on coprocessors. Implemented with PhotonVision version v2025.0.0-beta-8 .
3
+ Version: 2025.1.1.post20
4
+ Summary: Pure-python implementation of PhotonLib for interfacing with PhotonVision on coprocessors. Implemented with PhotonVision version v2025.1.1-20-g533f8c97 .
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,36 @@
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
26
+ from .packet import Packet
27
+ from .photonCamera import PhotonCamera
28
+ from .photonPoseEstimator import PhotonPoseEstimator, PoseStrategy
29
+
30
+ __all__ = (
31
+ "EstimatedRobotPose",
32
+ "Packet",
33
+ "PhotonCamera",
34
+ "PhotonPoseEstimator",
35
+ "PoseStrategy",
36
+ )
@@ -1,19 +1,26 @@
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
- ###############################################################################
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
- ## 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
- ###############################################################################
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
- ## 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
- ###############################################################################
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
- ## 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
- ###############################################################################
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
- ## 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
- ###############################################################################
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
- ## 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
- ###############################################################################
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().
@@ -3,3 +3,11 @@ from .simCameraProperties import SimCameraProperties
3
3
  from .videoSimUtil import VideoSimUtil
4
4
  from .visionSystemSim import VisionSystemSim
5
5
  from .visionTargetSim import VisionTargetSim
6
+
7
+ __all__ = (
8
+ "PhotonCameraSim",
9
+ "SimCameraProperties",
10
+ "VideoSimUtil",
11
+ "VisionSystemSim",
12
+ "VisionTargetSim",
13
+ )
@@ -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 = AprilTagFieldLayout.loadField(AprilTagField.k2024Crescendo)
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,13 @@
1
+ from .multiTargetPNPResult import MultiTargetPNPResult, PnpResult
2
+ from .photonPipelineResult import PhotonPipelineMetadata, PhotonPipelineResult
3
+ from .photonTrackedTarget import PhotonTrackedTarget
4
+ from .TargetCorner import TargetCorner
5
+
6
+ __all__ = (
7
+ "MultiTargetPNPResult",
8
+ "PnpResult",
9
+ "PhotonPipelineMetadata",
10
+ "PhotonPipelineResult",
11
+ "PhotonTrackedTarget",
12
+ "TargetCorner",
13
+ )
@@ -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()
@@ -0,0 +1,2 @@
1
+ PHOTONLIB_VERSION="2025.1.1post20"
2
+ PHOTONVISION_VERSION="v2025.1.1-20-g533f8c97"
@@ -1,9 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: photonlibpy
3
- Version: 2025.0.0b8
4
- Summary: Pure-python implementation of PhotonLib for interfacing with PhotonVision on coprocessors. Implemented with PhotonVision version v2025.0.0-beta-8 .
3
+ Version: 2025.1.1.post20
4
+ Summary: Pure-python implementation of PhotonLib for interfacing with PhotonVision on coprocessors. Implemented with PhotonVision version v2025.1.1-20-g533f8c97 .
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
@@ -0,0 +1,9 @@
1
+ numpy~=2.1
2
+ wpilib<2026,>=2025.3.1
3
+ robotpy-wpimath<2026,>=2025.3.1
4
+ robotpy-apriltag<2026,>=2025.3.1
5
+ robotpy-cscore<2026,>=2025.3.1
6
+ pyntcore<2026,>=2025.3.1
7
+
8
+ [:platform_machine != "roborio"]
9
+ opencv-python
@@ -4,7 +4,9 @@ import subprocess
4
4
  from setuptools import find_packages, setup
5
5
 
6
6
  gitDescribeResult = (
7
- subprocess.check_output(["git", "describe", "--tags", "--match=v*", "--always"])
7
+ subprocess.check_output(
8
+ ["git", "describe", "--tags", "--match=v*", "--exclude=*rc*", "--always"]
9
+ )
8
10
  .decode("utf-8")
9
11
  .strip()
10
12
  )
@@ -18,7 +20,7 @@ m = re.search(
18
20
  # which should be PEP440 compliant
19
21
  if m:
20
22
  versionString = m.group(0)
21
- # Hack -- for strings like v2024.1.1, do NOT add matruity/suffix
23
+ # Hack -- for strings like v2024.1.1, do NOT add maturity/suffix
22
24
  if len(m.group(2)) > 0:
23
25
  print("using beta group matcher")
24
26
  prefix = m.group(1)
@@ -59,11 +61,11 @@ setup(
59
61
  version=versionString,
60
62
  install_requires=[
61
63
  "numpy~=2.1",
62
- "wpilib<2026,>=2025.0.0b1",
63
- "robotpy-wpimath<2026,>=2025.0.0b1",
64
- "robotpy-apriltag<2026,>=2025.0.0b1",
65
- "robotpy-cscore<2026,>=2025.0.0b1",
66
- "pyntcore<2026,>=2025.0.0b1",
64
+ "wpilib<2026,>=2025.3.1",
65
+ "robotpy-wpimath<2026,>=2025.3.1",
66
+ "robotpy-apriltag<2026,>=2025.3.1",
67
+ "robotpy-cscore<2026,>=2025.3.1",
68
+ "pyntcore<2026,>=2025.3.1",
67
69
  "opencv-python;platform_machine!='roborio'",
68
70
  ],
69
71
  description=descriptionStr,
@@ -71,4 +73,7 @@ setup(
71
73
  author="Photonvision Development Team",
72
74
  long_description="A Pure-python implementation of PhotonLib",
73
75
  long_description_content_type="text/markdown",
76
+ classifiers=[
77
+ "License :: OSI Approved :: MIT License",
78
+ ],
74
79
  )
@@ -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
@@ -1,6 +0,0 @@
1
- # no one but us chickens
2
-
3
- from .multiTargetPNPResult import MultiTargetPNPResult, PnpResult # noqa
4
- from .photonPipelineResult import PhotonPipelineMetadata, PhotonPipelineResult # noqa
5
- from .photonTrackedTarget import PhotonTrackedTarget # noqa
6
- from .TargetCorner import TargetCorner # noqa
@@ -1,2 +0,0 @@
1
- PHOTONLIB_VERSION="v2025.0.0.beta.8"
2
- PHOTONVISION_VERSION="v2025.0.0-beta-8"
@@ -1,9 +0,0 @@
1
- numpy~=2.1
2
- wpilib<2026,>=2025.0.0b1
3
- robotpy-wpimath<2026,>=2025.0.0b1
4
- robotpy-apriltag<2026,>=2025.0.0b1
5
- robotpy-cscore<2026,>=2025.0.0b1
6
- pyntcore<2026,>=2025.0.0b1
7
-
8
- [:platform_machine != "roborio"]
9
- opencv-python