Skip to content

Commit 1daf42e

Browse files
ihmc-rosiecalvertdw
authored andcommitted
Fix dat file path errors. -Duncan
1 parent 92ad541 commit 1daf42e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/main/java/us/ihmc/robotDataLogger/logger/ZEDSVOLogger.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ public void start(String svoFile, String datFile, LongSupplier timestampSupplier
5454
if (stopRequested)
5555
throw new IllegalStateException("Cannot restart ZEDSVOLogger once stopped");
5656

57-
svoPrefix = svoFile.substring(0, "yyyyMMdd_HHmmss".length());
57+
String[] parts = svoFile.split("[/\\\\]");
58+
svoPrefix = parts[parts.length - 1].substring(0, "yyyyMMdd_HHmmss".length());
5859
timestampWriter = ExceptionTools.handle(() -> new FileWriter(datFile, true), DefaultExceptionHandler.RUNTIME_EXCEPTION);
5960

6061
initParameters = new SL_InitParameters();

src/main/java/us/ihmc/robotDataLogger/logger/ZEDSVOLoggerManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ private void onZEDSDKAnnounceMessage(ZEDSDKAnnounce message)
6767
File perceptionDir = new File(tempDirectory, "perception");
6868
perceptionDir.mkdirs();
6969
String svoFile = perceptionDir.getAbsolutePath() + File.separator + generateSVOFileName(message);
70-
String datFile = "%s%s".formatted(message.getSensorNameAsString(), VideoDataLoggerInterface.timestampDataPostfix);
70+
String datFile = perceptionDir.getAbsolutePath() + File.separator +
71+
"%s%s".formatted(message.getSensorNameAsString(), VideoDataLoggerInterface.timestampDataPostfix);
7172

7273
ZEDSVOLogger zedSVOLogger = new ZEDSVOLogger();
7374

0 commit comments

Comments
 (0)