#1
|
|||
|
|||
question regarding viz.getpostion written into text file
Hey all,
I'm using vizard 5.3 for navigation test using Oculus rift Dk2(runtime 0.8) and xbox one controller. In order to calculate some measurements from the experiment we write every 100ms: # Get the tracking data. def getData(tracking_data, startTime): orientation = viz.MainView.getEuler() position = viz.MainView.getPosition() timeStamp = viz.tick() # Make a string out of the data. data = 'orientation: ' + str(orientation) + '\t' + 'position: ' + str(position) + '\t' 'time: ' + str(timeStamp - startTime) + '\n' # Write it to the tracking file. tracking_data.write(data) The loop runs 3 times(3 tries per day for this test), each time is a different trial(try) and it uses the getData function to write to text file(different text file for each trial). trials = range(1, 4) for i in trials: # enable movement walking_transport.setEnabled(viz.ON) # disable orientation ori_transport.setEnabled(viz.OFF) # store the time at which this trial started startTime = viz.tick() tracking_data = open(participant_code + '_hidden_12X12 trackingDataTrial' + str(i) + '.txt', 'a') expTimer = vizact.ontimer(0.1, getData, tracking_data, startTime) Sometimes it writes more data to text files than should be. It seems like the time start from the begining over and over and the last time it start, that is the correct data (i have another text file that the time of each trial is written in it, that is why i know the last data is the correct one). Does anyone can tell me way is it happening? Thanks in advence. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
input from a text file | dig | Vizard | 5 | 10-20-2013 01:20 AM |
Use saved text file data as replay sources problem | mizutani_jun | Vizard | 4 | 10-14-2010 04:49 PM |
problems with output to a text file within executable | Saz | Vizard | 1 | 07-01-2009 11:01 AM |
Read file....many issues | Uttama_vizard | Vizard | 9 | 07-08-2008 02:16 PM |
I cannot show wrl file with text node | sled | Vizard | 3 | 06-25-2003 07:52 AM |