forge - devcon 2016: building a drone imagery service

22
Jia Huang Software Engineer @ 3DRobotics Building a Drone Imagery Service

Upload: autodesk

Post on 15-Apr-2017

206 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Forge - DevCon 2016: Building a Drone Imagery Service

Jia HuangSoftware Engineer @ 3DRobotics

Building a Drone Imagery Service

Page 2: Forge - DevCon 2016: Building a Drone Imagery Service

@AutodeskForge

#ForgeDevCon

Page 3: Forge - DevCon 2016: Building a Drone Imagery Service

see the world from above

Page 4: Forge - DevCon 2016: Building a Drone Imagery Service

Site Scan

Page 5: Forge - DevCon 2016: Building a Drone Imagery Service

Site Scan

Survey Scan Inspect

Page 6: Forge - DevCon 2016: Building a Drone Imagery Service

Scan Results5 minute flights 84 Photos 90 minute processing time

Page 7: Forge - DevCon 2016: Building a Drone Imagery Service

Survey Results

Page 8: Forge - DevCon 2016: Building a Drone Imagery Service

Site Scan Video

• https://www.youtube.com/watch?v=6BTC1Zjo8Ic

Page 9: Forge - DevCon 2016: Building a Drone Imagery Service

Site Scan workflow

Page 10: Forge - DevCon 2016: Building a Drone Imagery Service

Site Scan workflow

• geotagging • user controls

• prepare job • user validation • saves results

• render mesh• take photos

Page 11: Forge - DevCon 2016: Building a Drone Imagery Service

Challenges for the 3DR Cloud

• each image is ~10MB • up to 250 images per job

• soon <= 2000 images across multiple flights in one job

• Mesh / ortho / point cloud results are ~100MB to ~200MB

Page 12: Forge - DevCon 2016: Building a Drone Imagery Service

3DR Cloud Architecture

Page 13: Forge - DevCon 2016: Building a Drone Imagery Service

3DR Cloud API▪ All written in Scala with the Akka libraries

▪ Why Akka?

▪ Lightweight ▪ Flexible ▪ Everything is a stream

▪ Why Couchbase? ▪ Blob data ▪ Add more boxes as needed ▪ NoSQL with SQL interface (n1ql)

Page 14: Forge - DevCon 2016: Building a Drone Imagery Service

User Service▪ User Service keeps track of

▪ users

▪ groups ▪ permissioning

▪ Why Postgres? ▪ highly relational data ▪ use the right db for the job

Page 15: Forge - DevCon 2016: Building a Drone Imagery Service

Recap Service

▪ Actors encapsulate state and behavior

▪ Communicate exclusively through messages

▪ Uses Akka’s Actor system

▪ Supervisor & children ▪ Each child Recap actor keeps its own state ▪ Supervisor gets passed errors

Page 16: Forge - DevCon 2016: Building a Drone Imagery Service

Creating a Photoscene with Autodesk Recap

Page 17: Forge - DevCon 2016: Building a Drone Imagery Service

Actor Supervisor Pattern

▪ Children can crash without damaging the system

▪ Supervisors handle errors

import akka.actor.OneForOneStrategyimport akka.actor.SupervisorStrategy._import scala.concurrent.duration._override val supervisorStrategy = OneForOneStrategy(maxNrOfRetries = 10, withinTimeRange = 1 minute) { case _: ArithmeticException => Resume case _: NullPointerException => Restart case _: IllegalArgumentException => Stop case _: Exception => Escalate }

Page 18: Forge - DevCon 2016: Building a Drone Imagery Service

Actor Scheduling Pattern

▪ Actors can schedule themselves for future actions

class RecapActor(…) extends Actor with …{ implicit val system = context.system private var scheduledTask: Option[Cancellable] = None def receive = { case PollScene(…) => scheduledTask = scheduledTask match { case None => Some( context.system.scheduler.schedule(10 minutes, 10 minutes, self, PollScene(…) )) case Some(cancellable) => scheduledTask } } }

Page 19: Forge - DevCon 2016: Building a Drone Imagery Service

Interfacing with Autodesk Recap

▪ Handles authentication, sending & receiving to Recap ▪ Returns a Scala PhotoSceneEntity

▪ Formats, photolist, photoscene status, processing time, and any errors

▪ Reuploads photos during error states

▪ Built on top of Akka-requests-lib ▪ https://github.com/3drobotics/cloud-akka-request

Page 20: Forge - DevCon 2016: Building a Drone Imagery Service

• Depends on the integration type• State machine? Akka Finite State Machine

Mixin• Relational? Another Postgres backed service• Blob data?

• Keep things decoupled

Architecting future integrations

Page 21: Forge - DevCon 2016: Building a Drone Imagery Service

Questions?

[email protected]

@3drobotics @AutodeskForge #ForgeDevCon

Page 22: Forge - DevCon 2016: Building a Drone Imagery Service