Skip to content

Commit

Permalink
Update RoboTutor.java
Browse files Browse the repository at this point in the history
Finish MAB
  • Loading branch information
j50ju authored Oct 21, 2024
1 parent 9e2a5d3 commit 4da1f00
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion app/src/main/java/cmu/xprize/robotutor/RoboTutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
import cmu.xprize.robotutor.tutorengine.util.CAssetObject;
import cmu.xprize.robotutor.tutorengine.util.CrashHandler;
import cmu.xprize.robotutor.tutorengine.widgets.core.IGuidView;
import cmu.xprize.robotutor.tutorengine.util.MABHandler;
import cmu.xprize.util.CDisplayMetrics;
import cmu.xprize.util.CLoaderView;
import cmu.xprize.util.IReadyListener;
Expand Down Expand Up @@ -207,6 +208,10 @@ public class RoboTutor extends Activity implements IReadyListener, IRoboTutor, H
ScreenRecordHelper screenRecordHelper;
private ScreenRecorder screenRecorder = null;


//Declare armName
private String armName = "default_arm";

@Override
protected void onCreate(Bundle savedInstanceState) {

Expand Down Expand Up @@ -351,7 +356,7 @@ private void initializeAndStartLogs() {
String initTime = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss", Locale.US).format(calendar.getTime());
SEQUENCE_ID_STRING = String.format(Locale.US, "%06d", getNextLogSequenceId());
// NOTE: Need to include the configuration name when that is fully merged
String logFilename = "RoboTutor_" + // TODO TODO TODO there should be a version name in here!!!
String logFilename = "RoboTutor_" + armName +
Configuration.configVersion(this) + "_" + BuildConfig.VERSION_NAME + "_" + SEQUENCE_ID_STRING +
"_" + initTime + "_" + Build.SERIAL;

Expand All @@ -373,6 +378,13 @@ private void initializeAndStartLogs() {
// TODO : implement time stamps
logManager.postDateTimeStamp(GRAPH_MSG, "RoboTutor:SessionStart");
logManager.postEvent_I(GRAPH_MSG, "EngineVersion:" + VERSION_RT);

// After starting logging, select the arm name using MABHandler
armName = MABHandler.getArm(ARM_WEIGHTS_FILE, null);

// Update the log filename with the selected arm name
logFilename = logFilename.replace("default_arm", armName);
Log.w(TAG, "Log filename updated: " + logFilename);
}

/**
Expand Down

0 comments on commit 4da1f00

Please sign in to comment.