Adding timeSyncServer for Python (#1675)

This commit is contained in:
Chris Gerth
2025-01-03 12:23:27 -06:00
committed by GitHub
parent 474e4f07f8
commit 6c7a174424
3 changed files with 99 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ from wpilib import RobotController, Timer
from .packet import Packet
from .targeting.photonPipelineResult import PhotonPipelineResult
from .timesync.timeSyncServer import inst
from .version import PHOTONLIB_VERSION # type: ignore[import-untyped]
@@ -104,6 +105,9 @@ class PhotonCamera:
self._prevHeartbeat = 0
self._prevHeartbeatChangeTime = Timer.getFPGATimestamp()
# Start the time sync server
inst.start()
def getAllUnreadResults(self) -> List[PhotonPipelineResult]:
"""
The list of pipeline results sent by PhotonVision since the last call to getAllUnreadResults().