Log in or register to post comments

Change Vuforia Configuration in script

April 29, 2017 - 2:47am #1

Hello,

I am developing for the ODG R-7 glasses primarily, but also want to support tablets. Since the only real change between the two would be changing 1 setting in the Vuforia Configuration (Chagning Digital Eyewear type from Optical See-Through to Video See-Through), it makes sense to me that I should be able to output just 1 APK file that can be installed on both the ODG glasses AND an Android tablet, and it should work on both (see-through stereoscopic for the glasses, and rendering the camera feed on the tablet).

Is there an easy way to do this in script so I don't have to switch the one setting and then rebuild an entirely new APK for each?

Thanks

Change Vuforia Configuration in script

May 3, 2017 - 7:28pm #3

Yes, you can setup an APK to check whether it is a mobile or optical eyewear device and programmatically configure the settings. I would suggest setting the Inspector values for mobile and then change to eyewear settings if a dedicated eyewear device is detected.

https://library.vuforia.com/reference/api/unity/classVuforia_1_1DigitalEyewearARController.html

https://library.vuforia.com/reference/api/unity/classVuforia_1_1EyewearDevice.html

Here's some code you can use:

void Start()
{
    VuforiaARController.Instance.RegisterVuforiaStartedCallback(OnVuforiaStarted);

    if (SystemInfo.deviceModel == "Osterhout_Design_Group R7-W")
     // do something specific for ODG R-7

    if (SystemInfo.deviceModel == "EPSON embt2")
        // do something specific for Epson BT-200
}


void OnVuforiaStarted()
{
    Debug.Log("OnVuforiaStarted() called.");

    if (Device.Instance is EyewearDevice)
    {
        EyewearDevice eyewearDevice = (EyewearDevice)Device.Instance;
       
        DigitalEyewearARController.Instance.SetEyewearType(DigitalEyewearARController.EyewearType.OpticalSeeThrough);
        DigitalEyewearARController.Instance.SetSeeThroughConfiguration(DigitalEyewearARController.SeeThroughConfiguration.Vuforia);

        // when entering into 3d stereo mode
        if(!eyewearDevice.IsDisplayExtended()) {
            eyewearDevice.SetDisplayExtended(true);
        }

        // to enable predictive tracking
        if(!eyewearDevice.IsPredictiveTrackingEnabled()) {
            eyewearDevice.SetPredictiveTracking(true);
        }

        // when exiting 3d stereo mode back to 2d (duplication/mono) mode for menus, etc.
        eyewearDevice.SetDisplayExtended(false);

    }
}

Change Vuforia Configuration in script

May 1, 2017 - 1:44pm #2

Hello,

Since the key question in determining this is whether the platform support stereoscopic displays, and it seems only Vuforia provides APIs that are capable of answering this question, you likely will need to derive the answer before Vuforia is initialized.

It may sound simple, but perhaps you can use Android APIs to detect the platform you are running upon by device name (e.g. "R7-P")? And then use that flag to determine how you will initialize Vuforia?

Thanks.

Log in or register to post comments