BioMotionLab / TUX

A framework for experiments in Unity and VR
https://biomotionlab.github.io/TUX/
Other
29 stars 4 forks source link

Continuous Data Logging Issues #63

Closed A-Ivan closed 1 year ago

A-Ivan commented 2 years ago

I was looking at the documentation on logging continuous data and I have some questions about the Recorder Example Scene provided:

  1. Is there a way to only set the output folder but not the playback one if I only want to log data? If I only want to log continuous data but not play it back (removing or disabling the Playback Manager script), the following error appears:

" No directory
UnityEngine.Debug:LogError (object,UnityEngine.Object) bmlTUX.Recorder.RecordableComponent1<bmlTUX.Recorder.TransformSnapshotBase>:InitializeFile () (at Library/PackageCache/com.biomotionlab.tux@3.0.0/Extras/Recorder/Scripts/RecordableComponent.cs:40) bmlTUX.Recorder.RecordableComponent1:SaveSnapshotToCsv (single,int) (at Library/PackageCache/com.biomotionlab.tux@3.0.0/Extras/Recorder/Scripts/RecordableComponent.cs:53) bmlTUX.Recorder.RecordableComponent`1:CreateSnapShot (single,int) (at Library/PackageCache/com.biomotionlab.tux@3.0.0/Extras/Recorder/Scripts/RecordableComponent.cs:32) bmlTUX.Recorder.Recorder:UpdateRecording (single,int) (at Library/PackageCache/com.biomotionlab.tux@3.0.0/Extras/Recorder/Scripts/Recorder.cs:82) bmlTUX.Recorder.RecordingManager:FixedUpdate () (at Library/PackageCache/com.biomotionlab.tux@3.0.0/Extras/Recorder/Scripts/RecordingManager.cs:130) "

" ArgumentNullException: Value cannot be null. Parameter name: path System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.IO.StreamWriter..ctor (System.String path, System.Boolean append) (at <695d1cc93cca45069c528c15c9fdd749>:0) (wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string,bool) System.IO.File.AppendAllText (System.String path, System.String contents) (at <695d1cc93cca45069c528c15c9fdd749>:0) bmlTUX.Recorder.RecordableComponent1[T].SaveSnapshotToCsv (System.Single time, System.Int32 frame) (at Library/PackageCache/com.biomotionlab.tux@3.0.0/Extras/Recorder/Scripts/RecordableComponent.cs:56) bmlTUX.Recorder.RecordableComponent1[T].CreateSnapShot (System.Single time, System.Int32 frame) (at Library/PackageCache/com.biomotionlab.tux@3.0.0/Extras/Recorder/Scripts/RecordableComponent.cs:32) bmlTUX.Recorder.Recorder.UpdateRecording (System.Single time, System.Int32 frame) (at Library/PackageCache/com.biomotionlab.tux@3.0.0/Extras/Recorder/Scripts/Recorder.cs:82) bmlTUX.Recorder.RecordingManager.FixedUpdate () (at Library/PackageCache/com.biomotionlab.tux@3.0.0/Extras/Recorder/Scripts/RecordingManager.cs:130) "

  1. In the Recording Manager script, if I set the Output Folder via the editor before I play the scene, when I enter play mode the Output folder I had set becomes empty, giving errors which require me to set the folder again. It would be great if the folder set via the Unity editor were to maintained during play mode. Not sure if this occurs because the ReocrderManager prefab and the Recording Manager script are in the package folder (read-only), but this shouldn't be the issue.

  2. Is there a way to automatically set the output folder of the continuous data to be the same folder as the output data files from the experiment (participant trial/block output)?

  3. Does the continuous data recording work also when the project is built to an executable? Since the output folder seems to be cleared when executed I imagine there might be a problem there as well.

Thank you.

AdamBebko commented 2 years ago

I think you can solve this if you just copy and paste the same path into the playback path. This is probably a bug though I will look into this.

Dr. Adam O. Bebko, Ph.D. @.*** adambebko.com

On Mar 18, 2022, at 3:26 PM, Ivan Aguilar @.***> wrote:

I was looking at the documentation https://biomotionlab.github.io/TUX/docs/ContinuousData on logging continuous data and I have some questions about the Recorder Example Scene provided:

Is there a way to only set the output folder but not the playback one if I only want to log data? If I only want to log continuous data but not play it back (removing or disabling the Playback Manager script), the following error appears: " No directory UnityEngine.Debug:LogError (object,UnityEngine.Object) bmlTUX.Recorder.RecordableComponent1:InitializeFile () (at @./Extras/Recorder/Scripts/RecordableComponent.cs:40) bmlTUX.Recorder.RecordableComponent1:SaveSnapshotToCsv (single,int) (at @./Extras/Recorder/Scripts/RecordableComponent.cs:53) bmlTUX.Recorder.RecordableComponent`1:CreateSnapShot (single,int) (at @./Extras/Recorder/Scripts/RecordableComponent.cs:32) bmlTUX.Recorder.Recorder:UpdateRecording (single,int) (at @./Extras/Recorder/Scripts/Recorder.cs:82) bmlTUX.Recorder.RecordingManager:FixedUpdate () (at @.***/Extras/Recorder/Scripts/RecordingManager.cs:130) "

" ArgumentNullException: Value cannot be null. Parameter name: path System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize, System.Boolean checkHost) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.IO.StreamWriter..ctor (System.String path, System.Boolean append) (at <695d1cc93cca45069c528c15c9fdd749>:0) (wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string,bool) System.IO.File.AppendAllText (System.String path, System.String contents) (at <695d1cc93cca45069c528c15c9fdd749>:0) bmlTUX.Recorder.RecordableComponent1[T].SaveSnapshotToCsv (System.Single time, System.Int32 frame) (at @./Extras/Recorder/Scripts/RecordableComponent.cs:56) bmlTUX.Recorder.RecordableComponent1[T].CreateSnapShot (System.Single time, System.Int32 frame) (at @./Extras/Recorder/Scripts/RecordableComponent.cs:32) bmlTUX.Recorder.Recorder.UpdateRecording (System.Single time, System.Int32 frame) (at @./Extras/Recorder/Scripts/Recorder.cs:82) bmlTUX.Recorder.RecordingManager.FixedUpdate () (at @./Extras/Recorder/Scripts/RecordingManager.cs:130) "

In the Recording Manager script, if I set the Output Folder via the editor before I play the scene, when I enter play mode the Output folder I had set becomes empty, giving errors which require me to set the folder again. It would be great if the folder set via the Unity editor were to maintained during play mode. Not sure if this occurs because the ReocrderManager prefab and the Recording Manager script are in the package folder (read-only), but this shouldn't be the issue.

Is there a way to automatically set the output folder of the continuous data to be the same folder as the output data files from the experiment (participant trial/block output)?

Does the continuous data recording work also when the project is built to an executable? Since the output folder seems to be cleared when executed I imagine there might be a problem there as well.

— Reply to this email directly, view it on GitHub https://github.com/BioMotionLab/TUX/issues/63, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKKFU4ZJY5JCHDGF3WMEQJTVATKFBANCNFSM5RCWZILA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.