Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,10 @@ public void calculateEpisode(String taskName, SCS2LogSessionWithVideo session, C
writeTaskJsonlLine(taskName);
}

String highLevelController = "root.main.DRCControllerThread." + "DRCMomentumBasedController.HumanoidHighLevelControllerManager.";
String wbcc = highLevelController + "HighLevelHumanoidControllerFactory.WholeBodyControllerCoreFactory.WholeBodyControllerCore.";
String feedbackController = wbcc + "WholeBodyFeedbackController.FeedbackControllerToolbox.";
String booleanVarName = String.format("%sPELVIS_LINKisPointFBControllerEnabled", feedbackController);
String timestampVarName = "root.LogDataReader.robotTime";

YoBoolean recordingFlag = (YoBoolean) session.getRootRegistry().findVariable(booleanVarName);
// Actual boolean that we want
// YoBoolean recordingFlag = (YoBoolean) session.getRootRegistry().findVariable(booleanVarName);
YoDouble timestamp = (YoDouble) session.getRootRegistry().findVariable(timestampVarName);

LogDataReader reader = session.getLogDataReader();
Expand All @@ -156,7 +153,7 @@ public void calculateEpisode(String taskName, SCS2LogSessionWithVideo session, C
{
session.runTick();

boolean flagValue = (int) timestamp.getValue()%1000 == 0;
boolean flagValue = (int) timestamp.getValue()%1000 <= 300;

if (flagValue && !currentlyRecording)
{
Expand All @@ -166,8 +163,9 @@ public void calculateEpisode(String taskName, SCS2LogSessionWithVideo session, C
else if (!flagValue && currentlyRecording)
{
int episodeEnd = (int) frame;
int episodeLength = episodeEnd - episodeStart;
System.out.println(episodeLength);
session.submitBufferInPointIndexRequestAndWait(episodeStart);
session.submitBufferOutPointIndexRequestAndWait(episodeEnd);
addEpisode(taskName, session, frameProcessingQueue);
currentlyRecording = false;
episodeStart = -1;
}
Expand All @@ -176,8 +174,9 @@ else if (!flagValue && currentlyRecording)
if (currentlyRecording)
{
int episodeEnd = (int) totalFrames;
int episodeLength = episodeEnd - episodeStart;
System.out.println(episodeLength);
session.submitBufferInPointIndexRequestAndWait(episodeStart);
session.submitBufferOutPointIndexRequestAndWait(episodeEnd);
addEpisode(taskName, session, frameProcessingQueue);
}
}

Expand Down
Loading