Search Unity

Relocalizing ARKit scene using ARFoundation after backgrounding

Discussion in 'AR' started by scrant, Jan 9, 2020.

  1. scrant

    scrant

    Joined:
    Jun 1, 2017
    Posts:
    73
    I’m pulling my hair out and can’t figure out how to properly relocalize an ARKit scene after backgrounding an app. I can’t figure out where or how to set the ARFoundation equivalent to Apple’s sessionShouldAttemptRelocalization. Instead, I’ve enabled ARKitCoachingOverlay which does indeed come up when you switch back to the application asking you to move around. If you’re pointing at the same area it usually seems to work but if you’re pointed somewhere else it doesn’t ask you to return to the previous area as Apple’s docs (https://developer.apple.com/documentation/arkit/arcoachingoverlayview) seem to indicate it should. Again maybe because we can’t set sessionShouldAttemptRelocalization first?

    In testing it always seems to return trackingState of “initializing” instead of “relocalizing” before moving to “tracking” so I don’t even know how to differentiate or capture this condition. It also doesn’t bring up the Start Over button to allow the user to reset tracking if it gets lost. Further, I don’t see any ARFoundation equivalents of coachingOverlayViewDidRequestSessionReset to allow us to intercept that even if the button did show up.

    So someone please help me understand the best practice to handle relocalization for ARKit using ARFoundation. Am I missing something or is Unity missing functionality for all this in ARFoundation?

    Many thanks.
     
    Blarp likes this.
  2. scrant

    scrant

    Joined:
    Jun 1, 2017
    Posts:
    73
    Bump. Anyone?
     
  3. astorms

    astorms

    Joined:
    Jan 31, 2018
    Posts:
    50
  4. jj1991

    jj1991

    Joined:
    Jul 19, 2017
    Posts:
    18
    Waiting for this feature since ARFoundation 1.0 :(, I think it's missing. It used to be in the UnityARKitPlugin from bitbucket
     
    Blarp likes this.
  5. marnsmith

    marnsmith

    Joined:
    Feb 7, 2013
    Posts:
    29
    Looking for this as well
     
  6. todds_unity

    todds_unity

    Joined:
    Aug 1, 2018
    Posts:
    324
  7. marnsmith

    marnsmith

    Joined:
    Feb 7, 2013
    Posts:
    29
  8. daverin_n

    daverin_n

    Joined:
    Oct 27, 2020
    Posts:
    11
    Has anyone found any solution to this yet? Without this feature it is very difficult to create relocalization experiences as the code has no way of knowing if relocalization was in fact successful.
     
  9. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062