---
title: Azure Digital TwinとUnreal Engineを統合するADTLink Pluginについて
tags:  #digitaltwins #ue4 #xrmtg #xr #azure  
author: [Miyaura](https://www.docswell.com/user/m-taka596)
site: [Docswell](https://www.docswell.com/)
thumbnail: https://bcdn.docswell.com/page/P7XM4626JX.jpg?width=480
description: XRミーティング 2021/11/17(https://osaka-driven-dev.connpass.com/event/229118/)登壇資料。 Unreal Engine上でAzure Digital Twinsを便利に使う「ADTLink Plugin」の紹介
published: November 17, 21
canonical: https://www.docswell.com/s/m-taka596/KXY1W4-XRMTG-ATDLink-plugin-for-unreal-engine-20211117
---
# Page. 1

![Page Image](https://bcdn.docswell.com/page/P7XM4626JX.jpg)

Azure Digital TwinとUnreal Engineを統合する
ADTLink Pluginについて
2021/11
XRミーティング
takabrz1
大阪駆動開発 Takahiro Miyaura


# Page. 2

![Page Image](https://bcdn.docswell.com/page/37KGZ1MGED.jpg)

Microsoft MVP for Windows Development 2018-2022
某会社でSE(アプリケーション領域のアーキテクト的なお仕事なはず）＝ XRは趣味です（貢献領域：Mixed Reality）
宮浦 恭弘
(Miyaura Takahiro)
◼ 大阪駆動開発(とHolomagicians)コミュニティに生息
◼ HoloLens日本販売してからxR系技術に取組む
◼ 普段はよくMixed Reality Toolkitに関する調査している
✓ リリース機能調べたり・・・
✓ 面白い機能使ってみたり・・・
✓ 新しい実験してフィードバックしたり・・・
最近はこちらに
Come Back気味
と思ったらDigital Twins
◼ 新しい技術や、MRに使えそうな技術を調べる
技術Tips : https://qiita.com/miyaura
@takabrz1
※よかったらこれを機にお知り合いになってください


# Page. 3

![Page Image](https://bcdn.docswell.com/page/LJ3NDQY5J5.jpg)

今日のお題
久しぶりのUnreal Engine絡みの話
Microsoft Igniteより
2021/11/17
Copyright © 2021 Takahiro Miyaura
3


# Page. 4

![Page Image](https://bcdn.docswell.com/page/8JDWP95YEG.jpg)

Mixed Reality的には目新しいものがなかったが・・・
主に事例紹介が中心
異彩を放つセションを見つけた
https://myignite.microsoft.com/sessions/77f30ebe-4201-4863-8f04-b9c201c9dd69
！？
◼ セションの内容
✓ Pixel StreamingのAzure対応
✓ ADTLink Pluginの紹介
2021/11/17
Copyright © 2021 Takahiro Miyaura
4


# Page. 5

![Page Image](https://bcdn.docswell.com/page/VEP9NZG278.jpg)

Unreal EngineとAzure Digital Twins
2021/11/17
Copyright © 2021 Takahiro Miyaoka
5


# Page. 6

![Page Image](https://bcdn.docswell.com/page/27VMKW6X7Q.jpg)

Unreal Engine
ローコード系の3Dコンテンツ作成プラットフォーム
2021/11/17
Copyright © 2021 Takahiro Miyaura
6


# Page. 7

![Page Image](https://bcdn.docswell.com/page/5JGGQDNRJL.jpg)

Azure Digital Twins
概要
現実の事象に対応するデジタル上の写像を管理
◼ 現実世界のモノ、場所、ビジネス プロセス、
および人々のデジタル表現を作成できる
◼ オブジェクト指向でいう・・・
✓ モデル→クラス
✓ モデル化された現実→インスタンス
現実世界をモデル化した表現
2021/11/17
Copyright © 2021 Takahiro Miyaura
7


# Page. 8

![Page Image](https://bcdn.docswell.com/page/47QXK1QYJP.jpg)

Azure Digital Twins
～ 模式図 ～
Building
要素毎のモデル化
名称, 住所, Floorを要素に持つ
Floor
Room
階数, Roomを要素に持つ
室名, 温度, 湿度, 人数
Entrance
開錠時間、施錠時間
物理環境をデジタルツイン化
物理環境
Building
物理環境情報の反映
（リアルタイム）
Floor1
Floor2
Entrance
Room
1
Room
2
Floor3
Room
3
Room
1
Room
2
Floor4
Room
3
Room
1
Room
2
Room
3
デジタル環境での表現
2021/11/17
Copyright © 2021 Takahiro Miyaura
8


# Page. 9

![Page Image](https://bcdn.docswell.com/page/KE46PRNZJ1.jpg)

Azure Digital Twins
DTDL(Digital Twin Definition Language)
{
}
&quot;@id&quot;: &quot;dtmi:com:adt:dtsample:home;1&quot;,
&quot;@type&quot;: &quot;Interface&quot;,
&quot;@context&quot;: &quot;dtmi:dtdl:context;2&quot;,
現実の事象としてデジタル情報をどう管理す
モデル情報
&quot;displayName&quot;: &quot;Home&quot;,
るかを規定（モデル化）
&quot;contents&quot;: [
{
&quot;@type&quot;: &quot;Property&quot;,
&quot;name&quot;: &quot;id&quot;,
&quot;schema&quot;: &quot;string&quot;
モデルの詳細情報
},
{
&quot;@type&quot;: &quot;Relationship&quot;,
&quot;@id&quot;: &quot;dtmi:com:adt:dtsample:home:rel_has_floors;1&quot;,
&quot;name&quot;: &quot;rel_has_floors&quot;,
&quot;displayName&quot;: &quot;Home has floors&quot;,
&quot;target&quot;: &quot;dtmi:com:adt:dtsample:floor;1&quot;
モデルの関係性
}
]
◼ Azure Digital Twinsに関するDTDLの解説
https://docs.microsoft.com/ja-jp/azure/digital-twins/concepts-models
◼ 規格
https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md
2021/11/17
Copyright © 2021 Takahiro Miyaura
9


# Page. 10

![Page Image](https://bcdn.docswell.com/page/L71V9Q5DJG.jpg)

結局セションの内容は？
2021/11/17
Copyright © 2021 Takahiro Miyaura
10


# Page. 11

![Page Image](https://bcdn.docswell.com/page/G7WLQM58J2.jpg)

なんかプラグイン開発してた話
Azure Digital Twinsのモデル作成とビジュアル化までUnreal Engineでやってみたという話
2021/11/17
Copyright © 2021 Takahiro Miyaura
11


# Page. 12

![Page Image](https://bcdn.docswell.com/page/4JZMWQN973.jpg)

Unreal Engineから効率的に
Azure Digital Twinsのサービスを利用する
ADTLink Plugins for Unreal Engine
1. Unreal EngineのEditor上で使えるプラグイン
2. デジタル空間上のセンサーにAzure Digital Twins
の情報を埋め込む
3. 埋め込んだ情報を集めてDTDLを生成
4. Azure Digital Twinsにモデルアップロード
5. モデルに対応する写像を生成
6. モデル間のリレーションの定義
2021/11/17
Copyright © 2021 Takahiro Miyaura
12


# Page. 13

![Page Image](https://bcdn.docswell.com/page/YE6NG68DEV.jpg)

アーキテクチャ
IoTセンサーから情報もらって整理して可視化
ADTLink Plugin
Unreal Editor 上から
Azure Digital Twinsのモデルと写像を作成
センサーデバイス
→Azure Digital Twins
Azure Digital
Twi
Azure Digital Twins
→アプリケーション
2021/11/17
Copyright © 2021 Takahiro Miyaura
13


# Page. 14

![Page Image](https://bcdn.docswell.com/page/GE55V698E4.jpg)

何がうれしいのか
2021/11/17
Copyright © 2021 Takahiro Miyaura
14


# Page. 15

![Page Image](https://bcdn.docswell.com/page/972N3M2VJR.jpg)

とにかく大変
1.
DTDLを自分で書く
2.
Azure Digital Twinsのモデルを登録
3.
リレーション含めた構造を生成
1.
Azure Digital Twinsの構造に合わせた
構造物の生成
2.
センサー情報の紐づけ
3.
データ受信時の挙動
Digital Twinというだけあって、同じような作業を繰り返すことになる。。。
2021/11/17
Copyright © 2021 Takahiro Miyaura
15


# Page. 16

![Page Image](https://bcdn.docswell.com/page/DJYP1XYQJM.jpg)

今回のプラグインのいいところ
2021/11/17
1.
Unreal Engineでセンサー（ADTLink用アクター）を配置
2.
配置したオブジェクトにモデル情報を設定
3.
ADTLinkを利用してモデルを生成
4.
ADTLinkを利用してリレーションを作成
5.
SignalRからの受信データ処理
※どうもこれもADTLinkでうまくやってくれている模様
Copyright © 2021 Takahiro Miyaura
16


# Page. 17

![Page Image](https://bcdn.docswell.com/page/V7N521P2E8.jpg)

少し実装紹介
2021/11/17
Copyright © 2021 Takahiro Miyaura
17


# Page. 18

![Page Image](https://bcdn.docswell.com/page/YJ9Y153D73.jpg)

モデル定義部分
DTDL定義とUnreal上の実装関係
{
&quot;@id&quot;: &quot;dtmi:com:adt:dtsample:home;1&quot;,
&quot;@type&quot;: &quot;Interface&quot;,
&quot;@context&quot;: &quot;dtmi:dtdl:context;2&quot;,
&quot;displayName&quot;: &quot;Home&quot;,
&quot;contents&quot;: [
{
&quot;@type&quot;: &quot;Property&quot;,
&quot;name&quot;: &quot;id&quot;,
&quot;schema&quot;: &quot;string&quot;
},
{
&quot;@type&quot;: &quot;Relationship&quot;,
&quot;@id&quot;: &quot;dtmi:com:adt:dtsample:home:rel_has_floors;1&quot;,
&quot;name&quot;: &quot;rel_has_floors&quot;,
&quot;displayName&quot;: &quot;Home has floors&quot;,
&quot;target&quot;: &quot;dtmi:com:adt:dtsample:floor;1&quot;
}
]
モデル情報
モデルの詳細情報
モデルの関係性
}
2021/11/17
Copyright © 2021 Takahiro Miyaura
18


# Page. 19

![Page Image](https://bcdn.docswell.com/page/GJ864YM5ED.jpg)

まとめ
2021/11/17
Copyright © 2021 Takahiro Miyaura
19


# Page. 20

![Page Image](https://bcdn.docswell.com/page/LJL964337R.jpg)

まとめ
◼ ADTLink for Unreal Engineでできること
✓ Unreal Engine上で構築するデジタルツインの構築に便利なプラグイン
✓ Azure Digital Twinsで必要なモデルやツイン構築を
Unreal Editorのみで実現可能
✓ アクターとAzure Digital Twinsの紐づけが不要
✓ センサー情報の受信もアクターと紐づけ
(プラグイン推奨のクラウド構成が必要)
Digital Twinsの構築に便利なプラグイン
・・・だと思います。
2021/11/17
Copyright © 2021 Takahiro Miyaura
20


# Page. 21

![Page Image](https://bcdn.docswell.com/page/47MZ5KDMJW.jpg)

まとめ
詳しくは・・・
Qiita記事で纏めています。
◼
「Ureal Engineで利用できるAzure Digital Twins用Pluginの解説 - サンプル動かす編」
✓ https://qiita.com/miyaura/items/77451f421f9bfc2d7699
https://github.com/Azure-Samples/azure-digital-twinsunreal-integration
もう少し詳しく書いています。
2021/11/17
Copyright © 2021 Takahiro Miyaura
21


# Page. 22

![Page Image](https://bcdn.docswell.com/page/P7R63X4LE9.jpg)

参考
Azure側の環境はGithubで公開されています。
Unreal Engine and Azure Digital Twins integration demo
◼
https://github.com/Azure-Samples/azure-digital-twins-unreal-integration
2021/11/17
Copyright © 2021 Takahiro Miyaura
22


# Page. 23

![Page Image](https://bcdn.docswell.com/page/PJXM46Z6EX.jpg)

大阪駆動開発
関西を中心に、IT系のおもしろそうなことを
楽しんでやるコミュニティ


