Jump to content

Corvus

Verified Members
  • Posts

    313
  • Joined

  • Last visited

Posts posted by Corvus

  1. @SinnStudio @Maze Theory @Survios Yes, there is now a CLI tool you can access via the dev console (Binary Build page). Here is the documentation: https://developer.viveport.com/documents/viveport-uploader-document.pdf

     
    Quote
    New CLI tool is available now!
    Upload your build with the latest CLI tool - if you're using version lower than 1.0.0.2, please download the latest version to start uploading.
    Upload builds faster via the Viveport Command Line Interface Tool which enables resumable uploads and supports faster upload speeds when compared to the browser interface.
    For more information, refer to the Viveport CLI tool's documentation

     

     
  2. Yes, that should work if you are using v1 data. If you are using v2 make sure to use 'SRanipal_Eye_v2'.

     

    // make sure the framework status is WORKING
    SRanipal_Eye_Framework.Status == SRanipal_Eye_Framework.FrameworkStatus.WORKING
    
    // pass the verbose data
    SRanipal_Eye.GetVerboseData(out verboseData); // v1
    // SRanipal_Eye_v2.GetVerboseData(out verboseData); // v2
    
    // read the necessary data
    pupilDiameterLeft = verboseData.left.pupil_diameter_mm;
    pupilDiameterRight = verboseData.right.pupil_diameter_mm;

     

  3. @apellisscot Here are my specs and I'm getting 8/9ms updates (~120hz). DM me if you would like a build to test/verify with.

    • Windows 10
    • Intel i7-9750H
    • 16GB Ram
    • RTX 2070 Max-Q

     

    • Unity 2019.4.17f1

     

    using UnityEngine;
    using ViveSR.anipal.Eye;
    using System.Runtime.InteropServices;
    using UnityEngine.UI;
    
    /// <summary>
    /// Example usage for eye tracking callback
    /// Note: Callback runs on a separate thread to report at ~120hz.
    /// Unity is not threadsafe and cannot call any UnityEngine api from within callback thread.
    /// </summary>
    public class test120hz : MonoBehaviour
    {
        private static EyeData eyeData = new EyeData();
        private static bool eye_callback_registered = false;
    
        public Text uiText;
        private float updateSpeed = 0;
        private static float lastTime, currentTime;
    
    
        void Update()
        {
            if (SRanipal_Eye_Framework.Status != SRanipal_Eye_Framework.FrameworkStatus.WORKING) return;
    
    
            if (SRanipal_Eye_Framework.Instance.EnableEyeDataCallback == true && eye_callback_registered == false)
            {
                SRanipal_Eye.WrapperRegisterEyeDataCallback(Marshal.GetFunctionPointerForDelegate((SRanipal_Eye.CallbackBasic)EyeCallback));
                eye_callback_registered = true;
            }
            else if (SRanipal_Eye_Framework.Instance.EnableEyeDataCallback == false && eye_callback_registered == true)
            {
                SRanipal_Eye.WrapperUnRegisterEyeDataCallback(Marshal.GetFunctionPointerForDelegate((SRanipal_Eye.CallbackBasic)EyeCallback));
                eye_callback_registered = false;
            }
    
            updateSpeed = currentTime - lastTime;
            uiText.text = updateSpeed.ToString() + " ms";
        }
    
        private void OnDisable()
        {
            Release();
        }
    
        void OnApplicationQuit()
        {
            Release();
        }
    
        /// <summary>
        /// Release callback thread when disabled or quit
        /// </summary>
        private static void Release()
        {
            if (eye_callback_registered == true)
            {
                SRanipal_Eye.WrapperUnRegisterEyeDataCallback(Marshal.GetFunctionPointerForDelegate((SRanipal_Eye.CallbackBasic)EyeCallback));
                eye_callback_registered = false;
            }
        }
    
        /// <summary>
        /// Required class for IL2CPP scripting backend support
        /// </summary>
        internal class MonoPInvokeCallbackAttribute : System.Attribute
        {
            public MonoPInvokeCallbackAttribute() { }
        }
    
        /// <summary>
        /// Eye tracking data callback thread.
        /// Reports data at ~120hz
        /// MonoPInvokeCallback attribute required for IL2CPP scripting backend
        /// </summary>
        /// <param name="eye_data">Reference to latest eye_data</param>
        [MonoPInvokeCallback]
        private static void EyeCallback(ref EyeData eye_data)
        {
            eyeData = eye_data;
            // do stuff with eyeData...
    
            lastTime = currentTime;
            currentTime = eyeData.timestamp;
        }
    }

     

×
×
  • Create New...