mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-28 02:11:40 +00:00
Upgrade to wpilib alpha-6 (#2434)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ryanforce08 <rradtke1208@gmail.com> Co-authored-by: PJ Reiniger <pj.reiniger@gmail.com> Co-authored-by: Jade Turner <spacey-sooty@proton.me> Co-authored-by: Matt Morley <matthew.morley.ca@gmail.com>
This commit is contained in:
@@ -118,13 +118,16 @@ class PhotonCamera:
|
||||
)
|
||||
|
||||
self._prevHeartbeat = 0
|
||||
self._prevHeartbeatChangeTime = Timer.getFPGATimestamp()
|
||||
self._prevHeartbeatChangeTime = Timer.getMonotonicTimestamp()
|
||||
|
||||
# Start the time sync server
|
||||
inst.start()
|
||||
|
||||
# Usage reporting
|
||||
hal.reportUsage("PhotonVision/PhotonCamera", PhotonCamera.instance_count, "")
|
||||
hal.reportUsage(
|
||||
"PhotonVision/PhotonCamera", # Not 100% sure if this is correct
|
||||
str(PhotonCamera.instance_count),
|
||||
)
|
||||
PhotonCamera.instance_count += 1
|
||||
|
||||
def getAllUnreadResults(self) -> List[PhotonPipelineResult]:
|
||||
@@ -169,7 +172,7 @@ class PhotonCamera:
|
||||
|
||||
self._versionCheck()
|
||||
|
||||
now = RobotController.getFPGATime()
|
||||
now = RobotController.getMonotonicTime()
|
||||
packetWithTimestamp = self._rawBytesEntry.getAtomic()
|
||||
byteList = packetWithTimestamp.value
|
||||
packetWithTimestamp.time
|
||||
@@ -297,7 +300,7 @@ class PhotonCamera:
|
||||
"""
|
||||
|
||||
curHeartbeat = self._heartbeatEntry.get()
|
||||
now = Timer.getFPGATimestamp()
|
||||
now = Timer.getMonotonicTimestamp()
|
||||
|
||||
if curHeartbeat != self._prevHeartbeat:
|
||||
self._prevHeartbeat = curHeartbeat
|
||||
@@ -311,10 +314,10 @@ class PhotonCamera:
|
||||
if not _VERSION_CHECK_ENABLED:
|
||||
return
|
||||
|
||||
if (Timer.getFPGATimestamp() - _lastVersionTimeCheck) < 5.0:
|
||||
if (Timer.getMonotonicTimestamp() - _lastVersionTimeCheck) < 5.0:
|
||||
return
|
||||
|
||||
_lastVersionTimeCheck = Timer.getFPGATimestamp()
|
||||
_lastVersionTimeCheck = Timer.getMonotonicTimestamp()
|
||||
|
||||
# Heartbeat entry is assumed to always be present. If it's not present, we
|
||||
# assume that a camera with that name was never connected in the first place.
|
||||
|
||||
Reference in New Issue
Block a user