見出し画像

【Niantic Lightship VPS #3】 Preparing to use Lightship VPS - Lightship VPSを使うための準備

1: Article summary - 記事概要

Hello, this is Matt from the Designium.

In this third article, I will explain about scanning using the Niantic Wayfarer app and setting up the Unity project to use the VPS function of Lightship ARDK.
* The second article is here.

こんにちは、デザイニウムMattです。
第三回の本記事では、Niantic Wayfarerアプリを使用したスキャンと、Lightship ARDKのVPS機能(LightShip VPS)を使用するためのUnityプロジェクトの設定について解説します。前回の記事は下記からご覧ください。

2: Procedure outline - 手順概要

The process of preparing to use the Lightship VPS system can be split into roughly two stages: deciding on the location we will base our VPS experience, and adding the VPS functionality to our Unity scene.

A VPS system works by recognising an area or object in the real world and so requires prior knowledge of that area. The Lightship VPS has many areas and objects that it can already recognise which can be found on the VPS Coverage Map. If we would like to use one of these predetermined locations for our VPS experience then we don't need to do anything else to prepare the location for the VPS. 

Lightship VPSを使用するための準備プロセスは、大きく2つの段階に分けることができます。VPSのベースとなる場所を決定することと、UnityのシーンにVPS機能を追加することです。

VPSは、実世界の領域またはオブジェクトを認識することによって機能するため、その領域に関する事前の知識が必要です。 Lightship VPSには、上記写真のようにVPSカバレッジマップで見ると、すでに認識できる多くの領域とオブジェクトがあることがわかります。すでにVPSのオブジェクトとして登録済みの1つをVPSに使用したい場合、VPSのオブジェクトを登録するような作業は必要ありません。

Niantic VPS Coverage Map on the Niantic developer dashboard

If we want to use the VPS in areas outside of these predetermined locations we need to scan the area using the Niantic Wayfarer app (described below). 

After we have our location ready for using the VPS we need to prepare the Unity project. 

これらの所定の場所以外でVPSを使用する場合は、Niantic Wayfarerアプリ(以下で説明)を使用して場所(領域)やオブジェクトをスキャンする必要があります。
VPSを使用するための場所(領域)やオブジェクトのスキャンができたら、Unityプロジェクトを準備する必要があります。

3: Detailed procedure - 手順詳細

3-1: Photography for VPS - VPS用の写真撮影

To create a Lightship VPS target we must scan an object or area using the Niantic Wayfarer app. 
When considering a location for a VPS location we must establish if it will make a good VPS map. Niantic suggest “VPS Locations should be no larger than a 10-meter diameter around the location. For example, a typical statue would work as a VPS-activated Wayspot”. Statues make good Niantic VPS maps as they are usually distinctive/unique shapes and are often set apart from other objects or buildings in the environment.

The Wayfarer app uses environmental meshing to create a 3D model of the area of object the user scans, and the better the scan is, the better the VPS will perform in terms of reliability and speed of relocation. Niantic state in their documentation “if the mesh that is generated on the device looks good, the 3D map constructed for VPS should be good too.”

But how do we know if a mesh “looks good”? From my experience meshes a “good” mesh has the following features: 

  • Well defined edges and corners.

  • Clearly shows distinctive details of an area/object*.

  • Has few holes/gaps in the mesh (no holes would be best but it often impossible) 

* In other words, if we saw this mesh out of context we could recognise the area from the distinctive shapes.

To achieve a good mesh the user should scan an area carefully and thoroughly, capturing details and surfaces from multiple angles. Niantic has also provided a handy “Best Practices” instructional video for scanning. 

Here is a video of one of our team creating a Niantic VPS map using the Wayfarer app. 

Lightship VPSターゲットを作成するには、NianticWayfarerアプリを使用してオブジェクトまたは領域をスキャンする必要があります。
VPSターゲットを検討するときは、それが適切なVPSマップになるかどうかを確認する必要があります。 Nianticは、「VPSの場所は、その場所の周囲の直径が10メートルを超えてはなりません。たとえば、典型的な彫像はVPSでアクティブ化されるWayspotとして機能します。彫像は、通常は独特で独特な形状であり、環境内の他のオブジェクトや建物とは別に設定されることが多いため、優れたNiantic VPSマップを作成します。」と言っています。

Wayfarerアプリは、環境メッシュを使用して、ユーザーがスキャンするオブジェクトの領域の3Dモデルを作成します。スキャンが優れているほど、信頼性と再配置の速度の点でVPSのパフォーマンスが向上します。Nianticのドキュメントには、「デバイスで生成されたメッシュが良好に見える場合、VPS用に構築された3Dマップも良好であるはずです。」とあります。

しかし、メッシュが「見栄えが良い」かどうかをどうやって知るのでしょうか。私の経験から、「優れた」メッシュには次のような要素があります。

・明確に定義されたエッジとコーナーを持っている
・エリア/オブジェクト*が特徴的な模様や形をしている

・メッシュに穴/ずれがほとんどない(穴は、絶対ないと良いわけではないですが、ほとんどの場合は穴がない方がよいでしょう)

*言い換えれば、このメッシュを文脈から外して見た場合、特徴的な形状からその領域を認識することができました。

