Location Service gets stuck during Initializing on Epson Moverio

I am trying to get GPS coordinates on an Android 5.1 (Epson moverio BT350 AR glasses) using Unity.

The LocationService command hangs on initializing.

can you help me, please?

I used the standard code provided by Unity on-line documentation.

using UnityEngine;
using System.Collections;

public class TestLocationService : MonoBehaviour
{
IEnumerator Start()
{
// First, check if user has location service enabled
if (!Input.location.isEnabledByUser)
yield break;

    // Start service before querying location
    Input.location.Start();

    // Wait until service initializes
    int maxWait = 20;
    while (Input.location.status == LocationServiceStatus.Initializing && maxWait > 0)
    {
        yield return new WaitForSeconds(1);
        maxWait--;
    }

    // Service didn't initialize in 20 seconds
    if (maxWait < 1)
    {
        print("Timed out");
        yield break;
    }

    // Connection has failed
    if (Input.location.status == LocationServiceStatus.Failed)
    {
        print("Unable to determine device location");
        yield break;
    }
    else
    {
        // Access granted and location value could be retrieved
        print("Location: " + Input.location.lastData.latitude + " " + Input.location.lastData.longitude + " " + Input.location.lastData.altitude + " " + Input.location.lastData.horizontalAccuracy + " " + Input.location.lastData.timestamp);
    }

    // Stop service if there is no need to query location updates continuously
    Input.location.Stop();
}

}

1 Answer

1

@Giulval I think the problem is that Unity for location service status automatically calls for “high accuracy” approach that mixes GPS and network - and this is not supported by Epson device, that uses only GPS.
You should check the ‘Low Accuracy Location’ from player settings. This uses only GPS, however ‘Input.location.isEnabledByUser’ statement has been seen wrong although open in device. If I delete this statement then location give '0.0, 0.0 'result. So I really try everything, but cannot find a solution.