Forge - DevCon 2016: Building a Drone Imagery Service
-
Upload
autodesk -
Category
Technology
-
view
202 -
download
0
Transcript of Forge - DevCon 2016: Building a Drone Imagery Service
Jia HuangSoftware Engineer @ 3DRobotics
Building a Drone Imagery Service
@AutodeskForge
#ForgeDevCon
see the world from above
Site Scan
Site Scan
Survey Scan Inspect
Scan Results5 minute flights 84 Photos 90 minute processing time
Survey Results
Site Scan Video
• https://www.youtube.com/watch?v=6BTC1Zjo8Ic
Site Scan workflow
Site Scan workflow
• geotagging • user controls
• prepare job • user validation • saves results
• render mesh• take photos
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
3DR Cloud Architecture
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)
User Service▪ User Service keeps track of
▪ users
▪ groups ▪ permissioning
▪ Why Postgres? ▪ highly relational data ▪ use the right db for the job
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
Creating a Photoscene with Autodesk Recap
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 }
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 } } }
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
• 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