Search Unity

Resolved Loading Saved World Maps on iOS into Unity Editor [ARKit]

Discussion in 'AR' started by jirehcwe, Jan 11, 2020.

  1. jirehcwe

    jirehcwe

    Joined:
    Apr 14, 2016
    Posts:
    2
    Hi, I've been recently developing an app that uses the worldmap saving function of ARKit

    I was wondering if it was possible to take the .worldmap files that it generates and regenerate the planes detected in the Unity Editor on a desktop without AR support? Looking at the source code, it seems like the XRSessionSubsystem has a sealed implementation of ApplyWorldMap (line 208 of ARWorldMapController.cs from the AR foundation samples repository).

    Would appreciate if anyone familiar with the ARKit implementation could explain how to do so (if even possible).

    Thanks!

    p.s. Using ARFoundation 3.1.0preview3 with an iPhone XR.
     
  2. WheresMommy

    WheresMommy

    Joined:
    Oct 4, 2012
    Posts:
    890
    Did you ever get into any solution for this?
     
  3. jirehcwe

    jirehcwe

    Joined:
    Apr 14, 2016
    Posts:
    2
    Hey, I didn't, but what you could do is save the planes generated during runtime (since they are game objects with line renderers and points) in your own json file, then recreate the planes from there.

    I didn't need the planes, just an average of the floor height. Anyway, I have a public repository for what I used, it's neither performant or well tested, but you're free to check it out! Github Link
     
  4. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,142
    I'm not sure if this is what you're looking for, but recently, I added the ARWorldMap support to my remote plugin. With it, you'll be able to run your ARWorldMap scene just like it's running on a real device.
    The plugin sends the *.worldmap to a real AR device, then receives a reconstructed scene back. So technically, my plugin can't read the *.worldmap itself, but you will have access to reconstructed planes and anchors in the Editor.