mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Create timesync JNI for testing client (#1433)
This commit is contained in:
@@ -69,7 +69,7 @@ public class PhotonCameraSim implements AutoCloseable {
|
||||
private final PhotonCamera cam;
|
||||
|
||||
NTTopicSet ts = new NTTopicSet();
|
||||
private long heartbeatCounter = 0;
|
||||
private long heartbeatCounter = 1;
|
||||
|
||||
/** This simulated camera's {@link SimCameraProperties} */
|
||||
public final SimCameraProperties prop;
|
||||
@@ -553,9 +553,10 @@ public class PhotonCameraSim implements AutoCloseable {
|
||||
heartbeatCounter,
|
||||
now - (long) (latencyMillis * 1000),
|
||||
now,
|
||||
// Pretend like we heard a pong recently
|
||||
1000L + (long) ((Math.random() - 0.5) * 50),
|
||||
detectableTgts,
|
||||
multitagResult);
|
||||
ret.setReceiveTimestampMicros(now);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -605,6 +606,8 @@ public class PhotonCameraSim implements AutoCloseable {
|
||||
|
||||
ts.cameraIntrinsicsPublisher.set(prop.getIntrinsics().getData(), receiveTimestamp);
|
||||
ts.cameraDistortionPublisher.set(prop.getDistCoeffs().getData(), receiveTimestamp);
|
||||
ts.heartbeatPublisher.set(heartbeatCounter++, receiveTimestamp);
|
||||
|
||||
ts.heartbeatPublisher.set(heartbeatCounter, receiveTimestamp);
|
||||
heartbeatCounter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user