Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

ARFoundation v3.0

Discussion in 'Handheld AR' started by tdmowrer, Aug 29, 2019.

  1. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,293
    Great! Thanks @tdmowrer I’ll look into it.
     
  2. Balours

    Balours

    Joined:
    Nov 27, 2013
    Posts:
    48
    @tdmowrer
     
  3. mkrfft

    mkrfft

    Joined:
    Sep 8, 2017
    Posts:
    7
    @tdmowrer I can confirm that having a button toggling focusmode works on iOS. However setting it at in the settings or setting it by script on Start() does not affect it at all. At what time should I set the focusMode to fixed for it to take effect?
     
  4. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    553
    Hard to say, since it looks like we're wading into undefined behavior territory. I would setup a coroutine to set the autofocus a few frames after the camera is enabled and experiment with the timing.
     
  5. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    553
    Yeah, that's pretty broken. It will be fixed in 3.0.0-preview.4
     
  6. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    553
    For now, you can work around this by giving the ARCamera a non-identity transform. Set its X position to be 0.001, for instance. This will trigger the correct code path. For this to work, make sure you're using the TrackedPoseDriver with the "Use Relative Transform" checkbox checked.
     
    Balours likes this.
  7. pwshaw

    pwshaw

    Joined:
    Sep 16, 2014
    Posts:
    10
    Is there an ETA on when ARFoundation will be completely out of the development/ preview phase, and will have full support for all the ARKit 3 features?
     
    Last edited: Oct 10, 2019
  8. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    553
    Verified (non-preview) packages are tied to specific Unity releases, so the next verified release will be 2020.1. The current ARFoundation 3.0.0-preview packages are the preview of this release.
     
    Cromfeli likes this.
  9. Cromfeli

    Cromfeli

    Joined:
    Oct 30, 2014
    Posts:
    192
    Thank you very much for the heads up on this
     
  10. trnq1ll0

    trnq1ll0

    Joined:
    Aug 30, 2019
    Posts:
    5
    Building a simple AR project for iOS under Windows 10, with the help of iOS Builder, fails because of AR Foundation 3.0.0 Preview 4:

    Builder output:


    My "solution": downgrading to last stable versions:
    AR Foundation from 3.0.0 Preview 4 to 2.1.4
    AR Subsystem from 3.0.0 Preview 4 to 2.1.1
    AR Core from 3.0.0 Preview 4 to 2.1.2
    AR Kit XR Plugin from 3.0.0 Preview 4 to 2.1.1
     
  11. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    553
    What version of Xcode? In ARFoundation 3.0, we can target either Xcode 10 or Xcode 11. We do this based on what you choose in the Build Settings. However, on Windows, you can't pick a version of Xcode (since it is not installed) so we always pick Xcode 11.

    The errors you posted look like linker errors I would expect to get if building with Xcode 10 and linking against an Xcode 11 lib.
     
  12. TalespinJoe

    TalespinJoe

    Joined:
    Aug 20, 2018
    Posts:
    15
    When using the latest preview packages and Unity 2019.2.10f1 and I try to run the ARKitFaceBlendShapes scene, I am greeted with an error pink shader on the entire screen. Did I go wrong somewhere?

    This is what xcode spits out:

    So this seems to be an issue (as expected) with the background shader. So when I check out the shader. I get the following:

    The editor.log just repeats the same message (they're in more shaders, so might be something unrelated to ARFoundation)

    Edit:
    Seems to be an issue with the shader compiler on Catalina: https://issuetracker.unity3d.com/issues/ios
     
    Last edited: Oct 24, 2019
  13. trnq1ll0

    trnq1ll0

    Joined:
    Aug 30, 2019
    Posts:
    5
    Thanks for your reply. This makes totality sense to me. I think iOS Builder is using XCode10. Don't know if it sometimes support XCode11.
     
  14. pwshaw

    pwshaw

    Joined:
    Sep 16, 2014
    Posts:
    10
    @tdmowrer

    With ARfoundation's SimpleAR scene, the rotation of the Placed Prefab is zeroed out when the scene starts. And when you move the object onto a tracked plane, the object's rotation does not dynamically change to match the rotation of that plane. The rotation of the object remains frozen. I'm wanting to write a script where the Placed Prefab will match the rotation of the tracked plane it's resting on. Is there a way to do this?
     
    Last edited: Nov 1, 2019
  15. atorisa

    atorisa

    Joined:
    Dec 1, 2013
    Posts:
    156
    How AR Foundation is connected to New XR Platform? There is not enough information at this moment on Unity YouTube. I found something on Oculus Connect, but there are no mentions about AR Foundation. Please clarify it.

     
  16. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    101
    just set the rotation of the placed object to hitPose[0].rotation;
     
    pwshaw likes this.
  17. dnnkeeper

    dnnkeeper

    Joined:
    Jul 7, 2013
    Posts:
    65
    I tried using addressables for updating ImageLibrary but it didn't work out of the box on android with ARFoundation. What aspects of addressables you'd like to engage with XR? Assets and scenes are easily loaded with addressables regardless of XR setup.
     
  18. intermk

    intermk

    Joined:
    Oct 5, 2018
    Posts:
    2
    Hi,

    We're having problems building using BuildPipeline.BuildPlayer() with com.unity.xr.arkit-3.0.0-preview3 and com.unity.xr.arkit-3.0.0-preview4.

    We get an error about the Xcode 10 and Xcode 11 variants of UnityARKit.a colliding.

    Code (log):
    1. Plugin 'UnityARKit.a' is used from several locations:
    2. Packages/com.unity.xr.arkit/Runtime/iOS/Xcode1100/UnityARKit.a would be copied to <PluginPath>/UnityARKit.a
    3. Packages/com.unity.xr.arkit/Runtime/iOS/Xcode1000/UnityARKit.a would be copied to <PluginPath>/UnityARKit.a
    4. Please fix plugin settings and try again.
    We've had a PreBuildProcessor script that tries to delete the Xcode 10 variant of the .a file from Library/PackageCache, which seems to work sometimes...

    Note also that the paths the Editor is complaining about are in the (virtual) Package directory.

    This is the pre-build step:

    Code (CSharp):
    1.  
    2. public class PreBuildProcessor: IPreprocessBuildWithReport
    3.     {
    4.         public int callbackOrder => 0;
    5.  
    6.         public void OnPreprocessBuild(BuildReport report)
    7.         {
    8.             // Remove build-breaking Xcode 10 version of UnityARKit.a
    9.             File.Delete(Application.dataPath + "/../Library/PackageCache/com.unity.xr.arkit@3.0.0-preview.4/Runtime/iOS/Xcode1000/UnityARKit.a");
    10.             File.Delete(Application.dataPath + "/../Library/PackageCache/com.unity.xr.arkit@3.0.0-preview.4/Runtime/iOS/Xcode1000/UnityARKit.a.meta");
    11.            
    12.             // Hmmm. Our build logs say that Unity is attempting to access /Packages/com.unity.xr.arkit/Runtime/iOS/... so let's
    13.             // try that?
    14.             File.Delete(Application.dataPath + "/../Packages/com.unity.xr.arkit/Runtime/iOS/Xcode1000/UnityARKit.a");
    15.             File.Delete(Application.dataPath + "/../Packages/com.unity.xr.arkit/Runtime/iOS/Xcode1000/UnityARKit.a.meta");
    16.         }
    17.     }
    18.  
    However it doesn't work anymore...

    I guess I'll have to fork the package and remove the file?

    Has anyone seen anything similar?
     
  19. intermk

    intermk

    Joined:
    Oct 5, 2018
    Posts:
    2
    OK. I was able to fix it by copying com.unity.xr.arkit-3.0.0-preview.4 into the Packages directory, and removing the offending Xcode 10 variant of the .a.
     
  20. pwshaw

    pwshaw

    Joined:
    Sep 16, 2014
    Posts:
    10
    @unnanego

    Thanks for your help, but I tried that, and unlike hitPose[0].pose, ARRaycastHit does not contain a definition for 'rotation'.

    Did you try to implement this into the existing PlaceOnPlane script?
     
    Last edited: Nov 6, 2019
  21. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    101
    Code (CSharp):
    1. using System.Collections.Generic;
    2. using System.Linq;
    3. using UnityEngine;
    4. using UnityEngine.EventSystems;
    5. using UnityEngine.XR.ARFoundation;
    6. using UnityEngine.XR.ARSubsystems;
    7.  
    8. [RequireComponent(typeof(ARRaycastManager))]
    9. public class PlaceOnPlane : MonoBehaviour
    10. {
    11.     public GameObject ground;
    12.  
    13.     private GameObject _spawnedObject;
    14.     private static readonly List<ARRaycastHit> Hits = new List<ARRaycastHit>();
    15.     private ARRaycastManager _raycastManager;
    16.     private ARPlaneManager _planeManager;
    17.  
    18.     private void Start()
    19.     {
    20.         _raycastManager = GetComponent<ARRaycastManager>();
    21.         _planeManager = GetComponent<ARPlaneManager>();
    22.     }
    23.  
    24.     private void Update()
    25.     {
    26.         if (StatusTracker.GameStarted) return;
    27.         if (!TryGetTouchPosition(out var touchPosition)) return;
    28.         if (!_raycastManager.Raycast(touchPosition, Hits, TrackableType.PlaneWithinPolygon)) return;
    29.         if (Input.touches.Select(touch => touch.fingerId).Any(id => EventSystem.current.IsPointerOverGameObject(id))) return;
    30.  
    31.         var hitPose = Hits[0].pose;
    32.         _spawnedObject = StatusTracker.SelectedRobot;
    33.         _spawnedObject.SetActive(true);
    34.         _spawnedObject.transform.position = hitPose.position;
    35.         _spawnedObject.transform.rotation = hitPose.rotation;
    36.         ground.SetActive(true);
    37.         ground.transform.position = hitPose.position;
    38.         ground.transform.rotation = hitPose.rotation;
    39.  
    40.         StatusTracker.ActiveRobots[StatusTracker.CurrentIndex] = _spawnedObject;
    41.        
    42.         _planeManager.SetTrackablesActive(false);
    43.     }
    44.  
    45.     private static bool TryGetTouchPosition(out Vector2 touchPosition)
    46.     {
    47.         if (Input.touchCount > 0)
    48.         {
    49.             touchPosition = Input.GetTouch(0).position;
    50.             return true;
    51.         }
    52.  
    53.         touchPosition = default;
    54.         return false;
    55.     }
    56. }
    This is from the current project (I don't instantiate objects, I pool them for performance).
     
  22. RedRabbit_ChaoLun

    RedRabbit_ChaoLun

    Joined:
    Aug 26, 2019
    Posts:
    6
    @tdmourer We are working with an AR tool that loads images references and object references at runtime.

    I saw that images now can be loaded for tracking at runtime. Good.

    But what about object tracking? Can I add them at runtime?

    If not, will it be added later?
     
    samuelmorais and unnanego like this.
  23. RedRabbit_ChaoLun

    RedRabbit_ChaoLun

    Joined:
    Aug 26, 2019
    Posts:
    6
    Last edited: Nov 13, 2019
  24. RedRabbit_ChaoLun

    RedRabbit_ChaoLun

    Joined:
    Aug 26, 2019
    Posts:
    6
    Last edited: Nov 13, 2019
  25. RedRabbit_ChaoLun

    RedRabbit_ChaoLun

    Joined:
    Aug 26, 2019
    Posts:
    6
    upload_2019-11-13_12-49-6.png
    Delete button incorrect in unity2019.3.0b10
     
  26. Flarup

    Flarup

    Joined:
    Jan 7, 2010
    Posts:
    116
    Our game based on ARFoundation 3.0 preview 4 used to build just fine on Unity Cloud Build. However, very recently we started getting this error:

    9058: ▸ ⚠;️ ld: Could not find auto-linked framework 'QuickLookThumbnailing'
    9059: ▸ ❌; ld: symbol(s) not found for architecture arm64
    9060: ▸ ❌; clang: error: linker command failed with exit code 1 (use -v to see invocation)

    We're using Unity 2019.2.11 and XCode 10.2 on UCB. Did something change in XCode or UCB recently that caused this error to suddenly appear?

    There's also a thread about it here:

    https://forum.unity.com/threads/ios-build-unable-to-find-quicklookthumbnailing.777827/

    However, after much googling I'm starting think the error is coming from ARFoundation, so that's why I'm asking here.

    Thank you very much in advance for all help.

    Kind regards,
    Uffe Flarup
     
  27. nieyoub23

    nieyoub23

    Joined:
    May 8, 2016
    Posts:
    27
    With body tracking, is it possible to track from just the waist up? Or does it need to detect the entire body to instantiate?
     
  28. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    101
    release notes on the new version?
     
    Thimo_ and tyromotion like this.
  29. Russel1

    Russel1

    Joined:
    Jul 12, 2016
    Posts:
    1
    When I start the ARCoreFaceRegions scene on the Sony Xperia XZ Premium, the permission is requested but afterwards the camera screen remains black. But on my Google Pixel 2 it works fine.

    Sony Xperia XZ Premium
    Model:G8141
    Android: 9

    Can anyone confirm the problem?