View Single Post
  #2  
Old 01-29-2010, 06:18 AM
GiudiceLab GiudiceLab is offline
Member
 
Join Date: May 2009
Location: Orono, ME
Posts: 49
We monitor our participant's orientation with an Intersense cube, and record orientation periodically to a datafile. Our code looks something like this:
Code:
response_orientation = marker.getEuler()
response_yaw = response_orientation[0]
datafile.write(str(response_yaw))
datafile.flush()
where 'marker' is the reference for the head marker (we combine PPT and Intersense data) and 'datafile' is the handle for the datafile. We have also used viz.MainView instead of 'marker' when the viewpoint is linked to the head orientation and referencing the marker would be difficult. Also, it may be apparent, but we are only interested in yaw. You could easily capture pitch and roll, though.

As for updating the filename, we prompt at the beginning of the script for a participant number, and use that to create the filename, like this:
Code:
# open a datafile for recording
subject = viz.input('Subject number:')
filename = 'datafiles/subject' + str(subject) + '.txt'
datafile = open(filename,'a')
I'm sure you could find a way to have the subject number auto-increment, but I think it would probably take more code that you really want.

Hope that is helpful!
__________________
Virtual Environments and Multimodal Interaction (VEMI) Lab

This time, it should work...
Reply With Quote