Search code examples
swiftios11swift4arkit

Save ARKit scene to backend and load later?


Apologizing in advance if my question is not phrased correctly; as I am new to AR technology, and a student in CS. I've been reading about AR all day, and I haven't been able to answer my question yet.

My question is: With ARKit from Apple, would we be able to load an ARKit scene, or session from a backend to recognize the plane it was created on? The perfect example is the Babysitter app in the WWDC demo. Could I create drawings on a surface at my house, save that session to a backend, and then when the babysitter comes over, it would download the session data from the cloud, and load the drawings in the positions in which they were saved?

Again, sorry if I butchered the question, I'm not experienced enough to ask this correctly yet.


Solution

  • Update: In "ARKit 2" aka ARKit for iOS 12, you can indeed save and restore AR session state. See my answer to this other question, the WWDC18 talk on ARKit 2, or Apple's ARKit docs and sample code.

    The problem with any sort of shared AR — be that two or more devices seeing the same experience at the same time, or one device making a recording for someone else (or even the original device) to experience later — is that such things require a shared frame of reference. That is, the coordinates 0,0,0 need to refer to the same real-world position (and orientation) for both users.

    Everything ARKit does is in a frame of reference relative to where your device was when you started the session, and it doesn’t offer a way to localize that frame of reference against any sort of “absolute” world coordinates. That is, if you try to record an experience where you’ve placed some virtual content at, say, 0.2, -0.1, -0.5, the only way someone playing back that experience later will see that content at the same real-world position is if the second person is standing in the exact same place, holding their device at the same height, and pointed in the same direction.

    The Giphy “notes for babysitter” demo that made the press a few weeks ago seems to mostly be about recording video of an AR experience.

    AR with a shared (or “absolute”) frame of reference might be possible, but it’s not something ARKit does right out of the box.