The session logs contains data describing setup of the session and the location of the robot in VirtualMaze.
The data in the file is formatted as follows:
<Session Information>
<flag> <timeElapsed(ms)> <position-x> <position-z> <rotation-y>
<flag> <timeElapsed(ms)> <position-x> <position-z> <rotation-y>
As of version 4.1, the data in the JsonObject contains:
// Raw JSON in logs (should exist as a single line)
{"version":"20171221 Taxi Continuous v4","triggerVersion":"v4","taskType":"Continuous","posterLocations":[{"name":"CatPoster","position":{"x":-5.0,"y":1.850000023841858,"z":-7.546999931335449}}],"trialName":"Double Tee","rewardsNumber":5,"completionWindow":10000,"timeoutDuration":3000,"intersessionInterval":1000,"rewardTime":1000,"rewardDistance":0,"rewardViewCriteria":100.0,"rotationSpeed":200.0,"movementSpeed":10.0,"joystickDeadzone":0.0}
//Pretty printed version (does not exists in logs)
{
"version": "20171221 Taxi Continuous v4",
"triggerVersion": "v4",
"taskType": "Continuous",
"posterLocations": [
{
"name": "CatPoster",
"position": {
"x": -5,
"y": 1.8500000238419,
"z": -7.5469999313354
}
}
],
"trialName": "Double Tee",
"rewardsNumber": 5,
"completionWindow": 10000,
"timeoutDuration": 3000,
"intersessionInterval": 1000,
"rewardTime": 1000,
"rewardDistance": 0,
"rewardViewCriteria": 100,
"rotationSpeed": 200,
"movementSpeed": 10,
"joystickDeadzone": 0
}
Due to the format of the data, the first line of the session log can be read and parsed as a JsonObject, therefore allowing fast access to the session details without the need to manually parse the values line by line.
logs = fopen(*path to file here*);
nextline = fgetl(logs);
sessionSettings = jsondecode(nextline);
*read next lines and process data*
In version 4, the details of the experiment is stored in plain text and should be parsed line by line. This serves as documentation for experiment data that is generated by VirtualMaze V4. The data is structured as follows.
Version: 20171221 Taxi Continuous v4
Trigger: v4
TaskType: Continuous
PosterLocations: P1(-5,1.5,-7.55) P2(-7.55,1.5,5) P3(7.55,1.5,-5) P4(5,1.5,7.55) P5(5,1.5,2.45) P6(-5,1.5,-2.45)
TrialType: Double Tee
SpecifiedRewardNo: 400
CompletionWindow: 25000
TimeoutDuration: 4000
IntersessionInterval: 500
RewardTime: 1000
RotationSpeed: 60.4234
TranslationSpeed: 5.218029
JoystickDeadzone: 0.3033634
RewardViewCriteria: 1
- Create new maze scene
- Create new asset file for that maze in ScriptableObjects
- In ScriptableObjects > Masterlist, increase the size and assign the new maze to the latest element
- In File > Build Settings > Scenes in Build, ensure that the new maze is selected and click 'Add Open Scenes'
- In Start Scene > Persist > ExperimentControlCanvas, open the prefab menu, and add/edit/remove GUI elements
- Exit the prefab menu, and set the size, position, and text of the GUI element (left, right, Pos Y, Height)
- In the respective GUI Controller script, add the new GUI element in all the necessary places (Tip: copy-paste the existing GUI elements and change the variable/function names according)
- In the respective Controller script, add the new variable in the Settings class
- From the respective Controller script, the equivalent variable used in another script can be linked to the variable in this script (for convenience, link the variables in private void PrepareLevelController() function as it is called only once at the start of each session)
- Add new poster images to Assets > Sprites
- In Assets > Sprites > Materials, create/duplicate a material object and set the albedo in Inspector to the correct sprite
- In Hierarchy of maze scene, add/move/remove CeilingLamps, CeilingLampBuffer, and Light Probe Group
- In Window > Rendering > Lighting Settings, modify the settings (if necessary) and click Generate Lighting (note: VirtualMaze uses Baked Lightmaps instead of Realtime Lightmaps)