private void SetSessionForCoarseRelocalization() { // Set Sensor info LocationProvider = new PlatformLocationProvider(); cloudManager.Session.LocationProvider = LocationProvider; LocationProvider.Sensors.GeoLocationEnabled = AppController.AppSettings.useGeoLocation && SensorPermissionHelper.HasGeoLocationPermission(); LocationProvider.Sensors.WifiEnabled = AppController.AppSettings.useWifi && SensorPermissionHelper.HasWifiPermission(); LocationProvider.Sensors.BluetoothEnabled = AppController.AppSettings.useBluetooth && SensorPermissionHelper.HasBluetoothPermission(); LocationProvider.Sensors.KnownBeaconProximityUuids = coarseRelocalizationSettings.KnownBeaconProximityUuids; //Debug.Log($"WifiEnabled={LocationProvider.Sensors.WifiEnabled}"); //Debug.Log($"BluetoothEnabled={LocationProvider.Sensors.BluetoothEnabled}"); foreach (var uuid in coarseRelocalizationSettings.KnownBeaconProximityUuids) { Debug.Log($"KnownBeaconProximityUuids={uuid}"); } }
public async Task StartAzureSessionForCoarseRelocalizationAsync() { Debug.Log("\nAnchorModuleScript.StartAzureSession()"); // Notify AnchorFeedbackScript OnStartASASession?.Invoke(); Debug.Log("Starting Azure session... please wait..."); if (cloudManager.Session == null) { Debug.Log("Creating Session..."); // Creates a new session if one does not exist await cloudManager.CreateSessionAsync(); } Debug.Log("Settings Near Devices..."); SetNearDevice(); Debug.Log("Start Session..."); // Starts the session if not already started await cloudManager.StartSessionAsync(); Debug.Log("Device Permission Request..."); // Request permission for using sensors. SensorPermissionHelper.RequestSensorPermissions(); Debug.Log("Coarse Relocalization..."); SetSessionForCoarseRelocalization(); this.SessionStarted = true; Debug.Log("Azure session started successfully"); }