Search Unity

Help Wanted MARS vs AR Foundation Image Tracking

Discussion in 'Unity MARS' started by jbraam, Jun 9, 2020.

  1. jbraam

    jbraam

    Joined:
    Mar 5, 2020
    Posts:
    10
    Dear all,

    I've been experimenting with the Image Tracking features in AR Foundation and recently tried the version in MARS. I've been able to get it working with both packages however in my testing there is huge difference between the tracking accuracy.

    Anyone any suggestions to make the MARS version as accurate as the pure AR Foundation version?

    I've created a video to demonstrate:



    Pure AR Foundation project:
    Unity 2019.3.14f1
    AR Foundation 2.1.8
    ARkit XR Plugin 2.1.9
    iPhone X iOS 13.4.1

    MARS 1.0.1 project:
    Unity 2019.3.15f1
    AR Foundation 2.1.8
    ARkit XR Plugin 2.1.9
    iPhone X iOS 13.4.1
     
    Blarp likes this.
  2. jbraam

    jbraam

    Joined:
    Mar 5, 2020
    Posts:
    10
    Xcode console prints this error:

    Code (Boo):
    1. 2020-06-09 13:12:01.829634+0200 MARSTest[18912:6182164] [Technique] VIO error callback: 603339.222858, 0, IMU processing rate has fallen below pre-set threshold
     
  3. leweyg_unity

    leweyg_unity

    Unity Technologies

    Joined:
    Jan 29, 2020
    Posts:
    38
    This "should" be the same in both scenarios, double checking now...
     
  4. jbraam

    jbraam

    Joined:
    Mar 5, 2020
    Posts:
    10
    That was also my intuition. But I can't seem to find what causes the discrepency in tracking performance.
    I also tried to make first a pure AR Foundation project and then migrate that project to MARS but I get the same result.
     
    Blarp likes this.
  5. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    264
    Hello @jbraam
    The team is working on this. If you set the value maxNumberOfMovingImages in ARFoundation for the ARF marker library through code to something different than 0 it should track correctly.
     
    jbraam likes this.
  6. jbraam

    jbraam

    Joined:
    Mar 5, 2020
    Posts:
    10
    Can you explain me how I can access this value from the MARS session?
    Adding the AR Tracked Image Manager component to change the value doesn't seem to work.
     
    Last edited: Jun 12, 2020
  7. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    264
    Hello @jbraam, again, we are fixing this for the next release; for the time being do this.

    Search for a file in your project called
    ARFoundationMarkerProvider.cs
    (it should be at
    com.unity.mars-ar-foundation-providers/Runtime/Scripts/ARFoundationMarkerProvider.cs
    )

    On the
    LoadProvider()
    method add the maxNumberOfMovingImages (Check the code).

    Code (CSharp):
    1.            
    2. if (!m_ARTrackedImageManager)
    3. {
    4.           m_ARTrackedImageManager = currentSessionGameObject.AddComponent<ARTrackedImageManager>();
    5.           m_ARTrackedImageManager.maxNumberOfMovingImages = 4;// <--- Add this line here.
    6.           m_NewARTrackedImageManager = m_ARTrackedImageManager;
    7. }
    8.  
     
    Last edited: Jun 12, 2020
    jbraam and cam415 like this.
  8. jbraam

    jbraam

    Joined:
    Mar 5, 2020
    Posts:
    10
    Hee @jmunozarUTech,

    This indeed solved my problem.
    Thanks for the help!
     
  9. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    264
    @jbraam woot woot!, hopefully you will not have to deal with this on our next release :) Glad to read that.
     
    Last edited: Jun 15, 2020
  10. xyannick

    xyannick

    Joined:
    Sep 8, 2014
    Posts:
    1
    Hee @jmunozarUTech

    I just installed the new update. And it seems to have the exact same problem. I'm changing it by hand at the moment. But the i'm using the colab function with my colleague and every time we update our project it resets this part of the code. It doesn't get seen as a change needed to be updated according to colab.

    Hope you got a solution for this.
     
  11. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    264
    Hello @xyannick,

    This issue got fixed; but im not sure if it went in, in the 1.0.2 release. Being said that. I'm not familiar how colab works but I would assume is like that because its a Unity Package. My advise would be to research how to add ignored files by colab and track that file with the changes.
     
  12. jbraam

    jbraam

    Joined:
    Mar 5, 2020
    Posts:
    10
    Can confirm that the issue is resolved for me with with the 1.02 release.
     
unityunity