Search Unity

Resolved AR Foundation what happens when ARSession loose tracking???

Discussion in 'AR' started by paulksi, Mar 17, 2020.

  1. paulksi

    paulksi

    Joined:
    Nov 9, 2015
    Posts:
    27
    Hello, what happens when ARSession loose tracking??

    How to know objects location in space when you cover up camera?
    What happens to the world position when tracking state is limited?
    I need to know objects position/rotation after camera is covered, but debug log says that it`s the same position but actually is not, probalbly the whole world is rotated after you cover up camera, can anybody advise how to know the exact object location?
    Thank you.

    In AR Session there is a code snippet :

    ARSession.cs

    void Update () {
    if (subsystem != null && subsystem.running) {
    if (m_MatchFrameRate && descriptor.supportsMatchFrameRate) {
    Application.targetFrameRate = subsystem.frameRate;
    QualitySettings.vSyncCount = 0;
    }

    subsystem.Update (new XRSessionUpdateParams {
    screenOrientation = Screen.orientation,
    screenDimensions = new Vector2Int (Screen.width, Screen.height)
    });

    switch (subsystem.trackingState) {
    case TrackingState.None:
    case TrackingState.Limited:
    state = ARSessionState.SessionInitializing;
    TrackingStateNotification.text = "LIMITED";
    break;
    case TrackingState.Tracking:
    state = ARSessionState.SessionTracking;
    TrackingStateNotification.text = "TRACKING";
    break;

    }
    }
    }

     
  2. paulksi

    paulksi

    Joined:
    Nov 9, 2015
    Posts:
    27
    Loged camer position, it seems that gyro is stopped when ARFoundation looses tracking?? why is that?
     
  3. mwlazlo885

    mwlazlo885

    Joined:
    May 17, 2018
    Posts:
    7
  4. ivoras

    ivoras

    Joined:
    May 21, 2020
    Posts:
    66
    > it seems that gyro is stopped when ARFoundation looses tracking?? why is that?

    bump
     
  5. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
    Hi @paulksi, the camera is required for AR tracking.