nbhatia Posted June 4, 2020 Share Posted June 4, 2020 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 Link to comment Share on other sites More sharing options...
Daniel_Y Posted June 4, 2020 Share Posted June 4, 2020 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(); ....... } 1 Link to comment Share on other sites More sharing options...
nbhatia Posted June 4, 2020 Author Share Posted June 4, 2020 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. Link to comment Share on other sites More sharing options...
banila2 Posted June 10, 2020 Share Posted June 10, 2020 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. Link to comment Share on other sites More sharing options...
nbhatia Posted June 11, 2020 Author Share Posted June 11, 2020 Just an update, using callback in C++, I am getting a stable 120Hz sampling. @Daniel_Y @Corvus @Jad 2 Link to comment Share on other sites More sharing options...
Asish Posted June 28, 2020 Share Posted June 28, 2020 I need to record 60 FPS or 120 FPS eye tracking data, How can I get it using vive pro sdk api? Any suggestions? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now