Class TimeSyncClient

java.lang.Object
org.photonvision.jni.TimeSyncClient

public class TimeSyncClient extends Object
Send ping-pongs to estimate server time, relative to nt::Now. The underlying implementation does technically allow us to provide a different source, but all photon code assumes nt::Now is used
  • Constructor Details

    • TimeSyncClient

      public TimeSyncClient(String server, int port, double interval)
  • Method Details

    • setServer

      public void setServer(String newServer)
    • stop

      public void stop()
    • getOffset

      public long getOffset()
      This offset, when added to the current value of nt::now(), yields the timestamp in the timebase of the TSP Server
      Returns:
    • currentServerTimestamp

      public long currentServerTimestamp()
      Best estimate of the current timestamp at the TSP server
      Returns:
      The current time estimate, in microseconds, at the TSP server
    • getPingMetadata

      public TimeSyncClient.PingMetadata getPingMetadata()
    • getServer

      public String getServer()