良好なメッシュを実現するには、ユーザーは領域を注意深く徹底的にスキャンし、複数の角度から模様や形をキャプチャする必要があります。 Nianticは、スキャン用の便利な「ベストプラクティス」の説明ビデオも提供しています。

下記の動画は、弊社のチームメンバーがWayfarerアプリを使用してNianticVPSマップを作成したものです。

3-2: Wayfarer

Niantic have created a thorough guide to scanning for public or private maps using the Wayfarer App.
One large weakness with using the Wayfarer app is that it only provides the user with a 3D mesh of the scanned area in the Draco (.DRC) format. This format has some Unity support but is not natively supported by Unity. This may change in the future. 

Nianticは、Wayfarerアプリを使用してパブリックマップまたはプライベートマップをスキャンするための完全なガイドを作成しました。

Wayfarerアプリを使用する際の大きな弱点の1つは、スキャンされた領域の3DメッシュをDraco(.DRC)形式でのみユーザーに提供することです。 この形式は、Unity用のサードパーティライブラリはありますが、Unityネイティブではサポートされていません。 これは将来変更されるかもしれません。

3-3:Unity project settings - Unityプロジェクトの設定

Niantic recommends Unity 2020.3 LTS for ARDK. To try out the VPS functionality first download the ARDK and ARDK Example Scenes Unity packages from the Niantic Lightship downloads page: https://lightship.dev/account/downloads 

Check that the /Assets/ARDKExamples/Resources/ARDK/ArdkAuthConfig asset has your Niantic Lightship license key set as the “API Key” variable.

Nianticは、ARDKにUnity2020.3LTSを推奨しています。 VPS機能を試すには、まず、Niantic LightshipダウンロードページからARDKおよびARDK公式サンプルのUnityパッケージをダウンロードします:
https://lightship.dev/account/downloads

/ Assets / ARDKExamples / Resources / ARDK / ArdkAuthConfigアセットで、NianticLightshipライセンスキーが「Apiキー」変数として設定されていることを確認します。

The API key can be found in the Projects>Project>APIKey section of the Niantic Developer dashboard.

APIキーは、NianticDeveloperダッシュボードの Projects> ”各プロジェクト”>APIKeyセクションにあります。

In version 2.0 of the Niantic Lightship ARDK, the VPS based examples can be found in the /Assets/ARDKExamples/VPSCoverage and /Assets/ARDKExamples/WayspotAnchors folders. The VPS coverage examples demonstrate how to search for the closest VPS locations provided by Niantic, while the WayspotAnchors example is a demo of how to localize at a VPS location and place persistent objects. 

Niantic covers the setup and build settings of Lightship ARDK in their documentation. However, using the standard settings on Android sometimes leads to an error which causes the build to fail to run on some devices, stating “The application requires the latest version of Google Play Services for AR”. To avoid this error I would recommend changing the “Target API Level” in the Unity Player Settings to Android 10 (API level 29). 

Niantic Lightship ARDKのバージョン2.0では、VPSベースの例は/ Assets / ARDKExamples/VPSCoverageおよび/Assets/ ARDKExamples/WayspotAnchorsフォルダにあります。VPSCoverageシーンは、Nianticが提供する最も近いVPSの場所を検索する方法を示しています。一方、WayspotAnchorシーンは、VPSの場所にローカライズして永続オブジェクトを配置する方法のデモです。

Nianticは、Lightship ARDKのセットアップとビルド設定についてドキュメントで説明しています。 ただし、Androidで標準設定を使用すると、「アプリケーションにはAR用の最新バージョンのGoogle Playサービスが必要です」というエラーが発生し、一部のデバイスでビルドが実行されない場合があります。 このエラーを回避するには、Unityプレーヤー設定の「ターゲットAPIレベル」をAndroid 10(APIレベル29)に変更することをお勧めします。

3-4:Actual machine operation - 実機動作

The /Assets/ARDKExamples/WayspotAnchors/WayspotAnchors.scene will allow the user to try out placing simple AR objects in an environment and saving their positions to be able to restore them in the following session. 

/Assets/ARDKExamples/WayspotAnchors/WayspotAnchors.sceneを使用すると、ユーザーは単純なARオブジェクトを環境に配置し、それらの位置を保存して、次のセッションで復元できるようになります。

4: Conclusion - おわりに

In the next article, we will continue to discuss developing with and using the Niantic Lightship VPS. 

次の記事では、Niantic Lightship VPSを使った開発について引き続き解説していきます!

5: Editorial Note - 編集後記

こんにちは!デザイニウム広報のマリコです。6/24に
「Lightship Summit Tokyo 2022」が開催されるというアナウンスがあり、弊社からはが登壇します🎉✨また、記事の編集に協力してくれている佐久間が講師をつとめる「Lightship ARDK オンラインハンズオン」も今週末開催予定です❗人気のため増席を重ねており、Lightshipへの注目度が伺えます💻✨どちらのイベントも、参加されるみなさまとお会いできるのを楽しみにしています😊

ARDKやVPSに関する情報やR&DをTwitterで発信しているので、よかったらフォローしてくださいね😉

The Designium
Official website
Twitter (フォローお待ちしてます✨)
Facebook
Youtube

この記事が気に入ったらサポートをしてみませんか?