Search Unity

WorldMapping and MakeContentAppearAt clarification

Discussion in 'AR' started by OlivierHoel, May 24, 2019.

  1. OlivierHoel

    OlivierHoel

    Joined:
    Dec 15, 2017
    Posts:
    7
    Hi !

    TL;DR: what does "relative to the Camera" really means in the description of the rotation parameter, in the MakeContentAppearAt documentation ? How/Is ARSessionOrigin updated after worldmap has been loaded and mapped ?

    I'm using the new ARFoundation (and ARKit) to do a simple markerless, persistent, AR visualisation experience and I'm getting trouble having my 3D model aligned properly...

    Here is my workflow:
    - Step 1: run an AR session and "scan" the environment, then save all points and detected planes into a worldmap file (arkit feature). Manually position a specific ARReferencePoint in the environment (instantiating a frame reference prefab for debugging, e.g. a cube with visual x,y,z axis). NB: this is also saved into the worldmap file.
    - Step 2: in the editor, add reference prefab to a virtual model, place and orient it.
    - Step 3: run an AR session loading the previously created worldmap. Wait for ARKit to "map" the world then load virtual model and place it and orient it so that both reference prefab (the one created from the worldmap and the one present in the virtual model) match position and orientation. Thus virtual model is aligned to real world.

    For the last part, I'm using ARSessionOrigin.MakeContentAppearAt() function, passing my 2nd reference prefab as first parameter, and my ARReferencePoint for position and orientation. However, ARSessionOrigin.MakeContentAppearAt documentation specify that rotation is relative to the Camera. What does it mean exactly ? Do you have to compute another rotation from my ref point ?
    My virtual model is almost placed correctly (some drifting and location approximation when resolving worldmap I believe) but orientation is not really accurate. Using my cube-axis prefab for debug, I can see that both are placed at the same position but orientation is not matching exactly, and so my model is not aligned with real-world...

    Also I couldn't find any information about how ARSessionOrigin is affected after worldmap is loaded and mapped to current session...

    Thanks for insights!
    -- Olivier
     
    wintermuute and antonmarel like this.
  2. stich34

    stich34

    Joined:
    Nov 11, 2016
    Posts:
    7
    Did you ever get an answer to your question? Frustrating how there are so many un-responded questions on this forum.
     
    lukechadwick likes this.
  3. OlivierHoel

    OlivierHoel

    Joined:
    Dec 15, 2017
    Posts:
    7
    Nope, no answer on that question...
     
  4. yolon3000

    yolon3000

    Joined:
    Aug 1, 2018
    Posts:
    10
    Hi,OlivierHoel,I found a problem when I used the case provided by Unity, in ARWorldMap Sample, I slightly modified by placing a cube on the detected plane, and then saved it ,then close the App,I can't see the cube when i start the app and load the file again.is there something worry ?how do you mean "save all points and detected planes into a worldmap file ". thank you very much