Jump to content
 
nbhatia

Register Eye Data Callback

Recommended Posts

Hi,

I am using SRAnipal SDK in C. In SRAnipal_Eye.h, I see that some APIs (pasted below) are declared to register callbacks. Can anyone help me by providing an example of using this callback? 

/* Register a callback function to receive eye camera related data when the module has new outputs.
                [in] function pointer of callback
                [out] error code. please refer Error in ViveSR_Enums.h
                */
                SR_ANIPAL int RegisterEyeDataCallback(VivesrEyeDataCallback callback);

                /* Unegister a callback function to stop receiving eye camera related data.
                [in] function pointer of callback
                [out] error code. please refer Error in ViveSR_Enums.h
                */
                SR_ANIPAL int UnregisterEyeDataCallback(VivesrEyeDataCallback callback);


Many Thanks,
Nitesh

@Corvus @Daniel_Y

Share this post


Link to post
Share on other sites

It may look looks like code snippet below.

 

void callback(ViveSR::anipal::Eye::EyeData const &eye_data)
{
    float const *gaze = eye_data.verbose_data.left.gaze_direction_normalized.elem_;
    printf("[Eye] Gaze: %.2f %.2f %.2f\n", gaze[0], gaze[1], gaze[2]);
}

int main() {

.......

                int ret = RegisterEyeDataCallback( callback);

                while (looping)
                    dosomething();

.......

}

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks a lot @Daniel_Y🙂

In the Vive Pro Eye tech specs it is stated that the eye-tracker supports 120Hz sampling frequency. Is it steady or variable? I am hoping that the callback should be working at similar sampling rate. 

Share this post


Link to post
Share on other sites

I am also interested in the callback sampling rate.

In my testing it was very inconsistent: I am not sure if it was context switching overhead, or the callback itself.

Share this post


Link to post
Share on other sites

I need to record  60 FPS or 120 FPS eye tracking data,  How can I get it using vive pro sdk api? Any suggestions?

Share this post


Link to post
Share on other sites

Please sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...