Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ARKit + CoreLocation
Search
totomo
April 20, 2018
Technology
1
580
ARKit + CoreLocation
Presentation about ARKit + CoreLocation in Osaka Mix Leap Study #11
totomo
April 20, 2018
Tweet
Share
More Decks by totomo
See All by totomo
Yahoo! MAPにおけるARの活用事例 - FOSS4G Tokai 2018 -
totomo1217
1
540
ARKit + CoreLocation - Bonfire iOS #4 -
totomo1217
5
1.5k
AR mode in Yahoo! MAP
totomo1217
0
2.1k
ARKit - Nagoya iOS Meetup -
totomo1217
0
160
Other Decks in Technology
See All in Technology
AI導入の理想と現実~コストと浸透〜
oprstchn
0
190
AWS認定を取る中で感じたこと
siromi
1
170
論文紹介:LLMDet (CVPR2025 Highlight)
tattaka
0
310
第4回Snowflake 金融ユーザー会 Snowflake summit recap
tamaoki
1
240
生成AI活用の組織格差を解消する 〜ビジネス職のCursor導入が開発効率に与えた好循環〜 / Closing the Organizational Gap in AI Adoption
upamune
7
5.1k
KubeCon + CloudNativeCon Japan 2025 に行ってきた! & containerd の新機能紹介
honahuku
0
120
20250705 Headlamp: 專注可擴展性的 Kubernetes 用戶界面
pichuang
0
240
「クラウドコスト絶対削減」を支える技術—FinOpsを超えた徹底的なクラウドコスト削減の実践論
delta_tech
4
140
Lazy application authentication with Tailscale
bluehatbrit
0
170
OPENLOGI Company Profile
hr01
0
67k
United Airlines Customer Service– Call 1-833-341-3142 Now!
airhelp
0
160
ネットワーク保護はどう変わるのか?re:Inforce 2025最新アップデート解説
tokushun
0
190
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
Automating Front-end Workflow
addyosmani
1370
200k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
How STYLIGHT went responsive
nonsquared
100
5.6k
We Have a Design System, Now What?
morganepeng
53
7.7k
Balancing Empowerment & Direction
lara
1
420
Java REST API Framework Comparison - PWX 2021
mraible
31
8.7k
Writing Fast Ruby
sferik
628
62k
For a Future-Friendly Web
brad_frost
179
9.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Transcript
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 2018年4⽉20⽇
Kenta Tokumoto ARKit+CoreLocation
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 2
Outline • 自己紹介 • ARモードについて • ARKitの概要 • ARKit+CoreLocation • オブジェクトの配置方法について • ルートライン • 看板 • 足跡 • けんさく+ゴールピン • 空間補正
About me ,FOUB5PLVNPUP 5XJUUFSUPUPNP (JUIVCUPUPNP 2JJUBUPUPNP ໊ݹۈɺೖࣾ̒ :BIPP."1ͷJ04 8FC"1*։ൃ୲
3
AR mode? 4 • Yahoo! MAPアプリ(iOS)で提供しているARを使った徒歩 ナビ支援機能 • iOS 11から利用可能なARKitを使用
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 5
Team Product Manager Designer Engineer
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 6
Schedule 2017年9月〜 12月 1月 2月 3月 ルートライン、足跡 実験 看板、けんさく QA、申請 空間補正 リリース
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 7
ARKit • iOS 11以降で使えるAR機能を実装するのに便利 なFramework • AR modeはPosition Trackingを必要とするためA9 チップが搭載された端末のみサポート • Android → ARCore
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. ARKit
+ CoreLocation
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 9
ARKit+CoreLocation • ARConfiguration.worldAlignment.gravity AndHeadingを指定する • 原点の位置情報とARKitにより構築された 世界空間の原点は相互変換可能 AR 実空間 N N (xn , zn ) (latn , lonn )
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 10
ARKit+CoreLocation (0, 0) d [m] (x1 , z1 ) (lat0 , lon0 ) d [m] (lat1 , lon1 )
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 11
SCNNodeの配置 • ルートライン (SCNPlane) • 看板 (3D) • けんさく+ゴールピン(3D) • 足跡 (SCNPlane)
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 12
ルートライン
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 13
ルートライン position eulerAngles.y
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 14
看板
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 15
看板 position
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 16
看板 position
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 17
看板 position • マージンを設けて見やすい方向に回転 • 東西どちらに配置するかは、進行方向と 次の方向との差分から判断している
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 18
⾜跡
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 19
⾜跡 position
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 20
⾜跡 position • ARSCNViewから取れるpointOfView のpositionを取得 • 現在位置の座標をもとに移動距離と 角度を計算 • 足跡はランダムで出すようにmaterial に設定しているUIImageを動的に設定 している
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 21
けんさく+ゴールピン position SCNBillboardConstraint
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 22
SCNNodeの追加 locationInfoProvider.location { [weak self] location in guard let origin = location else { self?.displayError() return } self?.addObjects(origin: origin) }
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 23
⼤量のSCNNodeの追加 func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) { // 5つずつ追加する } self.navigationView.worldNode.addScheduledNodes(quantity: 5) func addObjects(origin: CLLocation) { self.navigationView.origin = origin let routeLineNodes = routeNodes(withCoordinates: self.coordinates) self.navigationView.scheduleNodes(routeLineNodes, priority: .high) } // ARSCNViewDelegate
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 24
空間補正 Correctable Space Fixed Space Root Space
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 空間補正
25 • Fixed Space • 足跡 • Correctable Space • ルートライン • けんさく&ゴールピン • 看板
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 空間補正
26 GPSによる現在地 (CoreLocation) AR空間上のカメラの現在地 (ARKit) GPSによる誤差の半径
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 空間補正
27 GPSによる現在地 (CoreLocation) AR空間上のカメラの現在地 (ARKit) GPSによる誤差の半径 誤差の円からはみ出してい る
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 28
LocationInfoProvider public protocol LocationInfoProvidable { func location(completion: @escaping (CLLocation?)->()) func nearbyRoutePoint(from origin: SCNVector3) -> SCNVector3? var delegate: LocationInfoProviderDelegate? { get set } } protocol LocationInfoProviderDelegate: class { // 角度補正 (電子コンパスまたは位置情報の精度が向上したタイミングで通知) // 精度: heading.headingAccuracy func locationInfoProvider(_ provider: LocationInfoProvidable, requestUpdateHeading heading: CLHeading) // 位置補正 (位置情報の精度が向上したタイミングで通知 // 精度: location.horizontalAccuracy func locationInfoProvider(_ provider: LocationInfoProvidable, requestUpdateLocation location: CLLocation, oldLocation: CLLocation?) }
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 空間補正
29 extension ARRouteNavigationViewController: ARLocationInfoProviderDelegate { public func arLocationInfoProvider(_ provider: ARLocationInfoProvidable, requestUpdateLocation location: CLLocation, oldLocation: CLLocation?) { guard let origin = navigationView.origin, let currentPosition = navigationView.pointOfView?.worldPosition else { return } // GPSから計算したAR空間における座標 let gpsPosition = location.coordinate.relativeVector3(to: origin.coordinate) + navigationView.worldNode.correctableNode.worldPosition // GPSの誤差を超えてずれていない場合は何もしない guard idealPosition.length(between: currentPosition) > location.horizontalAccuracy else { return } // 誤差を計算 let positionDifference = gpsPosition – currentPosition // 補正 navigationView.worldNode.correctableNode.worldPosition -= SCNVector3(positionDifference.x, 0, positionDifference.z) } }
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. 30
まとめ • ARKit + CoreLocation で実際の風景を見ながら道 案内ができる • ARKitが構成する空間座標と実空間の緯度経度は 相互に変換することができる • 3Dオブジェクトの配置にはSceneKitの知識が必要 • GPSや電子コンパスの精度を見つつカメラの座標 から位置や方向を補正可能 • ただしデバッグが大変です(笑)
Copyright (C) 2018 Yahoo Japan Corporation. All Rights Reserved. Fin