nbhatia Posted June 24, 2020 Share Posted June 24, 2020 Hi, I was looking into timestamps generated by SRAnipal as well as Tobii SDK. In case of SRANipal, the timestamps correspond to local time stamp of eye tracker. In case of Tobii, the sdk provides two time stamps: local time stamp (as timestamp_tracker_us) which is similar to what we get in sranipal and an additional one, system (timestamp_system_us) which is synced with computer time. Is there a way to get the system time stamps in sranipal sdk via some sort of patch, etc? Regards, Nitesh @Daniel_Y @Corvus Link to comment Share on other sites More sharing options...
Hank_Li Posted July 31, 2020 Share Posted July 31, 2020 Hi @nbhatia In the current version,there is no way yet to get the system time stamps. And we will implement that in the next version. Thanks Link to comment Share on other sites More sharing options...
VGagliano Posted July 15, 2021 Share Posted July 15, 2021 Hi @Hank_Li Do you have any update on when this feature will be available? As one year after your post, I don't know if the SDK version has changed since, but the system timestamps still aren't available. Regards, Vivien Link to comment Share on other sites More sharing options...
Hank_Li Posted July 15, 2021 Share Posted July 15, 2021 Hi @VGagliano Yes it was~. Please flow the sample code to get system timestamps. int result = ViveSR::anipal::Eye::SRanipal_UpdateTimeSync(); if( result == ViveSR::Error::WORK ){ int64_t time; ViveSR::anipal::Eye::SRanipal_GetSystemTime(&time); printf("%u",(unsigned )time); } 1 Link to comment Share on other sites More sharing options...
olga.lukashova Posted August 10, 2021 Share Posted August 10, 2021 On 7/15/2021 at 12:06 PM, Hank_Li said: Hi @VGagliano Yes it was~. Please flow the sample code to get system timestamps. int result = ViveSR::anipal::Eye::SRanipal_UpdateTimeSync(); if( result == ViveSR::Error::WORK ){ int64_t time; ViveSR::anipal::Eye::SRanipal_GetSystemTime(&time); printf("%u",(unsigned )time); } Dear Hank_Li, I have troubles running this piece of code - is there documentation on this method? So far I haven't find the description. Thank you! Link to comment Share on other sites More sharing options...
olga.lukashova Posted August 10, 2021 Share Posted August 10, 2021 13 minutes ago, olga.lukashova said: Dear Hank_Li, I have troubles running this piece of code - is there documentation on this method? So far I haven't find the description. Thank you! I am using SRanipal 1.3.3.0 Link to comment Share on other sites More sharing options...
paulm Posted May 20, 2022 Share Posted May 20, 2022 I guess SRanipal_Eye_API.SRanipal_UpdateTimeSync(); should do the trick. Link to comment Share on other sites More sharing options...
paulm Posted June 3, 2022 Share Posted June 3, 2022 I assume that SRanipal_Eye_API.SRanipal_GetSystemTime(ref long timestamp) gives you the you the tick count since system start. To get it along the EyeData.timeStamp you could use this: int SRanipalSystemToEyeTrackerTimeStamp(long timeStamp) { // Value is generated by observation long maxEyeDataTimestampValue = uint.MaxValue; timeStamp %= maxEyeDataTimestampValue; // Magic trick to round the integer at the fourth last digit timeStamp += 500; // Cutting of the last three digits timeStamp /= 1000; return (int) timeStamp; } Link to comment Share on other sites More sharing options...
Justine Posted June 5, 2022 Share Posted June 5, 2022 On 6/3/2022 at 12:09 PM, paulm said: I assume that SRanipal_Eye_API.SRanipal_GetSystemTime(ref long timestamp) gives you the you the tick count since system start. To get it along the EyeData.timeStamp you could use this: int SRanipalSystemToEyeTrackerTimeStamp(long timeStamp) { // Value is generated by observation long maxEyeDataTimestampValue = uint.MaxValue; timeStamp %= maxEyeDataTimestampValue; // Magic trick to round the integer at the fourth last digit timeStamp += 500; // Cutting of the last three digits timeStamp /= 1000; return (int) timeStamp; } Hi @paulm, Can you please share a sample code of how you achieved to collect eye data using this? I am also having trouble collecting eye data with the system timestamps. Looking forward to hearing from you! 🙂 Thanks. Link to comment Share on other sites More sharing options...
paulm Posted June 9, 2022 Share Posted June 9, 2022 (edited) Actually for collecting the eye data I do still use an almost unaltered eye data callback function like described in https://forum.vive.com/topic/9341-vive-eye-tracking-at-120hz/ . I do still use the timestamp which comes with it as I suppose that it is an altered system timestamp. Using Windows & Unity: private void Update() { long timestamp = 0; SRanipal_Eye_API.SRanipal_GetSystemTime(ref long timestamp) Vector3 headPose = Camera.main.transform.rotation.eulerAngles; timestamp = SRanipalSystemToEyeTrackerTimeStamp(long timeStamp) } I am proposing that the timestamp above can now be compared with eyeData.timestamp which you get through the eye data callback function for synchronizing purposes. Cheers. 😃 Edited June 9, 2022 by paulm 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