Skip to content

Commit

Permalink
[python] Fix population of metadata (#1578)
Browse files Browse the repository at this point in the history
  • Loading branch information
james-ward authored Nov 17, 2024
1 parent 93242ed commit f107c94
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion photon-lib/py/photonlibpy/simulation/photonCameraSim.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,14 @@ def distance(target: VisionTargetSim):

# put this simulated data to NT
self.heartbeatCounter += 1
now_micros = wpilib.Timer.getFPGATimestamp() * 1e6
return PhotonPipelineResult(
metadata=PhotonPipelineMetadata(
self.heartbeatCounter, int(latency * 1e6), 1000000
self.heartbeatCounter,
int(now_micros - latency * 1e6),
int(now_micros),
# Pretend like we heard a pong recently
int(np.random.uniform(950, 1050)),
),
targets=detectableTgts,
multitagResult=multiTagResults,
Expand Down

0 comments on commit f107c94

Please sign in to comment.