SR Research Support Site
Macros
Eyelink 1000 Remote specific target status flags

Macros

#define HPOS_TOP_WARNING   0x0080
 
#define HPOS_BOT_WARNING   0x0040
 
#define HPOS_LEFT_WARNING   0x0020
 
#define HPOS_RIGHT_WARNING   0x0010
 
#define HPOS_WARNING   0x00F0
 
#define HPOS_ANGLE_WARNING   0x0008
 
#define HPOS_MISSING_WARNING   0x0004
 
#define HPOS_DISTANCE_WARNING   0x0001
 
#define TFLAG_MISSING   0x4000
 
#define TFLAG_ANGLE   0x2000
 
#define TFLAG_NEAREYE   0x1000
 
#define TFLAG_CLOSE   0x0800
 
#define TFLAG_FAR   0x0400
 
#define TFLAG_T_TSIDE   0x0080
 
#define TFLAG_T_BSIDE   0x0040
 
#define TFLAG_T_LSIDE   0x0020
 
#define TFLAG_T_RSIDE   0x0010
 
#define TFLAG_E_TSIDE   0x0008
 
#define TFLAG_E_BSIDE   0x0004
 
#define TFLAG_E_LSIDE   0x0002
 
#define TFLAG_E_RSIDE   0x0001
 

Detailed Description

These are available through the HTARGET data type ( htype==0xB4, hdata = tx, ty, distance, flags where tx, ty range from 0 to 10000 distance = 10*mm

Here is an example of getting target flags over the link.

Remarks
This example only applicable to EyeLink 1000 Remote
#include <stdio.h>
#include <core_expt.h>
void printHTarget(INT16 hdata[8])
{
INT16 v = hdata[3];
printf("\rTarget x=%d y=%d distance=%d flags=%x", hdata[0],hdata[1],hdata[2],hdata[3]);
if(v & TFLAG_MISSING) printf(" TFLAG_MISSING");
if(v & TFLAG_ANGLE) printf(" TFLAG_ANGLE");
if(v & TFLAG_NEAREYE) printf(" TFLAG_NEAREYE");
if(v & TFLAG_CLOSE) printf(" TFLAG_CLOSE");
if(v & TFLAG_FAR) printf(" TFLAG_FAR");
if(v & TFLAG_T_TSIDE) printf(" TFLAG_T_TSIDE");
if(v & TFLAG_T_BSIDE) printf(" TFLAG_T_BSIDE");
if(v & TFLAG_T_LSIDE) printf(" TFLAG_T_LSIDE");
if(v & TFLAG_T_RSIDE) printf(" TFLAG_T_RSIDE");
if(v & TFLAG_E_TSIDE) printf(" TFLAG_E_TSIDE");
if(v & TFLAG_E_BSIDE) printf(" TFLAG_E_BSIDE");
if(v & TFLAG_E_LSIDE) printf(" TFLAG_E_LSIDE");
if(v & TFLAG_E_RSIDE) printf(" TFLAG_E_RSIDE");
}
int main(int argc, char ** argv)
{
if(open_eyelink_connection(0) !=0) // connect to the tracker
return 0;
// tell tracker to send HTARGET data
eyecmd_printf("link_sample_data = LEFT,RIGHT,GAZE,HREF,HTARGET,GAZERES,AREA,PUPIL,STATUS");
// start recording
if(start_recording(0,0,1,1) != 0)
{
INT16 eye_used = eyelink_eye_available(); // find which eye is available
UINT32 st = current_time();
while(st+20000>current_time()) // record for 20 seconds
{
if(eyelink_newest_float_sample(&f1)>0) // get the newest float sample
{
printHTarget(f1.fs.hdata); // print the flags
}
}
stop_recording(); // stop recording
}
else
{
printf("failed to start recording \n");
}
close_eyelink_system(); // close the connection
return 1;
}

Example code to access sample status flags.

#include <stdio.h>
#include <core_expt.h>
void printStatus(UINT32 time,UINT16 v)
{
printf("Status :%d %x\t",time,v);
if(v & HPOS_TOP_WARNING) printf("HPOS_TOP_WARNING ");
if(v & HPOS_BOT_WARNING ) printf("HPOS_BOT_WARNING ");
if(v & HPOS_LEFT_WARNING) printf("HPOS_LEFT_WARNING ");
if(v & HPOS_RIGHT_WARNING) printf("HPOS_RIGHT_WARNING ");
if(v & HPOS_WARNING) printf("HPOS_WARNING ");
if(v & HPOS_ANGLE_WARNING ) printf("HPOS_ANGLE_WARNING ");
if(v & HPOS_MISSING_WARNING ) printf("HPOS_MISSING_WARNING ");
if(v & HPOS_DISTANCE_WARNING )printf("HPOS_DISTANCE_WARNING ");
printf("\n");
}
int main(int argc, char ** argv)
{
if(open_eyelink_connection(0) !=0) // connect to the tracker
return 0;
// tell tracker to send HTARGET data
eyecmd_printf("link_sample_data = LEFT,RIGHT,GAZE,HREF,HTARGET,GAZERES,AREA,PUPIL,STATUS");
// start recording
if(start_recording(0,0,1,1) != 0)
{
INT16 eye_used = eyelink_eye_available(); // find which eye is available
UINT32 st = current_time();
while(st+20000>current_time()) // record for 20 seconds
{
if(eyelink_newest_float_sample(&f1)>0) // get the newest float sample
{
printStatus(f1.fs.time,f1.fs.status); // print the flags
}
}
stop_recording(); // stop recording
}
else
{
printf("failed to start recording \n");
}
close_eyelink_system(); // close the connection
return 1;
}

Macro Definition Documentation

#define HPOS_ANGLE_WARNING   0x0008

Target at too great an angle for accuracy

#define HPOS_BOT_WARNING   0x0040

Marker is in bottom border of image

#define HPOS_DISTANCE_WARNING   0x0001

Target too close or too far

#define HPOS_LEFT_WARNING   0x0020

Marker is in left border of image

#define HPOS_MISSING_WARNING   0x0004

Target is missing

#define HPOS_RIGHT_WARNING   0x0010

Marker is in right border of image

#define HPOS_TOP_WARNING   0x0080

Marker is in top border of image

#define HPOS_WARNING   0x00F0

Head too far from calibration

#define TFLAG_ANGLE   0x2000

Extreme target angle

#define TFLAG_CLOSE   0x0800

distance vs. limits

#define TFLAG_E_BSIDE   0x0004

Eye near bottom edge of image

#define TFLAG_E_LSIDE   0x0002

Eye near left edge of image

#define TFLAG_E_RSIDE   0x0001

Eye near right edge of image

#define TFLAG_E_TSIDE   0x0008

Eye near top edge of image

#define TFLAG_MISSING   0x4000

Target missing

#define TFLAG_NEAREYE   0x1000

Target near eye so windows overlapping

#define TFLAG_T_BSIDE   0x0040

Target near bottom edge of image

#define TFLAG_T_LSIDE   0x0020

Target near left edge of image

#define TFLAG_T_RSIDE   0x0010

Target near right edge of image

#define TFLAG_T_TSIDE   0x0080

Target near top edge of image


Copyright ©2002-2024, SR Research Ltd.