Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Question ARKit loses tracking on configuration change

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

  1. vlobano

    vlobano

    Joined:
    May 18, 2017
    Posts:
    5
    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:
    1,178
    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:
    5
    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. unity_andrewc

    unity_andrewc

    Unity Technologies

    Joined:
    Dec 14, 2015
    Posts:
    230