Skip to content

Commit 3427d58

Browse files
authored
Merge pull request #95842 from MicrosoftDocs/release-asa-1908
Release asa 1908
2 parents 34b31e8 + d4deb34 commit 3427d58

17 files changed

+1216
-6
lines changed

articles/spatial-anchors/concepts/coarse-reloc.md

Lines changed: 695 additions & 0 deletions
Large diffs are not rendered by default.
18.3 KB
Loading
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: How to create and locate anchors using on-device sensors in C++/NDK | Microsoft Docs
3+
description: In-depth explanation of how to create and locate anchors using on-device sensors in C++/NDK.
4+
author: bucurb
5+
manager: dacoghl
6+
services: azure-spatial-anchors
7+
8+
ms.author: bobuc
9+
ms.date: 09/19/2019
10+
ms.topic: tutorial
11+
ms.service: azure-spatial-anchors
12+
---
13+
# How to create and locate anchors using on-device sensors in C++/NDK
14+
15+
> [!div class="op_single_selector"]
16+
> * [Unity](set-up-coarse-reloc-unity.md)
17+
> * [Objective-C](set-up-coarse-reloc-objc.md)
18+
> * [Swift](set-up-coarse-reloc-swift.md)
19+
> * [Android Java](set-up-coarse-reloc-java.md)
20+
> * [C++/NDK](set-up-coarse-reloc-cpp-ndk.md)
21+
> * [C++/WinRT](set-up-coarse-reloc-cpp-winrt.md)
22+
23+
Azure Spatial Anchors can associate on-device, positioning sensor data with the anchors you create. This data can also be used to quickly determine whether there are any anchors nearby your device. For more information, see [Coarse relocalization](../concepts/coarse-reloc.md).
24+
25+
## Prerequisites
26+
27+
To complete this guide, make sure you have:
28+
29+
- Basic knowledge on C++ and the <a href="https://developer.android.com/ndk/" target="_blank">Android Native Development Kit</a>.
30+
- Read through the [Azure Spatial Anchors overview](../overview.md).
31+
- Completed one of the [5-minute Quickstarts](../index.yml).
32+
- Read through the [Create and locate anchors how-to](../create-locate-anchors-overview.md).
33+
34+
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-configure-provider.md)]
35+
36+
```cpp
37+
// Create the sensor fingerprint provider
38+
std::shared_ptr<PlatformLocationProvider> sensorProvider;
39+
sensorProvider = std::make_shared<PlatformLocationProvider>();
40+
41+
// Allow GPS
42+
const std::shared_ptr<SensorCapabilities>& sensors = sensorProvider->Sensors();
43+
sensors->GeoLocationEnabled(true);
44+
45+
// Allow WiFi scanning
46+
sensors->WifiEnabled(true);
47+
48+
// Populate the set of known BLE beacons' UUIDs
49+
std::vector<std::string> uuids;
50+
uuids.push_back("22e38f1a-c1b3-452b-b5ce-fdb0f39535c1");
51+
uuids.push_back("a63819b9-8b7b-436d-88ec-ea5d8db2acb0");
52+
53+
// Allow the set of known BLE beacons
54+
sensors->BluetoothEnabled(true);
55+
sensors->KnownBeaconProximityUuids(uuids);
56+
```
57+
58+
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-configure-session.md)]
59+
60+
```cpp
61+
// Set the session's sensor fingerprint provider
62+
cloudSpatialAnchorSession->LocationProvider(sensorProvider);
63+
64+
// Configure the near-device criteria
65+
auto nearDeviceCriteria = std::make_shared<NearDeviceCriteria>();
66+
nearDeviceCriteria->DistanceInMeters(5.0f);
67+
nearDeviceCriteria->MaxResultCount(25);
68+
69+
// Set the session's locate criteria
70+
auto anchorLocateCriteria = std::make_shared<AnchorLocateCriteria>();
71+
anchorLocateCriteria->NearDevice(nearDeviceCriteria);
72+
cloudSpatialAnchorSession->CreateWatcher(anchorLocateCriteria);
73+
```
74+
75+
[!INCLUDE [Locate](../../../includes/spatial-anchors-create-locate-anchors-locating-events.md)]
76+
77+
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-next-steps.md)]
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
title: How to create and locate anchors using on-device sensors in C++/WinRT | Microsoft Docs
3+
description: In-depth explanation of how to create and locate anchors using on-device sensors in C++/WinRT.
4+
author: bucurb
5+
manager: dacoghl
6+
services: azure-spatial-anchors
7+
8+
ms.author: bobuc
9+
ms.date: 09/19/2019
10+
ms.topic: tutorial
11+
ms.service: azure-spatial-anchors
12+
---
13+
# How to create and locate anchors using on-device sensors in C++/WinRT
14+
15+
> [!div class="op_single_selector"]
16+
> * [Unity](set-up-coarse-reloc-unity.md)
17+
> * [Objective-C](set-up-coarse-reloc-objc.md)
18+
> * [Swift](set-up-coarse-reloc-swift.md)
19+
> * [Android Java](set-up-coarse-reloc-java.md)
20+
> * [C++/NDK](set-up-coarse-reloc-cpp-ndk.md)
21+
> * [C++/WinRT](set-up-coarse-reloc-cpp-winrt.md)
22+
23+
Azure Spatial Anchors can associate on-device, positioning sensor data with the anchors you create. This data can also be used to quickly determine whether there are any anchors nearby your device. For more information, see [Coarse relocalization](../concepts/coarse-reloc.md).
24+
25+
## Prerequisites
26+
27+
To complete this guide, make sure you have:
28+
29+
- Basic knowledge on C++ and the <a href="https://docs.microsoft.com/windows/uwp/cpp-and-winrt-apis/intro-to-using-cpp-with-winrt" target="_blank">Windows Runtime APIs</a>.
30+
- Read through the [Azure Spatial Anchors overview](../overview.md).
31+
- Completed one of the [5-minute Quickstarts](../index.yml).
32+
- Read through the [Create and locate anchors how-to](../create-locate-anchors-overview.md).
33+
34+
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-configure-provider.md)]
35+
36+
```cpp
37+
// Create the ASA factory
38+
SpatialAnchorsFactory m_asaFactory { nullptr };
39+
// . . .
40+
41+
// Create the sensor fingerprint provider
42+
PlatformLocationProvider sensorProvider;
43+
sensorProvider = m_asaFactory.CreatePlatformLocationProvider();
44+
45+
// Allow GPS
46+
SensorCapabilities sensors = sensorProvider.Sensors()
47+
sensors.GeoLocationEnabled(true);
48+
49+
// Allow WiFi scanning
50+
sensors.WifiEnabled(true);
51+
52+
// Populate the set of known BLE beacons' UUIDs
53+
std::vector<winrt::hstring> uuids;
54+
uuids.emplace_back("22e38f1a-c1b3-452b-b5ce-fdb0f39535c1");
55+
uuids.emplace_back("a63819b9-8b7b-436d-88ec-ea5d8db2acb0");
56+
57+
// Allow the set of known BLE beacons
58+
sensors.BluetoothEnabled(true);
59+
sensors.KnownBeaconProximityUuids(uuids);
60+
```
61+
62+
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-configure-session.md)]
63+
64+
```cpp
65+
// Set the session's sensor fingerprint provider
66+
cloudSpatialAnchorSession.LocationProvider(sensorProvider);
67+
68+
// Configure the near-device criteria
69+
NearDeviceCriteria nearDeviceCriteria = m_asaFactory.CreateNearDeviceCriteria();
70+
nearDeviceCriteria.DistanceInMeters(5.0f);
71+
nearDeviceCriteria.MaxResultCount(25);
72+
73+
// Set the session's locate criteria
74+
anchorLocateCriteria = m_asaFactory.CreateAnchorLocateCriteria();
75+
anchorLocateCriteria.NearDevice(nearDeviceCriteria);
76+
cloudSpatialAnchorSession.CreateWatcher(anchorLocateCriteria);
77+
```
78+
79+
[!INCLUDE [Locate](../../../includes/spatial-anchors-create-locate-anchors-locating-events.md)]
80+
81+
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-next-steps.md)]
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: How to create and locate anchors using on-device sensors in Java | Microsoft Docs
3+
description: In-depth explanation of how to create and locate anchors using on-device sensors in Java.
4+
author: bucurb
5+
manager: dacoghl
6+
services: azure-spatial-anchors
7+
8+
ms.author: bobuc
9+
ms.date: 09/19/2019
10+
ms.topic: tutorial
11+
ms.service: azure-spatial-anchors
12+
---
13+
# How to create and locate anchors using on-device sensors in Java
14+
15+
> [!div class="op_single_selector"]
16+
> * [Unity](set-up-coarse-reloc-unity.md)
17+
> * [Objective-C](set-up-coarse-reloc-objc.md)
18+
> * [Swift](set-up-coarse-reloc-swift.md)
19+
> * [Android Java](set-up-coarse-reloc-java.md)
20+
> * [C++/NDK](set-up-coarse-reloc-cpp-ndk.md)
21+
> * [C++/WinRT](set-up-coarse-reloc-cpp-winrt.md)
22+
23+
Azure Spatial Anchors can associate on-device, positioning sensor data with the anchors you create. This data can also be used to quickly determine whether there are any anchors nearby your device. For more information, see [Coarse relocalization](../concepts/coarse-reloc.md).
24+
25+
## Prerequisites
26+
27+
To complete this guide, make sure you have:
28+
29+
- Basic knowledge of Java.
30+
- Read through the [Azure Spatial Anchors overview](../overview.md).
31+
- Completed one of the [5-minute Quickstarts](../index.yml).
32+
- Read through the [Create and locate anchors how-to](../create-locate-anchors-overview.md).
33+
34+
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-configure-provider.md)]
35+
36+
```java
37+
// Create the sensor fingerprint provider
38+
PlatformLocationProvider sensorProvider = new PlatformLocationProvider();
39+
40+
// Allow GPS
41+
SensorCapabilities sensors = sensorProvider.getSensors();
42+
sensors.setGeoLocationEnabled(true);
43+
44+
// Allow WiFi scanning
45+
sensors.setWifiEnabled(true);
46+
47+
// Populate the set of known BLE beacons' UUIDs
48+
String uuids[] = new String[2];
49+
uuids[0] = "22e38f1a-c1b3-452b-b5ce-fdb0f39535c1";
50+
uuids[1] = "a63819b9-8b7b-436d-88ec-ea5d8db2acb0";
51+
52+
// Allow the set of known BLE beacons
53+
sensors.setBluetoothEnabled(true);
54+
sensors.setKnownBeaconProximityUuids(uuids);
55+
```
56+
57+
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-configure-session.md)]
58+
59+
```java
60+
// Set the session's sensor fingerprint provider
61+
cloudSpatialAnchorSession.setLocationProvider(sensorProvider);
62+
63+
// Configure the near-device criteria
64+
NearDeviceCriteria nearDeviceCriteria = new NearDeviceCriteria();
65+
nearDeviceCriteria.setDistanceInMeters(5.0f);
66+
nearDeviceCriteria.setMaxResultCount(25);
67+
68+
// Set the session's locate criteria
69+
AnchorLocateCriteria anchorLocateCriteria = new AnchorLocateCriteria();
70+
anchorLocateCriteria.setNearDevice(nearDeviceCriteria);
71+
cloudSpatialAnchorSession.createWatcher(anchorLocateCriteria);
72+
```
73+
74+
[!INCLUDE [Locate](../../../includes/spatial-anchors-create-locate-anchors-locating-events.md)]
75+
76+
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-next-steps.md)]
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: How to create and locate anchors using on-device sensors in Objective-C | Microsoft Docs
3+
description: In-depth explanation of how to create and locate anchors using on-device sensors in Objective-C.
4+
author: bucurb
5+
manager: dacoghl
6+
services: azure-spatial-anchors
7+
8+
ms.author: bobuc
9+
ms.date: 09/19/2019
10+
ms.topic: tutorial
11+
ms.service: azure-spatial-anchors
12+
---
13+
# How to create and locate anchors using on-device sensors in Objective-C
14+
15+
> [!div class="op_single_selector"]
16+
> * [Unity](set-up-coarse-reloc-unity.md)
17+
> * [Objective-C](set-up-coarse-reloc-objc.md)
18+
> * [Swift](set-up-coarse-reloc-swift.md)
19+
> * [Android Java](set-up-coarse-reloc-java.md)
20+
> * [C++/NDK](set-up-coarse-reloc-cpp-ndk.md)
21+
> * [C++/WinRT](set-up-coarse-reloc-cpp-winrt.md)
22+
23+
Azure Spatial Anchors can associate on-device, positioning sensor data with the anchors you create. This data can also be used to quickly determine whether there are any anchors nearby your device. For more information, see [Coarse relocalization](../concepts/coarse-reloc.md).
24+
25+
## Prerequisites
26+
27+
To complete this guide, make sure you have:
28+
29+
- Basic knowledge of Objective-C.
30+
- Read through the [Azure Spatial Anchors overview](../overview.md).
31+
- Completed one of the [5-minute Quickstarts](../index.yml).
32+
- Read through the [Create and locate anchors how-to](../create-locate-anchors-overview.md).
33+
34+
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-configure-provider.md)]
35+
36+
```objc
37+
// Create the sensor fingerprint provider
38+
ASAPlatformLocationProvider *sensorProvider;
39+
sensorProvider = [[ASAPlatformLocationProvider alloc] init];
40+
41+
// Allow GPS
42+
ASASensorCapabilities *sensors = locationProvider.sensors;
43+
sensors.geoLocationEnabled = true;
44+
45+
// Allow WiFi scanning
46+
sensors.wifiEnabled = true;
47+
48+
// Populate the set of known BLE beacons' UUIDs
49+
NSArray *uuids = @[@"22e38f1a-c1b3-452b-b5ce-fdb0f39535c1", @"a63819b9-8b7b-436d-88ec-ea5d8db2acb0"];
50+
51+
// Allow a set of known BLE beacons
52+
sensors.bluetoothEnabled = true;
53+
sensors.knownBeaconProximityUuids = uuids;
54+
```
55+
56+
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-configure-session.md)]
57+
58+
```objc
59+
// Set the session's sensor fingerprint provider
60+
cloudSpatialAnchorSession.locationProvider = sensorProvider;
61+
62+
// Configure the near-device criteria
63+
ASANearDeviceCriteria *nearDeviceCriteria = [[ASANearDeviceCriteria alloc] init];
64+
nearDeviceCriteria.distanceInMeters = 5.0f;
65+
nearDeviceCriteria.maxResultCount = 25;
66+
67+
// Set the session's locate criteria
68+
ASAAnchorLocateCriteria *anchorLocateCriteria = [[ASAAnchorLocateCriteria alloc] init];
69+
anchorLocateCriteria.nearDevice = nearDeviceCriteria;
70+
[cloudSpatialAnchorSession createWatcher:anchorLocateCriteria];
71+
```
72+
73+
[!INCLUDE [Locate](../../../includes/spatial-anchors-create-locate-anchors-locating-events.md)]
74+
75+
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-next-steps.md)]
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: How to create and locate anchors using on-device sensors in Swift| Microsoft Docs
3+
description: In-depth explanation of how to create and locate anchors using on-device sensors in Swift.
4+
author: bucurb
5+
manager: dacoghl
6+
services: azure-spatial-anchors
7+
8+
ms.author: bobuc
9+
ms.date: 09/19/2019
10+
ms.topic: tutorial
11+
ms.service: azure-spatial-anchors
12+
---
13+
# How to create and locate anchors using on-device sensors in Swift
14+
15+
> [!div class="op_single_selector"]
16+
> * [Unity](set-up-coarse-reloc-unity.md)
17+
> * [Objective-C](set-up-coarse-reloc-objc.md)
18+
> * [Swift](set-up-coarse-reloc-swift.md)
19+
> * [Android Java](set-up-coarse-reloc-java.md)
20+
> * [C++/NDK](set-up-coarse-reloc-cpp-ndk.md)
21+
> * [C++/WinRT](set-up-coarse-reloc-cpp-winrt.md)
22+
23+
Azure Spatial Anchors can associate on-device, positioning sensor data with the anchors you create. This data can also be used to quickly determine whether there are any anchors nearby your device. For more information, see [Coarse relocalization](../concepts/coarse-reloc.md).
24+
25+
## Prerequisites
26+
27+
To complete this guide, make sure you have:
28+
29+
- Basic knowledge of Swift.
30+
- Read through the [Azure Spatial Anchors overview](../overview.md).
31+
- Completed one of the [5-minute Quickstarts](../index.yml).
32+
- Read through the [Create and locate anchors how-to](../create-locate-anchors-overview.md).
33+
34+
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-configure-provider.md)]
35+
36+
```swift
37+
// Create the sensor fingerprint provider
38+
var sensorProvider: ASAPlatformLocationProvider?
39+
sensorProvider = ASAPlatformLocationProvider()
40+
41+
// Allow GPS
42+
let sensors = locationProvider?.sensors
43+
sensors.geoLocationEnabled = true
44+
45+
// Allow WiFi scanning
46+
sensors.wifiEnabled = true
47+
48+
// Populate the set of known BLE beacons' UUIDs
49+
let uuids = [String]()
50+
uuids.append("22e38f1a-c1b3-452b-b5ce-fdb0f39535c1")
51+
uuids.append("a63819b9-8b7b-436d-88ec-ea5d8db2acb0")
52+
53+
// Allow the set of known BLE beacons
54+
sensors.bluetoothEnabled = true
55+
sensors.knownBeaconProximityUuids = uuids
56+
```
57+
58+
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-configure-session.md)]
59+
60+
```swift
61+
// Set the session's sensor fingerprint provider
62+
cloudSpatialAnchorSession!.locationProvider = sensorProvider
63+
64+
// Configure the near-device criteria
65+
let nearDeviceCriteria = ASANearDeviceCriteria()!
66+
nearDeviceCriteria.distanceInMeters = 5.0
67+
nearDeviceCriteria.maxResultCount = 25
68+
69+
// Set the session's locate criteria
70+
let anchorLocateCriteria = ASAAnchorLocateCriteria()!
71+
anchorLocateCriteria.nearDevice = nearDeviceCriteria
72+
cloudSpatialAnchorSession!.createWatcher(anchorLocateCriteria)
73+
```
74+
75+
[!INCLUDE [Locate](../../../includes/spatial-anchors-create-locate-anchors-locating-events.md)]
76+
77+
[!INCLUDE [Configure Provider](../../../includes/spatial-anchors-set-up-coarse-reloc-next-steps.md)]

0 commit comments

Comments
 (0)