Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question ARKit loses tracking on configuration change

Discussion in 'AR' started by vlobano, Aug 4, 2023.

  1. vlobano

    vlobano

    Joined:
    May 18, 2017
    Posts:
    4
    I'm allowing a user to choose camera feed's FPS and resolution by selecting respective
    XRCameraConfiguration and assigning chosen configuration to arCameraManager.currentConfiguration.

    This works fine but during the change there's noticeable lag in the camera feed and apparently session isn't tracking for couple seconds. If device is physically moved/rotated, all virtual objects end up in a different place. Here's a video: https://youtube.com/shorts/iOxtP5JJ6Dk

    I understand that when session is interrupted by the config change it's not tracking and hence the drift, but is there a way to restore/resume tracking properly somehow?

    Using ARFoundation 5.0 on ARKit
     
  2. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    824
    How is that object placed? Are you using anchors? Anchors would be the way to ensure that content remains in place even if the session relocalizes. (And if anchors aren't working for this, that sounds like a possible bug)
     
  3. vlobano

    vlobano

    Joined:
    May 18, 2017
    Posts:
    4
    Sorry for the delayed reply, I can confirm that having an anchor does help the session recover, and it seems that an anchor in more or less arbitrary location recovers the whole session, not just the object attached to the anchor. It's another question how to position it best, but at least I know where to start
     
  4. chickenplusone

    chickenplusone

    Joined:
    Aug 22, 2023
    Posts:
    2
    Hi, can you elaborate on how to get started?
     
  5. unity_andrewc

    unity_andrewc

    Unity Technologies

    Joined:
    Dec 14, 2015
    Posts:
    202