Hi,
Sorry for the lack of information. I’m new to this type of forum.
To build on from my prior post the code for the eye-tracking is done in code snippets in individual routines throughout the experiment when eye-tracking is necessary as it is not needed on all of the trials / routines.
The initial code at the beginning of the experiment is a code snippet to check and make sure there is an eye-tracker and if so to start the calibration procedure is as follows:
eyetracker =False #will change if we get one!
if expInfo[‘Eye Tracker’]:
try:
from psychopy.iohub import EventConstants,ioHubConnection,load,Loader
from psychopy.iohub.util import NumPyRingBuffer
from psychopy.data import getDateStr
# Load the specified iohub configuration file converting it to a python dict.
io_config=load(file(expInfo[‘Eye Tracker’],‘r’), Loader=Loader)
# Add / Update the session code to be unique. Here we use the psychopy getDateStr() function for session code generation
session_info=io_config.get('data_store').get('session_info')
session_info.update(code="S_%s"%(getDateStr()))
# Create an ioHubConnection instance, which starts the ioHubProcess, and informs it of the requested devices and their configurations.
io=ioHubConnection(io_config)
iokeyboard=io.devices.keyboard
mouse=io.devices.mouse
if io.getDevice('tracker'):
eyetracker=io.getDevice('tracker')
win.winHandle.minimize()
eyetracker.runSetupProcedure()
win.winHandle.activate()
win.winHandle.maximize()
except Exception, e:
import sys
print "!! Error starting ioHub: ",e," Exiting..."
sys.exit(1)
display_gaze=False
x,y=0,0
Then on individual trials and/or routines when eye tracking is necessary in a code snippet I placed this under the Begin Experiment tab:
if eyetracker:
io.clearEvents(‘all’)
eyetracker.setRecordingState(True)
And under the End Routine of the same snippet:
if eyetracker:
eyetracker.setRecordingState(False)
Just to reiterate the calibration procedure runs fine and it isn’t until I try to go back into the main experiment that I get the “python.exe has stopped working” message before I even get to the first screen of the experiment. Also, after some more testing it did work once though I haven’t changed anything since then (i.e. the code from above) and I’m getting the same “python.exe has stopped working” message.
Also it is worth mentioning that I took this code from the eye-tracking stroop demo that comes with psychopy, since it seemed to work fine and I figured it would be simple to build up from there. Just to note I am using the latest version of psychopy and am running this on a Windows computer.