Vizard 8 » Reference » Input Devices » Other devices » SMI iViewX
8.1

SMI Eye Tracker

This plug-in provides support for the iView X™ systems by SensoMotoric Instruments (SMI).

Initialization

The SMI plug-in is implemented as a Vizard extension. In order to use the plug-in you must first configure your iView X™ software to accept remote commands through an Ethernet interface. The configuration dialog allows you to specify the address to stream the data to, which should be set to the IP address of the Vizard computer. You also need to set the incoming and outgoing ports to the same value. You will need to specify this port value when connecting to the tracker in your Vizard script using the commands below.

 

The SMI extension object has the following methods/constants:

Method

Description

<smi>.addEyeTracker(address,port)

Connect to the eye tracker at the specified ethernet address and port. Returns an iView sensor object.

<smi>.PIXELS

<smi>.NORMALIZED

Flags that can be passed to the <iview>.getPosition() command. PIXELS will return the gaze position in absolute pixel coordinates relative to the lower left corner of the calibration area. NORMALIZED will return the gaze position in normalized 0-1 coordinates. The default mode is to return the position in PIXELS.

<smi>.IVIEW_MESSAGE_EVENT

Event ID triggered when a message is received from the iView X™ system. The event passes a single event structure e with the following attributes:

 

e.object

The iView sensor object that received the message.

 

e.message

The string message received by the sensor.

The SMI iView sensor objects have the following methods in addition to the standard extension sensor methods:

Method

Description

<iview>.getCalibrationSize()

Returns the (width,height) of the calibration area of the eye tracker, in pixels. The position returned by the sensor is relative to the lower left corner of the calibration area.

<iview>.sendMessage(message)

Send a message to the iView X™ system. All available remote command messages are listed in your iView X™ manual. Some messages will trigger a response from the iView X™ system. You can receive these responses by handling the IVIEW_MESSAGE_EVENT.

Example

The following example shows how to connect to a SMI iView X™ tracker running on a computer with an IP address of 192.168.0.126 and port 4444:

#Create SMI extension
smi = viz.add('smi.dle')

#Connect to iView tracker
tracker = smi.addEyeTracker(address='192.168.0.126',port=4444)

#Print size of calibration area
print('Calibration size:',tracker.getCalibrationSize())

The next example shows how to print out the pixel and normalized coordinates of the gaze position:

#Print pixel position
print(tracker.getPosition())

#Print normalized position
print(tracker.getPosition(smi.NORMALIZED))

The following code shows how to send a command to the iView X™ tracker and print out the response messages:

#Send a message to iView tracker
tracker.sendMessage('ET_CFG')

def onIViewMessage(e):
    """Print out responses from the tracker"""
    if e.object is tracker:
        print(e.message)
viz.callback(smi.IVIEW_MESSAGE_EVENT,onIViewMessage)