LoginSignup
57
24

More than 3 years have passed since last update.

マルチデバイス間でシェアリングできるAzure Spatial Anchorsをやってみた(HoloLens、iOS、ARKit)

Last updated at Posted at 2019-02-24

HoloLens2が発表されましたね!
視野が2倍以上に広がり、見た感じ軽く、重心も中央に寄り、心地よさ3倍!w ジェスチャやアイトラッキング、ハンドトラッキングなど、驚く機能が公開されました。ヘルメットも開発されてるし、レンズを上にあげることもできるし、Dynamics365 Guidesなど、嬉しいことばかりでしたね!値段は3500ドル。Azure Kinectも気になりますね!早く欲しい!

Azure Mixed Realityの3つの機能も発表されました。

  • Azure Spatial Anchors ・・・マルチデバイス間でアンカーを共有
  • Azure Remote Rendering ・・・ハイクオリティな3Dコンテンツをリアルタイムで描画
  • Azure Digital Twins・・・デジタルソースと現実世界を関連づけるプラットフォーム

Azure Spatial Anchorsのプレビューが公開されていたので、早速、試してみました。

HoloLensアプリ(Unity)の作成

Quickstart: Create a HoloLens Unity app using Azure Spatial Anchors

開発環境

  • Windows 10 PC
  • Unity 2018.3.6f1
  • Visual Studio 2017
  • HoloLens

Azure Spatial Anchorsの作成

1.Azure Portalを開き、Spatial Anchorsを新規作成します
2.下記のように設定します
spatialanchors02.PNG
3.Account IDとKeyをメモしておきます。
画像
spatialanchors15.PNG

サンプルプロジェクト

1.azure-spatial-anchors-samplesをダウンロードし、UnityフォルダをUnityで開きます。
2.Build Settingsは以下のようにします。
spatialanchors06.PNG

3.プロジェクトビューのAssets/AzureSpatialAnchorsPlugin/Examples/AzureSpatialAnchorsBasicDemo.unityを開き、 ヒエラルキーにあるAzureSpatialAnchors のインスペクタービューから先ほどメモしたAccount IDとKeyを入力します。
spatialanchors05.PNG

4.Appフォルダにビルドして、できたHelloAR U3D.slnを開き、HoloLensへデプロイします。
5.実行すると、アンカーの登録、検索、削除を繰り返すデモアプリが体験できます。

Next: Create Azure Spatial Anchors Session と表示され、AirTapしたら進んでいきます、

1.Next: Create Azure Spatial Anchors Session
2.Next: Configure Azure Spatial Anchors Session
3.Next: Start Azure Spatial Anchors Session
4.Tap a surface add the Local Anchor.
5.Next: Save Local Anchor to cloud
6.Saving...
7.Next: Stop Azure Spatial Anchors Session
8.Next: Create Azure Spatial Anchors Session for query
9.Next: Start Azure Spatial Anchors Session for query
10.Next: Look for Anchor
11.Looking for Anchor...
12.Next: Delete Anchor
13.Next: Stop Azure Anchors Session for query
14.Next: Restart demo

の繰り返しになります

HoloLensアプリ(C++/WinRT/DirectX)の作成

Quickstart: Create a HoloLens app with Azure Spatial Anchors, in C++/WinRT and DirectX

Unityのアプリとやってることは同じです。

開発環境

Azure Spatial Anchorsの作成

上と同じです。Account IDとKeyをメモしておきます。

サンプルプロジェクト

1.azure-spatial-anchors-samplesHoloLens\DirectX\SampleHoloLens.slnを開きます。
2.HoloLens\DirectX\SampleHoloLens\ViewController.cppのAccount IdとKeyを編集します。
spatialanchors16.PNG

3.HoloLensにデプロイします。
spatialanchors07.PNG
4.実行すると、アンカーの登録、検索、削除を繰り返すデモアプリが体験できます。

airtap to beginと表示され、エアタップしたら進んでいきます。

1.airtap to begin
2.factory created airtap to create session
3.session created. not configured airtap to configure session
4.session configured, not started airtap to start session
5.session started airtap to place anchor
6.local anchor created airtap to prepare a cloud anchor
ここでエアタップしたところでアプリが落ちちゃいました。

Unityでシェアリング

Tutorial: Sharing across sessions and devices with Azure Spatial Anchors

開発環境

  • Windows 10 PC
  • Visual Studio 2017
  • .NET Core 2.2 SDK
  • Unity 2018.3.6f1
  • iPhone 8 Plus
  • Mac Book Pro 2018
  • Xcode 10.1
  • CocoaPods
  • Unity ARKit Plugin v2.0.0

Azure Spatial Anchorsの作成

上と同じです。Account IDとKeyをメモしておきます。

サンプルプロジェクト(SharingService)

1.azure-spatial-anchors-samplesSharing\SharingServiceSample\SharingService.slnを開きます。
2.SharingServiceを右クリックし、発行をクリックします。
spatialanchors08.PNG
3.App Serviceを作成します。
spatialanchors09.PNG
spatialanchors10.PNG
4.ウィンドウが現れます。http://<app_name>.azurewebsites.net/index.html
spatialanchors11.PNG

iOS Deviceのサンプルプロジェクト

1.azure-spatial-anchors-samplesのUnityフォルダをUnityから開きます。
2.Build Settingsは以下のようにします。
spatialanchors14.PNG

3.Unity ARKit Plugin v2.0.0をダウンロードし、Assetsフォルダの中をサンプルプロジェクトのAssetsフォルダへコピペします。
spatialanchors13.PNG

4.Assets/AzureSpatialAnchorsPlugin/Examples/AzureSpatialAnchorsLocalSharedDemo.unityを開き、ヒエラルキーのAzureSpatialAnchorsのインスペクタービューのBase Sharing UrlAccount IDKeyを入力します。
Base Sharing Url: http://<app_name>.azurewebsites.net/api/anchors
spatialanchors12.PNG

5.AzureSpatialAnchorsPlugin/Examples/AzureSpatialAnchorsLocalSharedDemoのみにチェックが入っていることを確認し、ビルドします。

6.あとはXCodeでiPhoneにデプロイします。

ここから保留、できたら更新します。

Unityでシェアリング(Azure Cosmos DBを使う)

Tutorial: Sharing across sessions and devices with Azure Spatial Anchors and an Azure Cosmos DB back-end

57
24
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
57
24