1212
1313import java .io .FileWriter ;
1414import java .io .IOException ;
15- import java .time .Duration ;
16- import java .time .Instant ;
1715import java .util .function .LongSupplier ;
1816
1917import static us .ihmc .zed .global .zed .*;
@@ -40,7 +38,6 @@ public class ZEDSVOLogger
4038 private String svoPrefix ;
4139 private LongSupplier timestampSupplier ;
4240 private FileWriter timestampWriter ;
43- private Instant startTime ;
4441
4542 private volatile double lastGrabTime ;
4643 private volatile boolean stopRequested ;
@@ -83,8 +80,6 @@ public void start(String svoFile, String datFile, LongSupplier timestampSupplier
8380 {
8481 LogTools .info ("Connected to ZED SDK stream on: " + address + ":" + port );
8582
86- startTime = Instant .now ();
87-
8883 grabThread .setFrequencyLimit (RepeatingTaskThread .UNLIMITED_FREQUENCY );
8984 grabThread .startRepeating ();
9085 }
@@ -129,11 +124,10 @@ public void grab()
129124 int returnCode = sl_grab (cameraID , runtimeParameters );
130125
131126 lastGrabTime = System .currentTimeMillis () / 1000D ;
132- long frameTimeNanos = Duration .between (startTime , Instant .now ()).toNanos ();
133127
134128 try
135129 {
136- timestampWriter .write ("%d %d %s%n" .formatted (timestampSupplier .getAsLong (), frameTimeNanos , svoPrefix ));
130+ timestampWriter .write ("%d %d %s%n" .formatted (timestampSupplier .getAsLong (), sl_get_current_timestamp ( cameraID ) , svoPrefix ));
137131 }
138132 catch (IOException e )
139133 {
0 commit comments